C code compliant with AUTOSAR
8 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a simulink model that contains subsytems and I need to generate a C code which is compliant with autosar for one subsystem within the model, I am using matlab 2020 version to generate the code. I selected the system target file autosar.tlc in configuration parameters/ Code generation and I used the autosar Component Designer quick start for the code generation so as I need to generate a subsystem, I selected the subsystem to be considered however as an output for the generated code, I can't select C code compliant with autosar and between parenthesis it says it is available for model build only.
Is there any solution to be able generate a C code compliant with autosar for a Subsystem within a model ?
0 件のコメント
回答 (1 件)
Angelo Yeo
2023 年 12 月 16 日
You must have received error messages similar to the one below. No, generating AUTOSAR-compliant C code from a subsystem is not a supported workflow.
Configuring a subsystem as an AUTOSAR SW-Component is not supported. Please convert the subsystem to a model and then configure the model as an AUTOSAR SW-Component.
You may have been confused with such a section of the doc below for ert.tlc.
2 件のコメント
Angelo Yeo
2023 年 12 月 17 日
Please see the limitation explicitly introduced in MathWorks homepage below. As noted, "The software does not support the use of the Invoke AUTOSAR Server Operation block in a referenced model."
The reason behind the Invoke AUTOSAR Server Operation block not being allowed inside a referenced model is the code for a referenced model may be shared by multiple top-level models (AUTOSAR components) and hence it cannot contain any RTE calls (such as the one generated by an Invoke Server Operartion block) which are specific to a particular top-level model (AUTOSAR component).
In addition, there are limitations that may come into play when performing incremental build of model-reference blocks for Accelarator/SIL mode where the defintion of the Rte_Call_<port>_<op>() stub that the referenced model's code needs to link against may not be available until after the top level model build is complete leading to a case where the referenced model's code will not compile during incremental build. The limitation applies to other RTE calls such as AUTOSAR.Parameter objects with the CalPrm and InternalCalPrm CSC. This could mean such parameters cannot be present within a referenced model.
These limitations with using the AUTOSAR.Parameter objects within a referenced model could be worked around by the following:
- parameterizing such a model and passing in the parameter arguments to the model block from a top-level model (AUTOSAR component).
- keeping the block in the top-level model and bringing the data that feeds the block to the top-level from within the referenced model.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!