hello!
MCU: SPC5777MK0MVA8
software: S32 v2.1
Debug tool :Multilink Universal FX(PEmicro)
When I debug RAM,S32 does not stop in the “main” function,but stopped in “startup.s”.
Stop in line:e_lis r4, 0xFC05
;#****************************** Turn off SWTs ********************************
#if defined(DISABLE_SWT2)
;#SWT2
e_lis r4, 0xFC05
e_or2i r4, 0x8000
e_li r3, 0xC520
e_stw r3, 0x10(r4)
e_li r3, 0xD928
e_stw r3, 0x10(r4)
e_lis r3, 0x7F00
e_or2i r3, 0x010A
e_stw r3, 0(r4)
#endif
After that, I can only do single-step debugging."Resume(F8)" can't let the program run, only single step.
Solved! Go to Solution.
Hello,
1. After burning the flash, debug_ram always has problems.
How should i understand this? So you are loading RAM code into the flash? or?
best regards,
Peter
I set breakpoint to main function and hit run, it still only single step one instruction. And, at the begin of Debug RAM, I found the value of "msr" register: 0x9000. It seems wrong.
Could you share the project, so I can test it here to see where is the issue?
Did you try it in standalone mode (without debugger) to exclude debugger issue?
best regards,
Peter
The board is designed by me with reference to MPC5777M-512DS.
I found the following strange problem:
1. After burning the flash, debug_ram always has problems.
2. For the board that has burned the flash,when debug_ram, you only can run it in a single step, and you can enter the main function. The write operation of some registers in the main function is invalid (for example, SIUL2.MSCR_IO[48].R), and it still keeps the reset value.
3. Board that have never burned flash can be debug normally, and enter the main function, you can single-step operation or resume.Can produce expected results.
Hello,
1. After burning the flash, debug_ram always has problems.
How should i understand this? So you are loading RAM code into the flash? or?
best regards,
Peter
Thank you for your reply.
The MPC5777M can be debugged(debug_ram and debug) online normally, because ERS0 is not properly controlled.
But why my code works fine in the debugger, but fails without debug.
In debug_ram/debug mode, the oscilloscope can capture a square wave on the PD[0].
When I download .ELF into MPC5777M flash,nothing found on the PD[0].
In debug_ram/debug mode, the register MC_ME_PS0[S_SIUL] = 0x1.
When I download .ELF into MPC5777M flash,the register MC_ME_PS0[S_SIUL] = 0x0,peripheral is frozen.Therefore, the registers in the SIUL functional unit cannot be operated.
Hello,
But why my code works fine in the debugger, but fails without debug.
Debuggers usually disable timer, like watchdogs. therefore you don't have to pay attention to them.
But in standalone application they will cause issues if are enabled and not handled.
Try running some of our example application to see how it is done correctly:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5777M
If you willing to share the application I can have look at it here.
Best regards,
Peter
hello,
From your startup file I can see there is implemented branch to the main.
After that, I can only do single-step debugging."Resume(F8)" can't let the program run, only single step.
So it is not possible to run the code in standalone mode? If you set breakpoint to main function and hit run, does it still only single step one instruction?
Best regards,
Peter