3.12.4.2 Error managementThe HAL drivers จัดให้มีใช้ a check บนรายการต่อไปนี้:
• Valid parameters: สำหรับบางขบวนการ the used parameters ควรถูกต้องและกำหนดไว้แล้ว, มิฉะนั้น the system อาจขัดข้องหรือเข้าสู่สถานะไม่ได้กำหนด พารามิเตอร์ที่สำคัญเหล่านี้ได้รับการตรวจสอบก่อนถูกใช้งาน (ดูตัวอย่างด้านล่าง).

• Valid handle: the PPP peripheral handle เป็น the most important argument เนื่องจากมันเก็บ the PPP driver vital parameters. มันถูกตรวจเช็คเสมอในจุดเริ่มต้นของ the HAL_PPP_Init() function.

• Timeout error: the following statement ถูกใช้เมื่อ a timeout error เกิดขึ้น:

เมื่อ an error เกิดขึ้นในระหว่าง a peripheral process, HAL_PPP_Process () ส่งคืนกลับด้วย a HAL_ERROR status. The HAL PPP driver จัดให้มีใช้ the HAL_PPP_GetError () เพื่อยอมให้การดึงที่มาของ the error.

ในทุก peripheral handles, a HAL_PPP_ErrorTypeDef ถูกกำหนดและถูกใช้เพื่อเก็บ the last error code.

The error state และ the peripheral global state ถูกอัฟเดตก่อนการส่งคืนกลับ an error เสมอ:

HAL_PPP_GetError () ต้องถูกใช้ใน interrupt mode ใน the error callback:
