STM32U5 TrustZone(Application only starts after Hardware Reset or Debug after programming)
Hi everyone,
I am working with an STM32U5 device and have enabled TrustZone (TZEN = 1) using STM32PROGRAMMER
I created both the Secure and Non-Secure projects, and they compile and program successfully.
Problem
After downloading the firmware from STM32CubeIDE:
- Programming completes successfully.
- The application does not start automatically.
- My LED does not blink.
However:
- If I press the hardware RESET button, the LED immediately starts blinking.
- If I start a Debug session, the LED also starts blinking.
So the firmware itself appears to be correct because it works after a reset.
What I have verified
- TrustZone (TZEN) is enabled.
- Secure and Non-Secure projects are generated by CubeMX.
- Secure project jumps to the Non-Secure application.
- Programming finishes without any errors.
- The issue only occurs immediately after programming.
- Without TrustZone, the application starts automatically after programming.
My question
Is this expected behaviour with STM32U5 TrustZone?
Has anyone experienced the same issue where the application only starts after a hardware reset?
Could this be related to:
- Secure boot sequence?
- SECBOOTADD0 / NSBOOTADD0 option bytes?
- Debugger reset mode (Software Reset vs Hardware Reset)?
- STM32CubeIDE download behaviour?
- Something else in the TrustZone boot process?
I would appreciate any suggestions on what to check next.
Thank you.
