I've been working with the secondary_bootloader project, and I seem to be having some issues when trying to debug the project using a JLink Lite.
When I start debugging in Keil (v5.12), it looks like the code downloads correctly, but then the assembly is completely out of sync with the code in the debugger window and I get the following error in the Keil command window:
* * JLink警告:地震遥测it of XPSR is 0 but should be 1. Changed to 1.
When I try to step through the code, the PC starts at 0x00000000 and I can step through instructions until I get to a breakpoint. These instructions don't seem to correspond to the secondary_bootloader code.
My other projects seem to work pretty well, it's only the secondary_bootloader project that's causing issues. Do you have any idea what's going on.
I made some progress, but I still have a few questions about this.
The PC resetting to 0x00000000 made me think that the issue might have been with the scatterfile. When I opened up the default scatterfile for the secondary_bootloader, the first two lines were set to:
LR_IROM1 0x00000000 0x00008000 { ; load region size_region
ER_IROM1 0x00000000 0x00002000 { ; load address = execution address
Since the RAM starts at 0x20000000, I changed these lines to:
LR_IROM1 0x20000000 0x20008000 { ; load region size_region
ER_IROM1 0x20000000 0x20002000 { ; load address = execution address
Once I made that change, the debugger started working for this project.
Why was the scatterfile set as it was in the demo project?
Is there anything we need to be aware of regarding the scatterfile for the secondary_bootloader?