Good morning,
I relocated my startup code at address 0x8004000, I created a debug .ini file like this
FUNC void DebugSetup (void) { // </h> SP = _RDWORD(0x08004000); // Setup Stack Pointer PC = _RDWORD(0x08004004); // Setup Program Counter _WDWORD(0xE000ED08, 0x08004000); // VTOR to Image Base } DebugSetup(); // Debugger Setup
When I start the Debug all it's ok, the application starts from the main; the problem is when I reset the cpu (from the button) to reinitialize the Debug again at the main. The disassembling code starts from the location 0x08000000, instead of 0x08004000. Why? Is there a possible to resolve this problem? Thanks
Which button?
The button in the GUI, or a physical button on your target hardware?
Or something else?
You need to execute the function DebugSetup after resetting the target from the GUI.
You can do this manually by executing the DebugSetup() from the command window or use the automatic OnResetExec() function to call the DebugSetup().
See details for OnResetExec: http://www.keil.com/support/man/docs/uv4/uv4_df_uf_onreset.htm
yes, from the GUI
Thanks a lot, it works! The only problem (but it's not so important) is that: if I do the Reset of the CPU when I'm moving in the code with "F10" all it's ok, but when I try to use "F5" and there aren't any breakpoints after, the reset of the CPU doesn't work like before (the Disassembly starts again from address 0x0800 0000)