MATLAB: Is it possible to append a pragma to a variable declaration in the code generated by Embedded Coder

appendclasscustomdatanamedatatypeEmbedded Codermacrostorage

I am generating code from my Simulink model that is intended for deployment to a hardware platform. In the generated code, I'm looking append a macro to a variable declaration as follows:
#pragma section _IRAM
extern DATATYPE DATANAME THIS_IS_A_MACRO
#pragma section
I have tried to use Custom Storage Class designer to generate code of this form, but I have been unable to. I am looking for suggestions on whether this would be possible.

Best Answer

There is no direct way to achieve the code that you are looking for. The best way is to implement a TLC-based custom storage class. A good place to begin doing this is by referring to the following documentation link:
TLC-based custom storage classes are a little tricky to develop and need to be very specific to the customer's use case. In such instances, the recommendation is to consider engaging with the Consulting services provided by MathWorks.