Matlab Autosar Code Genration Error

조회 수: 37 (최근 30일)
dayoung
dayoung 2024년 12월 10일 10:43
댓글: dayoung 2024년 12월 10일 22:48
When Generating Code with Autosar,
I have these problems.
Parsing Output Code in C Function block failed with the messages:
In line 1000014:error: 20, identifier "uint8" is undefined
In line 1000014:error: 20, identifier "sint16" is undefined
and so on,,
This problem occur in C Function Block.
When I using int32, uint16.. Type, they already defined in C Function Block.
Should I defined one more? And Where shoude I define it?
  댓글 수: 2
dayoung
dayoung 2024년 12월 10일 10:48
I write down code in OutputCode Only
Saurabh
Saurabh 2024년 12월 10일 10:59
편집: Saurabh 2024년 12월 10일 11:09
If possible could you provide the required files, so that I can have a look into it? meanwhile try changing the code to use and define autosar types instead or a workaround could be to replace the "C Function" block with the "C Caller" block.

댓글을 달려면 로그인하십시오.

채택된 답변

Saurabh
Saurabh 2024년 12월 10일 11:18
편집: Saurabh 2024년 12월 10일 13:24
This seems to be a bug and a possible workaround to solve this is to specify the following type definitions in Simulation target custom code. This should resolve undefined type identifier issue without introducing any modifications to the generated AUTOSAR code.
#ifndef RTWTYPES_H
#define RTWTYPES_H
#include "tmwtypes.h"
#endif
typedef real_T float64;
typedef real32_T float32;
typedef int32_T sint32;
typedef int16_T sint16;
typedef int8_T sint8;
typedef uint32_T uint32;
typedef uint16_T uint16;
typedef uint8_T uint8;
typedef boolean_T boolean;
typedef uint64_T uint64;
typedef int64_T sint64;
Simulation Target custom code should be included in the include header section of simulation target of model configuration parameters:
I hope this helps.
  댓글 수: 1
dayoung
dayoung 2024년 12월 10일 22:48
Thank you This really help for me

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by