- Run MATLAB in the administrator mode.
- Run the following command in the MATLAB command window to edit the 'tic2000demospkg' package
Could not add custom memory section for a TI C2000 device using Embedded Coder's Custom Storage Class designer
6 views (last 30 days)
Show older comments
Hi Experts,
This is for MATLAB version: R2023b.
TI MCU: TMS320F28388D
I have tried to follow these solutions to add "#pragma CODE_SECTION( ".TI.ramfunc" )" for some functions in the generated C++ code but I couldn't:
- How do I load data/code to flash and run from RAM on a TI C2000 device? - MATLAB Answers - MATLAB Central
- How do I define a custom Memory Section for a TI C2000 device using Embedded Coder's Custom Storage Class designer? - MATLAB Answers - MATLAB Central
For this purpose, below are the steps that I followed:
1. created a shared data dictionary, using the field highlighted below and create a new dictionary:

2. Under "Memory Section", load the tic2000demospkg package in the data dictionary:

Note that in the pseudocode preview, the code is in C syntax and I need C++ syntax, but I proceeded ahead anyway.
3. Save the shared data dictionary in the project workspace.
4. Open the model and go to the relevant block, open the block parameters, select the code_ramfuncs:

5. Save and generate C++ code.
At this step, I could not find the pragma added in the generated code at all.
If this is a syntactical issue (C vs C++), then I tried to add custom code for C++ as well:

But I could not find this "MemorySection_ramfunc" in the drop-down menu:

Also, in custom storage class designer, all packages are listed as read only to me. How can I edit this?

What am I missing?
0 Comments
Answers (1)
Vinay
on 16 May 2025
Hi @Rohit
The Custom Storage Class Designer can be used to add the custom memory section for a TI C2000 device.
Follow the below steps to make the package editable in the designer.
cscdesigner('tic2000demospkg')
Please follow the steps mentioned in the below link after opening the Custom Storage Class Designer
I hope this resolves the query
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!