Using FlexCAN with RXFIFO DMA stops TX

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Using FlexCAN with RXFIFO DMA stops TX

2,357 次查看
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

标记 (1)
0 项奖励
回复
3 回复数

2,246 次查看
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 项奖励
回复

2,246 次查看
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 项奖励
回复

2,246 次查看
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 项奖励
回复