cancel
Showing results for 
Search instead for 
Did you mean: 

bxCAN Error Interrupts

jerry2
Senior
Posted on June 12, 2015 at 07:21

I've got error interrupts enabled on the bxCAN peripheral on an STM32F429, but can't figure out how to dismiss the interrupt. When the error interrupt handler is entered, what do I need to do to dismiss the interrupt so that it won't keep recurring continuously?

I would have thought that clearing the ERRI bit in the CAN_MSR register would do it, but it doesn't.
1 REPLY 1
jpeacock
Associate III
Posted on June 12, 2015 at 14:02

You need to check ERR, EWG, EPV, BOF and LEC.  There's also WKU and SLK if you are doing power management.  Check each of these bits and clear the corresponding IT pending bit.

For ERR you can check the REC and TEC error counts.  These drive the EWG early warning, EPV excessive error to passive mode and BOF bus off due to excessive TEC events.

If you see constant triggering of the SCE interrupt it's likely you have a bus problem.  A disconnected bus will flood the SCE interrupt until you disable the bus.  Look at REC and TEC.  If these counts are high the interrupts are real faults that are constantly occurring, especially if there are no other nodes on the bus.

What I do is disable the bus for a short period of time when it detects a disconnection.  That stops the SCE flood.  Then I periodically enable the bus again to see if more nodes are connected.  Disconnect time is always less than connect time to make sure I sync with a second node doing the same thing.

Look at your error registers on both nodes.  If both are doing the same thing check the cabling and termination.  If it's just one node then check the transceiver...although if you only have two nodes (the absolute minimum to run CAN) then the other node would also have problems if the transceiver was bad.

  Jack Peacock