How do I load data/code to flash and run from RAM on a TI C2000 device?
46 views (last 30 days)
Show older comments
MathWorks Support Team
on 2 Dec 2020
Commented: Venkatesh Chilapur
on 6 Apr 2021
I wish to place performance-sensitive functions in RAM instead of ROM because executing from RAM is faster than ROM on my device. How do I accomplish this?
Accepted Answer
MathWorks Support Team
on 2 Dec 2020
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:
>> cscdesigner
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:
>> tic2000demospkg.Parameter
Then double-click on the parameter in the workspace and select const_data_ramfuncs as shown below:
1 Comment
Venkatesh Chilapur
on 6 Apr 2021
Hi,
There is a change in the workflow for custom storage class from R2020b. Please refer the part-b of the FAQ below for more details:
Regards,
Venkatesh C
More Answers (0)
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!