Hi all,
This is a strange issue I am seeing.
While working on the EEPROM Emulation design from MATLAB/Simulink, I declared the calibration parameters as constant array.
The load address is flash and run address is RAM.
In the device init using the memcpy() I copy the array data types to RAM.
Then I can modify the values in RAM and the modified values in RAM are used in a counter.
The counter direction changes if I change the sign of an array element. Say, I change array[1] = -3 to array[1] = 3. I can see the counter will pick the updated value.
This means, I can modify the calibration value in RAM.
Later, I can write the modified value back to flash.
Next, when I reset the controller, I see the modified values are picked from Flash and copied to RAM and the counters continue to update with newly copied values in RAM.
So in summary, the EERPOM Emulation works fine when I have constant arrays.
BUT
If I implement the calibration parameters as scalar, I don't see this happening.
Basically, when I modify the RAM scalar parameters, I can see the value getting updated in CCS debugger at the memory location. But counters don't pick this value.
And when I do a Flash update, the modified parameters are copied back.
And when I do reset, I can see the modified values are copied back to RAM.
BUT
These value are not used by the counter.
The counter continues to use the values that were first used to initialize the scalar constants.
So why is this difference?
