AnsweredAssumed Answered

S32K144 FlexCAN Receive messages

Question asked by sarah wang on Nov 24, 2019
Latest reply on Dec 6, 2019 by Petr Stancik


I have some problems about FlexCAN receive message when I develop on S32K144.

I have to receive more than 10 messages from CANbus to get useful signals from them in my current project. So I need config message box for every message as following code, right? 

#define RX_CAN1FRAME_NUMBER     10
uint32_t MsgId[10] = {0x1f5, 0xf9, 0x22a, 0x541, 0x540, 0xf1, 0x1f1, 0x169, 0x1f2, 0x46a};
for(Index=0; Index<RX_CAN1FRAME_NUMBER; Index++)
   FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, Index,  &data_std_info, MsgId[Index]);

And I have to call receive function in a loop to receive every message as following code, right?
for(index=0; index<RX_CAN1FRAME_NUMBER; index++)
    FLEXCAN_DRV_Receive(INST_CANCOM1, index, &RxMsg);

And it is not necessory to use following function when initialize, right?

Waiting for your reply, thank you~

Best regards,