STM32 - infinite loop

  1. I commented out the debug flags from you and added your code snippet.

I started debugging (hitting F5) than the call stack looks this:

It is not possible to get additional information when I click onto “Serial2@…” - grayed out

When I continue the program and press the reset button on the board, the call trace looks this:

Personally, I would expect that starting a program from a debug session has the same behavior as doing a hard reset???

  1. With the debug flags

→ HardFault_Handler never hit the breakpoint