2393568_en-US

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

2393568_en-US

2393568_en-US

FLEXCAN EDMA - ACK errors while receiving a burst of CAN messages

On i.MXRT1176 we are using FLEXCAN with EDMA. (SDK 26.03)
We have a callback defined for DMA transfer complete.


This is our flow:

1. Call `FLEXCAN_TransferReceiveFifoEDMA()` to start the transfer.

2. On DMA transfer completion, user-defined callback is called.

3. Data is copied from DMA buffers, and `FLEXCAN_TransferReceiveFifoEDMA()` is called to continue receiving messages.
4. Repeat Steps 2-4


We noticed that when we transmit messages from another node in a burst with just the bare minimum Inter-Frame Space, we see an increase in number of ACK errors - the iMX is unable to ACK the messages. 


Going through the flow, it appears that every time there is a DMA transfer complete callback, DMA is disabled on FLEXCAN. It is re-enabled again when `FLEXCAN_TransferReceiveFifoEDMA()` is called.  This is done by calling `FLEXCAN_EnableRxFifoDMA()`. The enabling/disabling DMA updates the DMA bit in FLEXCAN's MCR register, and it can only be done in Freeze mode. As we are receiving messages in a burst, it is possible that a transmission is actively in progress when FLEXCAN is put it freeze mode. And it is unable to ACK the incoming message.

 
We confirmed that removing that call to `FLEXCAN_EnableRxFifoDMA()` removes all ACK errors, though now we are dropping some messages. Also, we tried spacing out the messages, and that also got rid of the ACK errors. Can you please confirm if this is indeed an issue with the implementation, or if we should be rearchitecting it in a different way?
标记 (1)
无评分
版本历史
最后更新:
星期六
更新人: