How to apply DMA feature on CANFD in S32K144

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

How to apply DMA feature on CANFD in S32K144

跳至解决方案
1,015 次查看
Jimmybai
Contributor II

Hi,

I am working in CANFD communication between 2 CANFD EVB.  The code is based on S32K144_Demo_CANFD project. I find tx procedure alway faster than rx procedure even I have added 300ms delay after every transmiting packet. I want to use DMA to replace interrupt mode to make rx process faster, but It seems nowhere to change interrupt mode to DMA mode in PE.  Can you tell me how to modify code to use DMA mode for CANFD communication? Thanks.

标记 (1)
0 项奖励
回复
1 解答
954 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

try to refer to below example
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-FlexCAN-RXFIFO-DMA-S32DS-ARM-2018-R...
But it is using FlexCAN driver, CAN_Pal driver does not support DMA, as far as I know.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
3 回复数
996 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

The receive-only FIFO can support DMA, this feature is enabled by asserting both the
CAN_MCR[RFEN] and CAN_MCR[DMA] bits. But Rx FIFO must not be enabled when CAN FD feature is enabled.. So DMA and CAN FD cannot be used both on S32K1 devices.
See more in FlexCAN chapter of the device RM.

Enhanced RXFIFO allows that, but this is available on S32K3 devices.

BR, Petr

0 项奖励
回复
981 次查看
Jimmybai
Contributor II
Hi, Petr, thank you for your help. Then, we can talk some detailed issue. How to enable DMA feature in CAN code in S32 DS's PE? I am working on s32k144_Demo_CAN example project, There is "Enable Rx Fifo Extension" option in can_pal0 components, and there is ”Chnnel Number“ option in "dmaController1:edma" components, but when I change these setting. In CAN_Init(.....) function of can_pal.c, the flexcanConfig.rxFifoDMAChannel always be 0 and flexcanConfig.transfer_type always be FLEXCAN_RXFIFO_USING_INTERRUPTS, not FLEXCAN_RXFIFO_USING_DMA, why?
0 项奖励
回复
955 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

try to refer to below example
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-FlexCAN-RXFIFO-DMA-S32DS-ARM-2018-R...
But it is using FlexCAN driver, CAN_Pal driver does not support DMA, as far as I know.

BR, Petr

0 项奖励
回复