How can I memory map the "ARID_DEF" structure in code generated from AUTOSAR Blockset R2025b?

I want to memory-map the "ARID_DEF" structure that appears in code generated from my Simulink R2025b model using AUTOSAR Blockset. I already have an Internal Data Address Method defined for my Runnable function through Code Mappings. 
I expected a memory-mapping macro to be generated in the C code around the "ARID_DEF" structure, but I’m not seeing this behavior. How can I memory-map the "ARID_DEF" structure in Simulink R2025b? Can this be done using Code Mappings? 

 Accepted Answer

As of Simulink R2025b, the "ARID_DEF" structure cannot have a SwAddrMethod stored in the AUTOSAR dictionary, and Code Mappings cannot be used to memory-map this structure.
The best approach for generating a memory mapping for "ARID_DEF" is to create a package with memory sections using "cscdesigner".
Below are the steps to memory map the "ARID_DEF" structure in Simulink R2025b:
1. Create a Package Folder: Create a package folder and rename it to "+myPackage".
2. Open the Custom Storage Class Designer: Open the Custom Storage Class Designer (CSC Designer) by executing the following command:
>> cscdesigner('myPackage')
3. Configure Memory Sections:
3a. Go to the "Memory Section" tab and create "New Reference" memory section.
3b. Set "Refer to memory section in package" to "AUTOSAR"
3c. Set "Memory section to reference" to "SwAddrMethod"
4. Set Memory Sections: Use the commands below to define the memory sections via "MemSecPackage":
>> set_param(mdlName,"MemSecPackage","myPackage"); % Set the memory section package
>> set_param(mdlName,"MemSecDataInternal","NewMS");
>> set_param(mdlName, "MemSecFuncExecute", "NewMS");
>> set_param(mdlName, "MemSecFuncInitTerm", "NewMS");
5. Restart MATLAB: Restart the MATLAB session to incorporate the changes.
6. Generate Code: Try generating the code again. You should find the "ARID_DEF" data structure mapped to the memory section.

More Answers (0)

Categories

Products

Release

R2025b

Community Treasure Hunt

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

Start Hunting!