c2000 how to store data in non volatile memory

4 次查看(过去 30 天)
Hallo, I have a control system built into simulink scheme. The scheme is configured to download code to flash memory.
Control gains and all parameters are thus defined at compile time.
I need to update those gains and parameters with new values received via serial port (for instance) during the system operation and store them in the internal flash memory so that, even after an on/off power cycle the new parameters are used (not the old ones).
Which is the best way to store those parameters without having to recompile the scheme with the new gains?
thanks, Lorenzo
  1 个评论
Imanol Eguren
Imanol Eguren 2018-12-3
Hello Lorenzo,
I know that this question is from 2012, but did you figure out a way to store the values in the non volatile memory?
I need to do the same thing, and I did not find any help...
Thank you!
Imanol

请先登录,再进行评论。

回答(2 个)

Venkatesh Chilapur
Venkatesh Chilapur 2018-12-3
Please refer this link:
https://in.mathworks.com/matlabcentral/answers/172053-how-do-i-store-variables-to-flash-memory-of-the-c2000-f28335-controller-using-matlab

Imanol Eguren
Imanol Eguren 2018-12-3
I need to update the value of the variable periodically without building the model again. If I understood the example correctly, what it does is not exactly what I need.
In the example a parameter called STEP_PARAM is created so that changing the value of it is allowed when running the example in external mode. But, for storing the value in the flash, building the model again is required.
Can a parameter like this one be updated programatically?
Thank you,
Imanol
  1 个评论
Venkatesh Chilapur
Venkatesh Chilapur 2018-12-4
Hi Imanol,
We currently do not support writing parameters to flash programatically. The description from Antonin in the link above summarizes the same.

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by