Hi all,
Please bear with as I am not a native English speaker and the following post may not be the easiest to read.
I am currently overhauling a CAN bus off recovery implementation based on the auto bus on recovery (CANMC.ABO) in one of our projects.
Due to some specification changes a specific timing for the bus recovery and hence also for the restart of the CAN transmission is required. This makes using the automatic configuration impossible. Basically the automatic bus on recovery is too fast.
I would like to stick to the using CANMC.ABO implementation, but I so far I found no way to indicate to the application software that an automatic bus on has occurred. As a result I started to check the manual bus recovery.
In my understanding of the bus off detection according to "SPRUEU1" for this Controller the CANTEC will increase in case off bus off passing various error levels (EW & EP) before finally at reaching a CANTEC counter value of 256 trigger a Bus off and flagging this state using CANES.BO and CANMC.CCR for the appropriate CAN bus.
Once the bus off state is reached the CANREC counter will provide the information if the CAN bus is once more ok. Unfortunately I find the description in "SPRUEU1" for what circumstances cause the change of meaning for the CANREC counter rather ambiguous. What is considered to be the “bus off state”? Is it required that CANES.BO is set to 1 or is it required that CANMC.CCR bit is set to 1 or are both bits required to change the function of CANREC to counting recessive bits?
In my understanding in a bus off state once the CANREC counter has reached 128 the bus can be considered ok and a manual bus on by setting the CANMC.CCR to 0 can be considered safe.
So far during my implementation and testing, although the bus off condition is applied continuously (CAN High and CAN Low are shorted), the CANES.BO is first set to 1 and the CANMC.CCR is set to 1, but somehow the CANES.BO is reset to state 0 without performing any manual bus on (and CANMC.ABO == 0). So far I haven't found any code line writing to the CANES register.
When the bus off condition is removed (CAN High and CAN Low are no longer shorted) I never found the CANREC counter to be set to a different values as 0. As a result I do not know when to perform the manual bus on and restart sending.
Is my understanding of the mechanics for recognizing the bus off state and also for recognizing the bus on condition correct? Any idea for why the CANES.BO changes its value or how to get the information to start the manual bus recovery?
Thanks for reading this rather long post. I'd tried my best to describe my problem as on point as possible.