I meet similar but a little different problem referred here (e2e.ti.com/.../tda4vm-one-busoff-operation-triggers-two-interrupts)
, the SDK version is 0805. The DAR is disable(which means Auto-Retransmission is enabled), BusOffProcessing Type is Interrupt.
I generated busoff by shorting CAN_H and CAN_L, can driver successfully entered Can Interrupt, then notify upper layer. The upper layer start the recovery process. During this process, I keep shorting CAN_H and CAN_L.
I use recovery strategy of AUTOSAR CanSM, it will stop upper layer from calling Can_Write to transmit once received busoff event, then start can controller.
After start can controller successfully, it will delay L1(a time set before), then restore upper layer's transmit, so that upper layer can call Can_Write to transmit.
following is the stae machine of recover process
I meet a problem that the second busoff event generated during L1, and it interrupt the recovery process.
1. I wonder how the second event generated, cause there is no new transmit request from upper layer during L1.
2. Does Can diver re-transmit as soon as started, whether upper layer call can_write or not?
3. If it is, should I start can driver after L1 timeout, instead of start it before L1?
For the first time, the BO, EP, EW and PED bit of MCAN_IR register are set to 1.
The second time, the PED and BO bit of MCAN_IR register is set to 1.
I also checked MCAN_CCCR[0] INIT bit when received busoff event by MCAN_getOpMode(baseAddr).
For the first time, INIT bit is 1. The second time, INIT bit is 0(normal operarion).
I find below explaination in TRM, does "or by going Bus_Off state" mean that this bit will be set to 1 when enter busoff?
If it is, why the INIT bit is 0 when second busoff event occured?