Can not use the code mappings API to configure model

5 views (last 30 days)
Dear all,
I got an issue with using code mappings API with this command: cm = coder.mapping.api.get(bdroot), the error I got when giving this command is:
Model 'Sample_AR24b' is configured with system target file autosar.tlc or autosar_adaptive.tlc or is GRT-based with
model configuration parameter 'Code interface packaging' set to 'C++ class'. To use the code mappings API to configure this model, change system target file or set 'Code interface packaging' to 'Nonreusable function' or 'Reusable function'.
However, Target Language of my model is C and of cource ' Code interface packaging' was "Nonreusable function" already. And as you can see, I still got the error which realized my model as an "C++ class". Can you please tell me what I am doing wrong here and what is the solution?
Thank you so much!

Answers (1)

Harsh
Harsh on 19 Jun 2025
I understand that you have verified "Code Interface Packaging" to be "Nonreusable function" and also the "Target Language" is set to C but you still get the error stated in your question. This must mean that your "System target file" is set to either "autosar.tlc" or "autosar_adaptive.tlc" for which the code mappings API is not supported. Please run the following command to verify this -
get_param(bdroot, 'SystemTargetFile')
Now to change your "System target file" please select "Code Generation" from the left pane in "Configuration Parameters" window. Then You can click on "Browse" to select "ert.tlc" or "grt.tlc"
I hope this resolves your query!

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!