Simple FlexCAN receive example using RTDs

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

Simple FlexCAN receive example using RTDs

986 Views
hns80
Contributor V

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?

 

0 Kudos
3 Replies

960 Views
hns80
Contributor V

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?

Screenshot 2023-02-02 165750.png

0 Kudos

935 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

enhanced RXFIFO is only available on FlexCAN0, so most probably the hard fault comes from this, accessing reserved space.

PetrS_0-1675680028258.png

BR, Petr

 

0 Kudos

967 Views
PetrS
NXP TechSupport
NXP TechSupport
0 Kudos