AnsweredAssumed Answered

How do I make the reset button work in debug

Question asked by Robert Palmer on Aug 3, 2016
Latest reply on Aug 30, 2016 by Tomas Krysl

I am using the LPCXpresso IDE


I have a program and a bootloader.  I can successfully run and debug, jumping from the bootloader into my application code.  The one thing I can no longer do, since adding the bootloader, is use the reset button during debugging.  This means if I want to restart, I have to exit the debugger and restart the debugger, including flashing the application, which is kind of a pain.


I am guessing that the problem is related to moving the VectorTable.  The VT starts at zero for the bootloader, then right before calling my code, I update it to 0x4000 (the base of my app).  I'm guessing that when I press the reset button, not having the VTOR register pointing to the VT at 0x0000 is causing a problem.  How can I resolve this?


Just for reference, here is the code from my bootloader that launches the application:


    unsigned int stack_adr = code_base_adr;

    stack_adr = *(unsigned int*) stack_adr;



    SCB->VTOR = code_base_adr;


    user_entry = (USER_ENTRY_PFN)*((uint32_t*)(code_base_adr +4));