Hi Team,
When I attempt to use the FlexCAN on the S32K146, I am having trouble recovering the CAN bus if the CAN bus is temporarily or physically disconnected and then reconnecting.
The issues are
- If the CAN is disconnected, the BOFFINT bit (3rdbit of ESR1 value) is not set.
- After reconnecting, data is not transferring from CAN TX.
In code:
During initialization, I enabled and set the priority for the CAN1_ORed_0_15_MB_IRQn interrupt and used the FLEXCAN_DRV_InstallErrorCallback function to check the bus off status. The error callback function collects the error status data (the ESR1 value by the FLEXCAN_DRV_GetErrorStatus (INST_CANCOM1) function), and using CAN_ESR1_BOFFINT_MASK, I collect the BOFFINT bit value. If the bit is set, the CAN bus is aborted using FLEXCAN_DRV_AbortTransfer (INST_CANCOM1, 0).


I implemented the code as mentioned above after searching and gathering data from the NXP community, but the aforementioned issue is still there.
While debugging the error callback, tried to toggle the GPIO pin inside the error callback to validate the CAN error detection as continuous monitoring for reconnection. Found that the callback only called for some milliseconds for the error that occurred in the CAN bus; the callback function did not continuously call; it seems it stuck.

Any idea why this is happening and how to solve it?
@ArunkumarV FYR
Thanks