Hi @JJeth.1 ,
thank you for sharing your experience and how you solved the intermittent start-up issue you faced !
It is always helpful for other guys in the community: when you have something interesting to share fell free to share :D
About the debug build option: usually it does not use any optimization in the code.
In this way it is easy for the debugger to go through the code line by line, but the firmware of course has less performance.
This can lead to a timing error because the MCU cannot execute all the instructions of the not-optimized code.
As you already have done, use the release mode: it adds some optimization in the code building and fix timing issues.
Anyway, if you want to use the debug mode without optimization, there is something you can do on the FOC parameters.
The first suggestion is to reduce the PWM frequency of the power stage (look at the picture below).
The MCU has more time for the FOC calculations during each PWM cycle.
Try using 15kHz for example, but consider that reducing PWM frequency can lead to less performance at high motor speed.
The other thing you can try is not to change the PWM frequency but the execution rate.
Execution rate =1 means that the firmware does the calculations every PWM cycle.
Changing the execution rate = 2 will help: the calculation will be done once every 2 PWM cycles giving more time to the microcontroller.

Then, in my experience also reducing the baud rate of the UART interface (if used) can help.
Use 9600 as a baud rate, it is not so fast but in many applications is enough.

Then remember in the monitor to set the same baud rate when communicating with the board.

These are some suggestions you can try and see the results, but in any case consider to build the code in release mode, with optimizations.
The motor will run without any compromise on performance !
All the best :smiling_face_with_smiling_eyes: