How to place code generated from subsystem into RAM on Ti C2000?
이전 댓글 표시
I am trying to plase parts of the code generated from one of the subsystems into RAM to speed up execution. The help provided in Control Data and Function Placement in Memory by Inserting Pragmas is not sufficient.
Is there a better explanation on how to add #pragma CODE_SECTION(myCriticalTask, "ramfuncs") to the generated function?
Do I need to edit linker command file?
Do I need to add code to copy function from flash to RAM on power up?
Thanks.
채택된 답변
추가 답변 (2개)
Valeriy
2026년 3월 11일
0 개 추천
댓글 수: 5
Umar
2026년 3월 11일
Hi @Valeriy,
Glad you're making progress! The reason you're only seeing the Simulink package options (MemConst, MemVolatile, etc.) is that the tic2000demospkg package hasn't been loaded into your model yet — the dropdown only shows sections from packages that are actively registered with the model.
Here's how to fix it:
Step 1 — Load the package into your model
Open the Embedded Coder app, then go to C Code → Code Interface → Embedded Coder Dictionary. Inside the dictionary window, look for a "Manage Packages" option. If tic2000demospkg doesn't appear in the list, click Refresh to scan for installed packages, then load it.
Step 2 — Check "Function with separate data"
Looking at your screenshot, I can see the "Function with separate data" checkbox is unchecked. You'll want to tick that box — without it, the memory section fields for subsystem data either stay limited or inherit from the model level, and some options won't show up. Once checked, you'll get the full set of memory section dropdowns for both initialize/terminate and execution functions.
After both steps, code_ramfuncs should appear in the dropdown and you can apply it directly to the subsystem.
Let me know if it shows up after the refresh!
Umar
2026년 3월 15일
Hi @Valeriy,
Please let me know if you need any further assistance.
Valeriy
2026년 3월 19일
Valeriy
2026년 3월 20일
Umar
2026년 3월 21일
Hi Valeriy,
Glad you got it working! It looks like you found the last couple of details yourself — great troubleshooting. Could you post your findings as a formal Answer so the thread is properly closed? Specifically the location of the 'Manage Packages' button and using the System Initialize block for the memcpy statement. It will be very helpful for anyone else hitting the same issue. Thanks!
카테고리
도움말 센터 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


