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.

MSP430FR5962: Compiler optimizing out random functions?

Part Number: MSP430FR5962

So far I've tried optimization levels 0 and 1 and played around with --opt_for_speed with no success.  Currently optimization level 2 seems to work for some reason, but so did -o1 until I eventually had the same issue.  What happens is the compiler seems to pick a function at random (it seems to be a new one every time there's any code changes) to optimize out.  Disabling optimization completely solves the issue.

A call to the optimized out function leads me to an address containing all BRA @PC instructions, which of course sets my PC to 0 and the program remains halted.

I should also note that my FRAM2 is 100% full, with FRAM at 82% and RAM at 81%.

**Attention** This is a public forum