Using FlexCAN with RXFIFO DMA stops TX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using FlexCAN with RXFIFO DMA stops TX

858 Views
freddy_ben-zeev
Contributor IV

I run FlexCAN transmit and receive in parallel continuously. If I configure the receive to use FIFO and DMA after some point the transmission stops. It looks like the transmission was started but I get no interrupt from the transmit mailbox. If I configure the receive to use mailbox or FIFO without DMA everything works fine. Is this something that anyone saw before?

Freddy

Tags (1)
0 Kudos
3 Replies

747 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

is this related to SDK driver, isnt it? if yes, which version, SDK 3.0.2?

Generally for the module, I am not aware of such issues. You can try to inspect CAN registers and TX MB, if this can say more.

BR, Petr

0 Kudos

747 Views
freddy_ben-zeev
Contributor IV

And... I think I've found the problem. The function FLEXCAN_SetMsgBuffIntCmd in flexcan_hw_access.c does read-modify-write on IMASKx registers without protection (same issue may be with some other functions and registers). It is called from program level and also from interrupt which is not safe. It gets worse for me as I'm running multiple threads and this is not thread-safe either.

freddy 

0 Kudos

747 Views
freddy_ben-zeev
Contributor IV

This is with SDK 3.0.2 and with FreeRTOS. What I've found at this point is that when the TX stops working the IMASK bit corresponding to the mailbox is clear while the IFLAG bit is set and the status tells me that transmission has started. I'm not sure as yet how the IMASK bit gets cleared (or not get set).

I'm continuing the bug hunt...

Freddy

0 Kudos