Hello Adrien,
warning: while parsing threads: not well-formed (invalid token)
[New Thread 536878112]
[New Thread 536877976]
[New Thread -1097926661]
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2]
Also interesting is that the debugger shows SIGSEGV which is not a failure mode commonly seen with clock config issues.
According to the datasheet the MCU is equipped with Memory protection unit.
The memory protection unit (MPU) is used to manage the CPU accesses to memory to prevent one task to accidentally corrupt the memory or resources used by any other active task.
The MPU is especially helpful for applications where some critical or certified code has to be protected against the misbehavior of other tasks. It is usually managed by an RTOS (real-time operating system). If a program accesses a memory location that is prohibited by the
MPU, the RTOS can detect it and take action. In an RTOS environment, the kernel can dynamically update the MPU area setting, based on the process to be executed."
Maybe the Memory protection unit is activated and causing the Segmentation fault.
You can try to use the STMCubeProgrammer to check it. The MPU is optional and can be bypassed for applications that do not need it.