AnsweredAssumed Answered

CAN Bus Error Management

Question asked by brianN on Apr 17, 2015
Latest reply on Mar 25, 2017 by Szeliga.Zbigniew.001
Hey guys, using the STM32F4 + cube, I setup a CAN device which works good until I play around with disconnecting the CAN bus lines and reconnecting them. Doing so produces bus errors and I am not sure how to handle these errors in a recoverable way?

What I currently do (which is not working)
When the CAN Error callback occurs:
1) Disable CAN SCE 
2) Set CAN into silent mode
3) Disable the error flag
4) Set a 5-second timer that is used by the RTOS to try to recover. During this 5-second timer I disable all CAN Rx/Tx handling (bypass my CAN manager task)

When the 5-second timer expires, I do this:
1) Reset silent mode
2) Re-enable the SCE interrupt
3) Re-enable error flag

The CAN bus does not recover however...Anyone have any ideas as to what else I should be doing?

Many thanks!