MPC5748G FlexCan Receive Example not receiving data

cancel
Showing results for 
Search instead for 
Did you mean: 

MPC5748G FlexCan Receive Example not receiving data

472 Views
dh14
Contributor II

Hello, I am new to the nxp world and am trying to get my MPC5748G to receive data from and ECU. I create a new project from the examples and set all my debugger settings up to the openSDA settings. I have connected the canH(pb0) and canL(pb1) to the corresponding canH and canL  and ground on the 9 pin connector. When I go to run the example I get stuck during the debug mode on the line 

while (can_0.iflag1.b.buf4to1i !=   {}; /* wait for can_0 mb 4 flag */

rxcode = can_0.mb[4].cs.b.code; /* read code, id, length, data, timestamp*/

rxid = can_0.mb[4].id.b.id_std;

rxlength = can_0.mb[4].cs.b.dlc

When I look in the command terminal this message is displayed 
program received signal sigint, interrupt.

0x01003218 in receivemsg () at ../src/can.c:104

104 while (can_0.iflag1.b.buf4to1i != {}; /* wait for can_0 mb 4 flag */

Can anyone help me trouble shoot this problem? I have been pulling my hair out trying to figure it out.

Thanks

0 Kudos
5 Replies

457 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

which example and board do you use?
Successful reception is signaled by setting MB flag in IFLAG1 register, this is the line you pointed to.
There can be many reason why it is not working. CAN bit timing must be properly set consistent with other node. MB must be prepared for reception, FlexCAN in normal mode. MCU pins properly configured and connected to transceiver, that have to be active too.
Check ESR, ECR registers if any error is detected.

BR, Petr

0 Kudos

445 Views
dh14
Contributor II

Hello Petr, 

I am using a MPC5748G devkit and trying to start a project from example using the flexcan receive example. I have all my baud rates set to the correct 500 and there is no option in my s32 IDE to set components up for the example. When I open the component library there is nothing there. Do I need to start a new project from scratch?

0 Kudos

434 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

tried that example on DEVKIT-MPC5748G, board have to be powered by 12V.
I connected it to PC via PCAN tool. After sending 0x555 std ID message from PC it can be received by MCU.

PetrS_0-1653641821865.png

 

This example does not use SDK. You can try to create new project from SDK examples

PetrS_1-1653641888878.png

BR, Petr

0 Kudos

427 Views
dh14
Contributor II

Petr, 

Thank you so much that clarifies a lot for me. I will try the SDK examples and see what kind of results I can get after trying. I am a little but unsure how I am supposed to connect all the components I am trying to work with. I am working with a MPC5748 and  Beaglebone black trying to receive and transmit data with it. Is this possible or will I need to use another board to ensure proper communication between the devices?

Derrick

0 Kudos

380 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I do not know Beaglebone boards, but from https://beagleboard.org/bone it seems the board itself does not include CAN PHY, so you will need to have some daughtercard (like https://github.com/beagleboard/capes/tree/master/beaglebone/Comms) or any other external transceiver connected to board headers.

BR, Petr

0 Kudos