This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: Building in Release Causes System to Crash

Part Number: MSP432E401Y

Hello, just wanted to understand the optimalizations and changes the complier makes when building in either Debug or Release mode of the firmware.

I have a system using the MSP432P401R microcontroller. The firmware works perfectly fine when I flash the debug version of the build into the embedded system. However, when I build for release, the firmware occasionally crashes after cycling. We've tried various build settings and optimization levels and the results are the same. 

Can you help us dig into what could be happening? 

  • 1) Optimization can certainly trigger latent software bugs. These are usually associated with timing: (a) race conditions (b) path-length dependencies (c) questionable ordering [including "volatile"].

    2) Optimization is the most visible, though (I think) not the only difference between Debug and Release. As a first step, I suggest you start with the (base) Release build configuration and (only) change optimization to "-Ooff", to see if the behavior changes.

    3) You'll need to discern what "crash" means precisely, e.g. (a) Hard Fault (b) System reset (c) Infinite loop (d) Incorrect output. At some point you'll probably need to work backwards from the symptom.