How to apply DMA feature on CANFD in S32K144

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to apply DMA feature on CANFD in S32K144

Jump to solution
1,037 Views
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.

Tags (1)
0 Kudos
Reply
1 Solution
976 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
1,018 Views
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 Kudos
Reply
1,003 Views
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 Kudos
Reply
977 Views
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 Kudos
Reply