Hi@Ali22
We have analyzed and discussed your problem before.
This should be a problem caused by the order of clearing the ESR1 register:
I can easily reproduce this working condition.
I wrote a test demo that you can use directly to observe, and I recorded a video for your reference
a. S32K146EVB
b. S32 Design Studio for Arm V2.2 + RTM 3.0.x
1. Run the attached project, which will send CAN frames regularly
2. Short CAN_H and CAN_L to simulate bus-off events
3. Enter flexcan0_ErrorCallback();
4. flexcan0_ErrorCallback() will reinitialize the flexcan module, and all flexcan registers will be reset
5. Try to send (continue to short CAN_H and CAN_L at this time)
6. The program will enter CAN0_Error_IRQHandler()->FLEXCAN_ClearErrIntStatusFlag(), where the ESR1 register will be cleared
7.For now, you will see the ESR1.BOFFINT = 0 but FLTCONF = 0x03.
The program will not into flexcan0_ErrorCallback() anymore.