Example S32K144 FlexCAN RXFIFO DMA S32DS.ARM.2018.R1

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

Example S32K144 FlexCAN RXFIFO DMA S32DS.ARM.2018.R1

Example S32K144 FlexCAN RXFIFO DMA S32DS.ARM.2018.R1

Detailed Description:

Configures the FlexCAN 0 to transmit and receive a CAN message 
Baudrate to is set to 500kbps.

In this config, RXFIFO is used to receive a messages. 16 filter elements
are defined in the RXFIFO table. Both standard and extended IDs are used.
DMA is enabled in component inspector to read RXFIFO.

MB10 is moreover used to receive a message with given standard ID and
MB11 is used to transmit a message upon button press.

The callback function is installed as well and is it called each time message is 
received in MB10, RXFIFO or message is transmitted.

Note: EVB must be powered by 12V to have SBC's CAN transceiver active

* ------------------------------------------------------------------------------
* Test HW:        S32K144EVB-Q100
* MCU:            FS32K144UAVLL 0N57U
* Target:         Debug_FLASH
* EVB connection: PCAN-View with PCAN-USB Pro connected to CAN port J13
* Compiler:       S32DS.ARM.2018.R1 
* SDK release:    S32SDK_S32K1xx_RTM_3.0.0
* Debugger:       Lauterbach Trace32
Revision History:
Ver    Date           Author          Description of Changes
0.1    Apr-04-2019    Petr Stancik    Initial version
Labels (1)

Hi Petr Stancik, I flashed the example code into my EVB, nothing to be modified,

and I try to run it, but I press the button, there is no info output on Tx pin. Do u have any idea/suggestion on it?

The MCU and test HW is same to yours.

Hi Petr:

you example is useful,thanks!

but,this example only show one message receive at the interrupt using Rx FIFO DMA,what can be do when a large of frame need to receive?
I mean you main fuction Inquiry receive state,if there is many time-consuming operations in main fuction,In this case, frame will the be dropped or not?

another question is,I wonder the Rx FIFO mechanism:if IFLAG1[BUF5I] flag is asserted,according to SDK RTM3.0.2 mention:
if (mb_idx == FEATURE_CAN_RXFIFO_FRAME_AVAILABLE) {***}(flexcan_driver.c,line 1270);

it mean if MB0 have FIFO out ,MB1 - MB5 ,each MB already have frame?I see only in while(1){***} loop,mb_idx can be Increased。
in the Reference Manual said:"If there are more messages in the FIFO the act of clearing the interrupt updates the output of the FIFO with the next message and updates RXFIR with the attributes of that message, reissuing the interrupt to the CPU. "

what mean more message in the FIFO?if CANUSB sent 5 frame,this 5 frame can be load to M1 - M5 automatically?


I have the same problem. My CAN module CAN only receive one message.Could you share your solution, thank you very much!

I have the same question.When FIFO,why only MB0 can receive the value.

Hi, Petr Stancik,

I have same problem on Rx FIFO with SDK 3.02, only one MB (FLEXCAN_MB_HANDLE_RXFIFO) can be used. 


    /* Start receiving fifo */
    if (state->mbs[FLEXCAN_MB_HANDLE_RXFIFO].state != FLEXCAN_MB_IDLE)
        return STATUS_BUSY;

And only one message can be received at one time, after FLEXCAN_EVENT_RXFIFO_COMPLETE is triggered, I have to start receiving fifo to receive a frame again.


Matthew Xu

No ratings
Version history
Last update:
‎09-10-2020 02:45 AM
Updated by: