Attach Debugger To Running Target with TrustZone Enabled and Breakpoint in Secure App
- November 18, 2025
- 4 replies
- 344 views
I've been playing around with the TrustZone Enabled on the STM32H573 board and using this tutorial:
I had no trouble executing the tutorial, using the Debug Authentication, or changing the permission levels to attach the IAR Debugger to put breakpoints in the main functions of the Non Secure or Secure Applications.
However, my group uses the STM32 Cube IDE, and I've been having trouble doing the equivalent using that tool. I know where to enable and set up the Debug Authentication, but I'm having trouble attaching to the running target, hitting the reset button (as instructed in the above tutorial), and having the program stop at the breakpoint I have enabled in the main function of the Secure Application (before it jumps to Non Secure Init) and displaying the associated source code. I have built all the projects (OEMiROT Boot, OEMiROT_Appli_TrustZone_Secure, and OEMiROT_Appli_TrustZone_Secure) with their Debug Configurations, I have the correct Key and Certificate paths under the DA tab, I've used the Secure Programmer to set the debug level to Level 3 Secure, I've matched the debugger side to Debug Secure L3 -- I've tried different combinations but can't seem to get the code execution to properly stop at the breakpoint I set and display the source code. It's not as easy as described in the tutorial for IAR. Can you provide some instruction as to what I need to do to get this to work on STM32 Cube IDE Debugger? My version of STM Cube IDE is 1.14.1, and I'm putting a breakpoint in the main function of the Secure Application.
I've attached screenshots of the tabs under my Debug Configuration settings.
I've included the Main, Debugger, and Startup tabs. here.
