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 !=
rxcode = can_0.mb.cs.b.code; /* read code, id, length, data, timestamp*/
rxid = can_0.mb.id.b.id_std;
rxlength = can_0.mb.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 !=
Can anyone help me trouble shoot this problem? I have been pulling my hair out trying to figure it out.
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.
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?
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.
This example does not use SDK. You can try to create new project from SDK examples
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?
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.