Other Parts Discussed in Thread: AM62P,
Tool/software:
Hi Experts:
We are using a MSPM0G3507 with a CAN interface on one of our HW design. We are applying CANopen and the firmware tries to send heartbeat messages every 2 seconds.
What I'm usually seeing when the CAN bus is in an unterminated state (for instance when no cable is connected) is that the error counter MCAN_ECR.TEC goes up to a value of 128, causing the CAN controller to enter the "Error Passive" state (MCAN_PSR.EP=1). In most cases the error counter stops there even though the firmware continues to try sending heartbeat messages.
Question 1: Why does the error counter MCAN_ECR.TEC (usually) stop incrementing at 128?
I ran into a situation once (!) in which the error counter MCAN_ECR.TEC did go higher. The value I saw was 248, but the CAN controller had entered the "Bus Off" state (MCAN_PSR.BO=1), indicating that the error counter had reached a value of 255 before I read it. I'm not sure, though, how the error counter can decrement when the CAN controller is in "Bus Off". The error counter did not decrease when I reconnected the CAN cable and terminated the bus. The only option I found to get the MCU out of this state was to reset it.
Question 2: Under which conditions does the error counter MCAN_ECR.TEC increment beyond 128?
Question 3: How can I recover from the the "Bus Off" state w/o resetting the MCU?
Basically that same questions also applies to the AM62P (running Linux), which we use at "the other end". The CAN controllers appear to be very similar (if not the same). It seems that the TRMs of neither the MSPM0G3507 nor the AM62P provide any details about this behavior.
Any help or additional documentation would be appreciated.



