How do I load data/code to flash and run from RAM on a TI C2000 device?
77 views (last 30 days)
The TI compiler provides an easy mechanism to do this automatically using the "ramfuncs" attribute. Follow the steps below:
The shipping *.cmd (Linker command file) file of a specific processor already has allocation of sections of flash to store RAM data. Open the Configuration Parameters of your model, navigate the the "Hardware Implementation" settings, and click on the Edit button as shown below:
You can find the "ramfuncs" section details as below:
In the TI C2000 Hardware Support package provided by MathWorks, the custom storage class package labeled "tic2000demospkg" has been created to load the parameters/routines on the flash memory and run them from the RAM using this ramfuncs section. You can verify these built-in storage classes by executing the following command in the MATLAB command window:
Select the tic2000demospkg package:
In the "Memory Sections" tab, you will find sections named "code_ramfuncs" and "const_data_ramfuncs" which can be used to store code and data in the ROM but copy them into RAM during execution.
If you cannot find the tic2000demospkg und "Select package," try clicking "Refresh package list" in the Configuration Parameters window in the Code Generation section:
To place a subsystem in the ramfuncs section, right-click on the subsystem, select Block Parameters and under the Code Generation tab, select the appropriate memory section as shown below:
Similarly, to allocate a Simulink parameter to ramfuncs section, type tic2000demospkg.Parameter in the MATLAB command prompt:
Then double-click on the parameter in the workspace and select const_data_ramfuncs as shown below:
More Answers (0)