NOTICE: This website will be shut down in the near future. Product content has moved to nxp.com. Forum content and FAQs have been moved to community.nxp.com. We encourage you to create a user account on nxp.com to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.

 

How do I debug from reset?

lpcxpresso-support's picture

Case 1. I have ResetISR in my application

You can do this by changing the startup breakpoint. By default it is the first instruction in main().

  • Open the Debug Configuration for your application (Run->Debug Configurations ...).
  • Switch to the "Debugger tab".
  • In the "Stop on startup at:" field, enter ResetISR (or the name of the function called by the Reset vector if different)
  • Click 'Debug'.
  • You will now be stopped in the first instruction of the ResetISR function.

Case 2. ResetISR is already in flash

First, you need to find the address of the reset vector. To do this:

  • Load your application and stop at main.
  • Now open the Peripherals view, and then click on "MFlashxxx".
    • This will open a Memory window at address 0x0.
    • Address 0x4 contains the address of the ResetISR function. Make a note of the address.
  • Stop debugging.
Now, to set the startup breakpoint at this address:
  • Open the Debug Configuration for your application (Run->Debug Configurations ...).
  • Switch to the "Debugger tab".
  • In the "Stop on startup at:" field, enter the address you made a note of, prefixed by '*'. So, if the address was 0x3071, then enter *0x3071.
  • Click 'Debug'.
  • You will now be stopped in the first instruction of the ResetISR function.
For further information please see the FAQ Changing the Initial Breakpoint on startup
 
0
Your rating: None
feedback