The optimization seems to mess with the while loops that wait in bl_flash.c
The code works fine with optimization off or at level 0. Above that hangs happen. Single stepping into the code in bl_flash.c is pretty confusing with optimized code, but it looks like either compiler is not respecting "volatile" for hardware registers or the registers are not properly declared as volatile.
The flash api I am using is 02_01_01 and I am using the SafetyMCUBootloader sample. The compiler is TI v16.6.0.STS
The problem is easy to reproduce - first verify the program is working with optimization OFF. Then boost the optimization above 0 and it will hang when trying to erase flash.
Does it work for anyone here? Is there some compiler setting I should be setting?
Thanks, Steve