SPC5748G CAN DMA Continuous interruption

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

SPC5748G CAN DMA Continuous interruption

1,829 次查看
longfeiwang
Contributor III

I initialized the function of  in the project,Then, after continuously sending 8 frames of data(0-7) with ID 0X555, it enters the interrupt.After I fetched this data(1-7) from the RxDATA buffer,I continue to send 8 frames of data(8-15) with ID 0X555,DMA can not enter the interrupt。When I checked the SADDR.R register and the DADDR.R register, the address changed after the first interrupt,So I re-initialized these addresses in the interrupt function but still cannot enter the interrupt function。

How to configure the register to continue to use the DMA to carry the data in the CAN FIFO again after entering  DMA interrupt?

0 项奖励
回复
3 回复数

1,695 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

please do modification of below lines in DMA_Init() function

EDMA.TCD[DMA_CHANNEL].SLAST.R = -16; /* address Adjustment after major loops */

EDMA.TCD[DMA_CHANNEL].DLASTSGA.R = -16; /* addr adjustment after major loop */

EDMA.TCD[DMA_CHANNEL].CSR.B.DREQ = 0; /* do not Disable Request */

BR, Petr

0 项奖励
回复

1,695 次查看
longfeiwang
Contributor III

HI  Petr

           Follow your advice ,The following code has been added。

EDMA.TCD[DMA_CHANNEL].SLAST.R = -16; /* address Adjustment after major loops */

EDMA.TCD[DMA_CHANNEL].DLASTSGA.R = -16; /* addr adjustment after major loop */

EDMA.TCD[DMA_CHANNEL].CSR.B.DREQ = 0; /* do not Disable Request */

When i send data for the first time   ID: 0X555  data:FF 02 03 04 05 06 07 08 The data in the FIFO buffer is as follows。

pastedImage_2.png

The data in the RxDATA[] buffer is as follows。

pastedImage_3.png

When i send data for the second time   ID: 0X555  data:EE 02 03 04 05 06 07 08 The data in the FIFO buffer is as follows。

pastedImage_4.png

The data in the RxDATA[] buffer is as follows。

pastedImage_5.png

Summary: Both DMA interrupts can be entered normally,The first time the data received by the FIFO is normal, the data carried by the DMA is also normal。The data received in the second FIFO is significantly different from the data sent,The DMA entry interrupt seems to indicate that the DMA has carried out the handling operation normally,But the data in RxDATA[]  seems to be the first data sent,When the second DMA interrupt is completed, there is a problem with the data received by the CAN FIFO And DMA did not carry the wrong data received。

0 项奖励
回复

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