How do I Store variables to FLASH memory of the C2000 F28335 controller using matlab ?

27 views (last 30 days)
I want to store the uint16 values received through the SCI block to a Flash memory of the controller.

Answers (1)

Antonin
Antonin on 6 Feb 2015
Hi Kamal,
Open the following demo:
c28x_ccp_ert
and click on the info button present in the model, or search for the following sentence in the doc: "CAN Calibration Protocol and External Mode".
Go the following chapter: Signal Logging and Parameter Tuning with External Mode
In this section, we show how to save a parameter in flash and load it to RAM at startup for tuning with External mode.
Once you are happy with the new value, you can re-generate code to save the new parameters in flash.
I understand that this is a little different from what you are asking. One blocker to save one parameter in flash dynamically is the fact that you have to erase an entire flash section, just to save 1 parameter. People usually use an EEPROM to dynamically save calibration parameters. I've seen many interfaced via SPI and accessed with the SPI blocks, that's probably the best solution.
I hope it helps,
Cheers,
Antonin.
  4 Comments
Ehsan
Ehsan on 15 Nov 2022
Edited: Ehsan on 15 Nov 2022
Hi Omar,
Did you found any solution for your problem? I have the same issue, I want to write a parameter to an specific location of memeory, and use it. The location should be fixed to ensure the boot loader will not effect the fixed parameter during updating the code (over air update.)
Kind regards,
Ehsan
Aditya Padmanabha
Aditya Padmanabha on 18 Nov 2022
Hi Eshan,
Its better to create a new issue if you need help on anything.
For your question, you can refer to the file exchange example Simulink Reference Application Examples for TI C2000 - File Exchange - MATLAB Central (mathworks.com) to write to Flash memory.
Regards,
Aditya

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!