How do I load data/code to flash and run from RAM on a TI C2000 device?

조회 수: 72 (최근 30일)
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?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2020년 12월 2일
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:

추가 답변 (0개)

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by