cancel
Showing results for 
Search instead for 
Did you mean: 

bxCAN Tx Interrupt problem

wolfgang2
Associate II
Posted on January 30, 2015 at 15:55

Hi all,

i have a problem with the bxCAN Tx interrupt as follows:

@ heavy bus load, i.e. >8  CAN nodes generating CAN messages (DLC=8) @ 1 Mbps resulting in aprox. 95% bus load the following happens:

I get an Tx int w/ CAN_TSR_RQCP2 = 1 and CAN_TSR_TXOK2 = 0 and CAN_TSR_TERR2 = 0 and CAN_TSR_ALST2 = 0

Evaluating the CAN_TSR_TXOK2 for being true makes my application stall.

I'm not sure yet whether this is true for Queue 0 and 1 too (at least it is much less frequent).

The NART bit in the CAN_MCR set to false. Looking at the Transmit mailbox states diagram (figure 227 in the RM) above mentioned bit combination CANNOT happen.

BTW ABORT is not used in my application.

Any ideas?

Thanks Wolf

#can-tec
3 REPLIES 3
jpeacock
Associate II
Posted on January 30, 2015 at 20:42

With NART turned off you won't get automatic retries on any TX error.  With that bus loading you should be seeing arbitration errors frequently.  What does your TEC look like?  Too many errors and your bus goes into passive or disconnect. (at TEC=128).  My guess, you see the odd status because TEC is over a limit.

Do you use the SCE interrupt?  It can catch all kinds of transient error conditions you won't see with polling.  With heavy bus contention you really need to monitor the TEC and the warning levels in the SCE interrupt to make sure you don't get disconnected from excessive errors, or at least you get a notice you have to recover the bus (disconnect and connect).

Do you use all three TX mailboxes?  One active mailbox at 95% bus load and 1mbit means you are going to miss several TX windows.  Turning off NART compounds the missed TX windows for arbitration retries.

  Jack

wolfgang2
Associate II
Posted on February 02, 2015 at 10:03

@ Jack:

Many thanks. I'll look into this today and will report.

Wolf

ma.alam9
Associate II
Posted on September 14, 2016 at 14:29

Hello All,

I have been using CAN Tx Rx with polling and timeout for a long time but now I want to do it with interrupts. I am usnig an STM32f334c8t7 processor which is interfraced to Microchip's 2562 CAN transciever. I can enable interrrupt in the IER and some CAN messages are sent (6 to be precise)  before it all freezes. I can actually not make up the sequence for transmitting via interrupts. When should i enable the TME interrupt when and what should be in the TX Complete callback function. Is it necessary to implement it or not? can somebody please draw a basic outline of the sequence. PS: I am using MX Cube for code generation and i think somehow this HAL locking unlocking is messing it all up. I want to quickly fill all the 3 mail boxes one by one and then they get transmitted and i get the interrupt upon which i would transmit even more messages and so on.

Thanks