DEVKIT-MPC5478G sample code,FlexCAN receive code does not work, But transmit code works.

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

DEVKIT-MPC5478G sample code,FlexCAN receive code does not work, But transmit code works.

2,068 Views
yuhaopan
Contributor II

DEVKIT-MPC5478G sample code,FlexCAN receive code does not work, But transmit code works.

I use ValueCAN to connect DEVKIT-MPC5478G with PC , The Sample code flexcan_transmit works good .

see receive.png , The message with ID 0x555 is received by PC..

But the sample code flexcan_receive does not work.

The settings in ValueCAN side is shown in can- baudrate.png.

Does anyone meet the the same problem?

0 Kudos
Reply
4 Replies

1,736 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

I have already contacted you via case, so could we please use only one communication channel?

Here is the same answer I have already sent you:

I tested flexcan_receive example you had sent me in the attachment and it works correct on my side. But I did not use ValueCAN device, because I do not have it, so I had used another microcontroller.

I changed some parameters little bit (decrease speed to 100kbit/s and changed received ID to 0).

 

From the figure, you sent me I am not sure, if you have correctly terminated CAN bus. Please check, if you have connected 120-ohm resistor between CANH and CANL on both sides of the bus (I see some resistors in the figure, but I am not sure, how are connected and what is the value). I recommend you to connect CAN bus ground pin too.

To make sure that the ValueCAN device works correct, could you please measure TX signal on the bus and send it to me?

If you have at least two DEVKIT boards, you can try to load flexcan_transmit project into the first board and flexcan_receive project into the second board and try, if this works correct.

 

Regards,

Martin

0 Kudos
Reply

1,736 Views
yuhaopan
Contributor II
Hi Martin,
Thanks for your support.
I do connect 120-ohm resistor between CANH and CANL on both sides of the bus.
But I did not connect the ground pins on both sides.
In our case, CAN-H/CAN-L lines are connected to the vehicle directly without  connecting ground pin.
I try it according to your suggestions late and back to you.
Best Regards
Yuhao Pan
0 Kudos
Reply

1,736 Views
yuhaopan
Contributor II

ValueCAN3.png

0 Kudos
Reply

1,736 Views
yuhaopan
Contributor II

I do not know if ValueCAN3 work with MPC5748G FlexCAN interface.

The provider has another product named ValueCAN FD.

It seems for FlexCAN interface, I do not know the difference between ValueCAN3 and ValueCAN FD.

0 Kudos
Reply