Hi Everyone,
I'm using flash memory to store calibration values. I don't have a great understanding of how it all works, but was able to get it to do this properly. The code enters an auto-calibration mode, takes multiple ADC readings to establish an average, then copies the final values from RAM variables into Flash Sector E. After power is cycled, those values are copied from Flash back into RAM where they can be easily accessed during normal operation.
It was working in earlier versions of code, but now it doesn't. I can run through the code in debug mode, and the values are moving appropriately between the RAM memory locations and the debugger reported Flash memory locations.
When I switch to release mode, the calibration values work properly, but after a power cycle, it appears the calibration values are all zeros. As if it's pulling the values from an unknown location of Flash memory, or they never stored it there in the first place.
While developing this code I ran into difficulties writing to and reading from Flash, but cured the problem by adjusting the compiler optimization level to '0'. So, it's at zero now.
This phenomenon is present on all copies of hardware, and there are no error messages.
I'm running CCS v 6.1.0.00104, w/C2000 v 6.4.6 TI compiler.
Does anyone have any guidance? Let me know if you need more detailed information.