MATLAB Answers

What is the role of Build tool object in toolchain?

98 views (last 30 days)
Dear All,
Could you tell me the purpose of the code below??
I'm trying to make toolchain for RX64 micro-controller form Renesas Electronics. I have to make .hex file and ASAP2 file from Simulink bolck with Embedded Corder.
But I couldn't understand clear what the role of code below from link below .
% ------------------------------
% C Compiler
% ------------------------------
tool = tc.getBuildTool('C Compiler');
tool.setName('Intel C Compiler');
tool.setCommand('icl');
tool.setPath('');
tool.setDirective('IncludeSearchPath','-I'); <- What does this code mean? What is the purpose of this code?
tool.setDirective('PreprocessorDefine','-D');<- What does this code mean? What is the purpose of this code?
tool.setDirective('OutputFlag','-Fo');<- What does this code mean? What is the purpose of this code?
tool.setDirective('Debug','-Zi');<- What does this code mean? What is the purpose of this code?
tool.setFileExtension('Source','.c');<- What does this code mean? What is the purpose of this code?
tool.setFileExtension('Header','.h');<- What does this code mean? What is the purpose of this code?
tool.setFileExtension('Object','.obj');<- What does this code mean? What is the purpose of this code?
tool.setCommandPattern('|>TOOL<| |>TOOL_OPTIONS<| |>OUTPUT_FLAG<||>OUTPUT<|');<- What does this code mean? What is the purpose of this code?
Regards,

Accepted Answer

Yuxuan Hao
Yuxuan Hao on 24 Feb 2021
Hi Toshifumi,
Simulink will use these options to generate the MSVC compiler option/makefile/cmakes.
For example, IncludeSearchPath means which directory you want to add to the search path. PreprocessorDefine means to defines a preprocessing symbol for a source file.
You should be able to find what do all these configurations mean in that web page.
Best Regards,
Yuxuan

More Answers (2)

Toshifumi Sone
Toshifumi Sone on 25 Feb 2021
Dear Yuxuan,
Thank you for comment. Could you tell me some more?
  • Does the embedded corder use only MSVC compiler to make .c file or .h file? Is it impossible to use compiler for Renesas microcontroller ?
  • I tried to use cc-rx compiler within the make file. But the cc-rx compiler could not understand the -D option because it doesn't have the option. In this case how could I use cc-rx compiler ? Is it impossible to make executable file with embedded corder ? I would like to build with Embedded corder and get .hex file as executable file.
Kind regards,
Toshifumi
  2 Comments
Toshifumi Sone
Toshifumi Sone on 7 Mar 2021
If you have succeeded to make executable file could you tell me about toolchain some more?
-Do you succeed to make executable file with the way you show avobe?
-How do you custom for Linker?
Regards,
Toshifumi

Sign in to comment.


Toshifumi Sone
Toshifumi Sone on 26 Feb 2021
Dear Ondrej,
Thank you for your advise. My embedded corder started to compile with cc-rx from Renesas.
But I found another error by compiler like below.
Have you ever expericnce this?
...### ツールチェーンの使用: Renesas | gmake makefile (RX64M)
### 'C:\Users\59692\Desktop\20210222_Simulink Share\Main\NassFCM_ert_rtw\NassFCM.mk' は最新の状態です。
### 'NassFCM' をビルドしています: "C:\PROGRA~1\MATLAB\R2017A~1\bin\win64\gmake" -f NassFCM.mk postbuild all
"C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RX\V3.03.00\Bin/ccrx" -isa=rxv2 -fpu -endian=big -dbl_size=8 -signed_char -signed_bitfield -auto_enum -bit_order=left -pack -lang=c99 -output=obj -define=TERMFCN=1 -define=ONESTEPFCN=1 -define=MAT_FILE=0 -define=MULTI_INSTANCE_CODE=0 -define=INTEGER_CODE=0 -define=MT=0 -define=CLASSIC_INTERFACE=0 -define=ALLOCATIONFCN=0 -define=TID01EQ=0 -define=MODEL=NassFCM -define=NUMST=1 -define=NCSTATES=0 -define=HAVESTDIO -include=C:/Users/59692/Desktop/202102~1/Main -include=C:/Users/59692/Desktop/202102~1/Main/NassFCM_ert_rtw -include=C:/Users/59692/Desktop/HA11test/src/smc_gen -include=C:/Users/59692/Desktop/202102~1/Main/AppInterface/Nass -include=C:/Program -include=C:/Users/59692/Desktop/202102~1/Main/Files -include=C:/Users/59692/Desktop/202102~1/Main/(x86)/Renesas -include=C:/Users/59692/Desktop/202102~1/Main/Electronics/CS+/CC/CC-RX/V3.03.00/bin -include=C:/Users/59692/Desktop/202102~1/Main/AppInterface/Generic -include=C:/PROGRA~1/MATLAB/R2017A~1/extern/include -include=C:/PROGRA~1/MATLAB/R2017A~1/simulink/include -include=C:/PROGRA~1/MATLAB/R2017A~1/rtw/c/src -include=C:/PROGRA~1/MATLAB/R2017A~1/rtw/c/src/ext_mode/common -include=C:/PROGRA~1/MATLAB/R2017A~1/rtw/c/ert "AirByp.c"
RX Family C/C++ Compiler V3.03.00 [20 Nov 2020]
RX Family Assembler V3.03.00.02 [11 Nov 2020]
Renesas Optimizing Linker V3.03.00 [01 Oct 2020]
Copyright (C) 2011, 2020 Renesas Electronics Corporation
Copyright (C) 2003-2020 University of Illinois at Urbana-Champaign.
All rights reserved.
AirByp.c:
F0553200:Error occurred in executing 'macrx.exe'
Kind regards,
Sone

Community Treasure Hunt

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

Start Hunting!