I am trying to get a simple example (update counter value in loop) example working on my TRK-USB-MPC5643L board. I was able to successfully debug this program once, however now I am running into some issues. When running in debug mode the program never enters the main loop, it is stuck in the initialization code. A few things I observed - even though the project is configured for LSM mode, when I step into the code, the branches for DPM get executed. I tried to use the ICDPPNEXUS tool from PEMIcro but the code seems to enter some kind of an infinite loop in the hardware init phase and there too and the main is never hit. How do I proceed from here?
Original Attachment has been moved to: MPC5643L_INTC-SW-VLE-LSM.7z.zip
Thanks Martin. One issue was that I was building a ROM project but using it to flash the chip. I corrected this and now I am able to build but when I do Debug (Download configuration) with Stop on startup at user specified main, the program never enters the main loop. I am sure I have some build/debug setting incorrectly set but am unable to trace which one it is.
Hello,
from your description I have no idea, what is wrong on your side. I do not understand your sentence "with Stop on startup at user specified main, the program never enters the main loop."
After you load code into the flash, are you able to debug the code? If you step the code, where in the code you get stuck? What happen, If you write gotil main in ICDPPNEXUS?
Could you please post here some screens of your problem?
Regards,
Martin
Hi Martin,
I ran into the same problem as Tanmayee, but I found a solution.
When running a debug from RAM, the project would work correctly, but if the target was FLASH, the TRK would get stuck in an infinite loop, specifically the init_12sram_loop in MPC5643L_HWInit.c. It was because LOCKSTEP_MODE (which is what we're running) isn't defined anywhere, so HWInit.c was defaulting to DPM.
Adding the line #define LOCKSTEP_MODE in MPC5643L_HWInit.h fixed it for me, and the TRK runs the project from FLASH properly.
If you know of a better (or proper place) to put the LOCKSTEP_MODE flag besides the header file, please let me know.
Hope this helps someone out there.
Thanks
Hello,
I tested your project and it works correct on my side. I tested in MPC5643L switched to LSM mode. Could you please write me back more detail, where your program get stuck?
Regards,
Martin