Dtynin
Dtynin
How can I implement a recovery mechanism for CAN Bus errors on the AVR128DA48 to avoid manual resets
I’m encountering error frames on the CAN Bus when two nodes try to send data simultaneously. I’m using the AVR128DA48 microcontroller. Below is my CAN Bus error handling code:
void can_error_handler(const struct zcan_frame *frame, void *arg) {
if (frame->error_flags) {
printk("CAN error: 0x%02x\n", frame->error_flags);
}
}
void can_error_handler(const struct zcan_frame *frame, void *arg) {
if (frame->error_flags) {
printk("CAN error: 0x%02x\n", frame->error_flags);
}
}
The system occasionally enters Bus Off mode, and I need to manually reset the CAN controller. How can I implement a proper recovery mechanism to handle CAN errors and automatically recover from Bus Off mode without manual intervention?
3 replies