chor(twai): improve error logging in _node_queue_tx function
Enhanced error message for unmatched dlc and buffer_len. Merges https://github.com/espressif/esp-idf/pull/17888
This commit is contained in:
committed by
wanckl
parent
e0577ae677
commit
4f1cf6a5d2
@@ -311,7 +311,7 @@ The TWAI controller can detect errors caused by bus interference or corrupted fr
|
||||
- **Error Passive**: When either TEC or REC is greater than or equal to 128, the node enters the passive error state. It can still communicate on the bus but sends only one **passive error flag** when detecting errors.
|
||||
- **Bus Off**: When **TEC** is greater than or equal to 256, the node enters the bus off (offline) state. The node is effectively disconnected and does not affect the bus. It remains offline until recovery is triggered by software.
|
||||
|
||||
Software can retrieve the node status anytime via the function :cpp:func:`twai_node_get_info`. When the controller detects errors, it triggers the :cpp:member:`twai_event_callbacks_t::on_error` callback, where the error data provides detailed information.
|
||||
Software can retrieve the node status from tasks via the function :cpp:func:`twai_node_get_info`. When the controller detects errors, it triggers the :cpp:member:`twai_event_callbacks_t::on_error` callback, where the error data provides detailed information.
|
||||
|
||||
When the node’s error state changes, the :cpp:member:`twai_event_callbacks_t::on_state_change` callback is triggered, allowing the application to respond to the state transition. If the node is offline and needs recovery, call :cpp:func:`twai_node_recover` from a task context. **Note that recovery is not immediate; the controller will automatically reconnect to the bus only after detecting 129 consecutive recessive bits (11 bits each).**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user