NATIVE-DECLARATION generated by embedded coder wrong

조회 수: 11 (최근 30일)
Rajesh Mallina
Rajesh Mallina 2020년 4월 29일
편집: Nico Wiedenhaus 2023년 1월 4일
Created example matlab model to generate code with embeded code and Autosar
i see there is problem in generated arxml
<SW-BASE-TYPE UUID="8033285f-ff92-5e61-6ff2-b4aad944c02c">
<SHORT-NAME>uint8</SHORT-NAME>
<CATEGORY>FIXED_LENGTH</CATEGORY>
<BASE-TYPE-SIZE>8</BASE-TYPE-SIZE>
<BASE-TYPE-ENCODING>NONE</BASE-TYPE-ENCODING>
<NATIVE-DECLARATION>uint8</NATIVE-DECLARATION>
</SW-BASE-TYPE>
The <NATIVE-DECLARATION> suppose to be 'unsigned char' but it's generated as uint8
Is there a solution to generate the actula native type ?

답변 (2개)

Andreas Apostolatos
Andreas Apostolatos 2021년 10월 8일
Hi,
I would like to follow-up on this question, in case someone else stumbles upon the same issue.
For the <NATIVE-DECLARATION> Simulink uses the AUTOSAR platform types, as they are defined in the AUTOSAR standard. This is mentioned in the following documentation page,
Please note that these types are used in the generated code and are in turn defined in the header-file Platform_Types.h.
In case you wish to customize the <NATIVE-DECLARATION> data types, then the RTE generator that is used should provide its own header-file Platform_Types.h with the necessary type definitions based on the specific target, since the header-file Platform_Types.h file that is by default provided in Simulink is a stub file intended only for SIL testing.
I hope that this information helps.
Kind regards,
Andreas

Nico Wiedenhaus
Nico Wiedenhaus 2023년 1월 4일
편집: Nico Wiedenhaus 2023년 1월 4일
You can change the native declaration under the XML options in the AUTOSAR dictionary:

카테고리

Help CenterFile Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by