cancel
Showing results for 
Search instead for 
Did you mean: 

Using bxCAN interrupt driven

gusztav
Associate
Posted on July 20, 2017 at 16:22

I'm using the bxCAN peripheral of an STMF3 uC in an environment where

1.) it is essential that the node is detached from the network once the REC/TEC has reached the warning level (waiting for the bus-off condition is not an option)

2.) the baud rate of the host network is unknown

3.) the connection might be sporadic as the node is connected by the user

Due to 1.) the STM32 HAL CAN driver is used in IT mode and whenever the called with the EWG flag set, the error callback shuts down the transceiver and deinitializes the bxCAN. In case the REC is over the limit, it is easily recovered by configuring the bxCAN in silent mode, assuming there is traffic on the CAN. However, if the TEC is over the limit, the bxCAN won't be able to transmit an other frame as the error interrupt will be instantly triggered once enabled.

I tried decrementing the TEC by transmitting frames in silent loopback mode but successful transmissions do not affect the TEC in this mode it seems.

2.) and 3.) are there to demonstrate that transmission errors might occur during normal operation.

Any suggestions are welcome.

#isr #bxcan #interrupt
0 REPLIES 0