After verifying the FlexCAN_Ip_Example_S32K344 example can reach the end of the code, I modified it from loopback to Normal mode and assigned the pins to the CAN transceiver.
I then verified the message was transmitted correctly onto the CAN bus using a bus analyzer.
I removed the call to FlexCAN_Ip_Send() and tested again, this time using the CAN bus analyzer to transmit an 8 byte message to CAN ID 0x14. I expected to see FlexCAN_Ip_GetTransferStatus() succeed, but it never sees the message. I can see the message data reaching the CAN RX pin on the micro.
Is there anything else in the example that needs to change to successfully receive a CAN message?
I tried to convert this example to use CAN1 instead of CAN0 but get a hard fault at line FlexCAN_Ip_ConfigEnhancedRxFifo_Privileged(INST_FLEXCAN_1, &CAN1_EnhanceFIFO_IdFilterTable[0]);
I changed the following declarations INST_FLEXCAN_0, FlexCAN0_1_IRQn, flexCAN0_Callback, FlexCAN_Config0 to all use FlexCAN1 instead of FlexCAN0. I also updated the payload to use 8 bits instead of 64 bits.
What else do I need to change to make this work with CAN1?
Hi,
enhanced RXFIFO is only available on FlexCAN0, so most probably the hard fault comes from this, accessing reserved space.
BR, Petr
Hi,
you can refer to below example
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-FlexCAN-Ip-TX-RX-EnhanceRXFIFO-test...
BR, Petr