Hi all,
I am trying to develop a MATLAB/Simulink based reference example for EEPROM Emulation.
I have used sector N of the flash to save the calibration data. I copy these calibration values to RAM during system initialization, allow user to modify/update them, then save the updated parameter value to Flash(Sector N). This is all working fine for now.
But there is a small issue. When we build the code and load it to flash next time (from MATLAB/Simulink) we will erase the entire flash and load the .out file.
Hence, whatever the calibration parameters were updated previously in the sector 'N' would now be erased and loaded with default values again.
So every time we build the model and download the code from MATLAB/Simulink, we are seeing this issue.
So my question is:
How to avoid erasing of flash sector containing calibration data?
Right now as part of build and load process, we are invoking the runProgram.js file, that I believe is responsible for loading operation.
Inside the script the following line of code is probably doing the erase operation.
// Load the program -------------------------------
print("\n*** Loading the program to the target...")
debugSession.memory.loadProgram(programName);
So, how can we ensure that next time user wants to download the model file, he would not touch the calibration sector.
In CCS, we can uncheck which sectors to erase. How can we achieve the same with the runProgram.js script.?