Hi, All,
I'm using MPC5748G devkit to implement CAN Receice an CAN Send.
I saw there is an example code in "S32_SDK_MPC574xx_EAR_0.8.1" about FLEXCAN but it is only show how to receive an static CAN ID's message by using API[ FLEXCAN_DRV_Receive(uint8_t instance,uint8_t mb_idx,flexcan_msgbuff_t *data)]. I want to receive many CANID's message and then to sort and handle them, but i don't know how to config.
Could you please provide an example for me? Thanks~
uint32_t fifo_filter[5] = {0x111,0x222,0x333,0x444,0x555};
flexcan_id_table_t config_fifo = {
.isRemoteFrame = false,
.isExtendedFrame = false,
.idFilter = fifo_filter,
};
FLEXCAN_DRV_Init(INST_CANCOM1, &canCom1_State, &canCom1_InitConfig0);
FLEXCAN_DRV_SetRxMaskType(INST_CANCOM1, FLEXCAN_RX_MASK_GLOBAL);
FLEXCAN_DRV_SetRxFifoGlobalMask(INST_CANCOM1, FLEXCAN_MSG_ID_STD, 0x1FFFFFFF);
FLEXCAN_DRV_ConfigRxFifo(INST_CANCOM1, FLEXCAN_RX_FIFO_ID_FORMAT_A, &config_fifo);
flexcan_msgbuff_t recbuff;
for (;;) {
FLEXCAN_DRV_RxFifo(INST_CANCOM1, &recbuff);
}
Hello Wu,
You can find an example of initialization and read of CAN Rx FIFO here https://community.nxp.com/thread/473207 .
I advise you to use latest version of SDK available for Power Architecture RTM 2.0
BR,
Alexandru Nan
Hi,
Unfortunately we do not have the example you are asking for, however you maybe fond use for examples which need to be ported tho MPC5748G micro from our repository:
Example MPC5744P FlexCAN TX RXFIFO ISR GHS614
https://community.nxp.com/docs/DOC-329623
regards,
Peter