STM32N6 diffrent behaviour Run and Debug config
I'm facing a very strange issue on my custom hardware based on the STM32N6 when trying to run my application using the Run configuration in STM32CubeIDE.
My setup consists of a secure-only application with an FSBL and a separate application. The project is generated with STM32CubeMX, built in STM32CubeIDE, and uses TouchGFX. The build completes successfully.
Debugging the application works perfectly, and I don't encounter any issues. However, as soon as I try to launch the exact same application using the Run configuration, it stops working. Both the Run and Debug configurations use the same build and the same ".launch" settings.
The behavior is as follows:
1. I power-cycle the board while it is in development mode.
2. I start the application using the Run configuration.
3. The application does not produce any output on the display.
4. After a few seconds, the watchdog expires, the board resets, and it ends up in a boot failure state.
Interestingly, if I instead:
1. Power-cycle the board.
2. Launch the application in Debug mode.
3. Stop the debugger.
4. Program the application again using the Run configuration.
...the application runs correctly.
However, after the next power cycle, the problem returns: launching with Run again results in no display output, followed by a watchdog reset and boot failure.
I have also tried different compiler optimization levels, including -O0, but the behavior remains unchanged.
Has anyone experienced similar behavior or has any idea what could cause the Run configuration to behave differently from Debug, even though they use the same binary and launch settings?
