cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6570-DK Debugger

paulbamburak
Associate

I have succesfully built and programmed a TouchGFX application to my board in release mode. When I try to use the debugger I have limited success. If in the Project Explorer I highlight the (in FSBL) line and launch the debugger and press F8 my application runs. Any breakpoints I have set in my application do not trigger. If in Project Explorer if highlight the (in Appli) line and launch the debugger I receive an error "Failed to execute MI commad" It worked for me one time but I cannot relpicate the sequence that gave me that result. How do I launch the debugger so that breakpoints in my application will work?

paulbamburak_0-1740452149686.png

 

1 REPLY 1
GaetanGodart
ST Employee

Hello @paulbamburak ,

 

Have you followed the steps in the readme?

## Debugging

It is not possible to debug the application in the usual way. To debug, follow this procedure:
1. **Preparation:**
   - Put the board into programming mode (boot switch to the right, cable plugged in afterwards). Flip the boot switch to the left, and click the reset button once. The application now starts.
   
2. **Connecting to the Running Board:**
   - **In IAR:** Go to Project -> Connect to Running Target in the menu with the application configuration open.
   - **In CubeIDE:** The supplied debug profile behaves in the same way.
   
3. **Debugging:**
   - At this point, breakpoints and stepping are possible as usual.
   - If the board crashes before it is possible to attach the debugger, a loop has been created at the beginning of the main() function. Compile the project with the debugFlag variable set to 1. Then flash the program and connect the debugger. The program will be caught in the loop. Change the value of debugFlag using a watch. The program will leave the loop, and breakpoints and single stepping can be used to locate the error.

**Note:** If the board crashes, it is generally needed to start the entire procedure over.

This is a specific debug process but it should work.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)