SPC5748G FLEXCAN FIFO DMA Data loss

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

SPC5748G FLEXCAN FIFO DMA Data loss

跳至解决方案
548 次查看
longfeiwang
Contributor III

I use DMA to accept CAN bus RX data from ECU。But in fifo + dma mode, it may be that fifo can only store up to 5 messages,If at this time the ECU sends 10 messages,There must be a situation where the first five messages are received and the interrupt is entered, causing the following five messages to be lost。Is there a better way to avoid data loss on the CAN bus?

0 项奖励
1 解答
472 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the RXFIFO can store up to 6 messages and it is up to used to read it out so another message can be stored in RXFIFO otherwise further messages can be lost for sure. Ideally you could have IFLAG1[BUF5I] interrupt enabled so it will be called if  there is message available in the RXFIFO. If DMA is used then DMA request to read single message from RXFIFO is generated on IFLAG1[BUF5I] flag. If teh DMA is not blocked by higher priority DMA transfers, you should not see a situation you outlined.

BR, Petr 

在原帖中查看解决方案

0 项奖励
1 回复
473 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the RXFIFO can store up to 6 messages and it is up to used to read it out so another message can be stored in RXFIFO otherwise further messages can be lost for sure. Ideally you could have IFLAG1[BUF5I] interrupt enabled so it will be called if  there is message available in the RXFIFO. If DMA is used then DMA request to read single message from RXFIFO is generated on IFLAG1[BUF5I] flag. If teh DMA is not blocked by higher priority DMA transfers, you should not see a situation you outlined.

BR, Petr 

0 项奖励