Could not add custom memory section for a TI C2000 device using Embedded Coder's Custom Storage Class designer

6 views (last 30 days)
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:
  1. How do I load data/code to flash and run from RAM on a TI C2000 device? - MATLAB Answers - MATLAB Central
  2. 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?

Answers (1)

Vinay
Vinay on 16 May 2025
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.
  1. Run MATLAB in the administrator mode.
  2. Run the following command in the MATLAB command window to edit the 'tic2000demospkg' package
cscdesigner('tic2000demospkg')
Please follow the steps mentioned in the below link after opening the Custom Storage Class Designer
I hope this resolves the query
  1 Comment
Rohit
Rohit on 16 May 2025
Hi Vinay,
Thanks for sharing the information about opening MATLAB using admin. I am now able to modify the package.
In the link that you shared, Storage class could be modified from Code Mapping Editor. But there is no "Storage Class" in the "Code Mapping Editor" of "Embedded Coder App" that I could find.
Please help

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!