Hello,
I've been trying to get my Simulink model onto the Arduino Mega 2560 for some time now. Unfortunately, I always get an error message. After I was able to solve some error messages, there is this error message which is just not solvable for me:
--------------------------------------------------------------------------------------------------------------------------------------
### Starting build procedure for: Real_Model
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: C:\Users\filip\seminararbeit\Real_Model_ert_rtw
### Invoking Target Language Compiler on Real_Model.rtw
### Using System Target File: C:\Program Files\MATLAB\R2021a\rtw\c\ert\ert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code
### Writing header file Real_Model_types.h
### Writing source file Real_Model.c
### Writing header file Real_Model_private.h
.
### Writing header file Real_Model.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing header file rt_defines.h
.
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rtmodel.h
### Writing source file Real_Model_data.c
### Writing source file ert_main.c
.
### TLC code generation complete.
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: Arduino AVR
### Creating 'C:\Users\filip\seminararbeit\Real_Model_ert_rtw\Real_Model.mk' ...
### Building 'Real_Model': "C:\PROGRA~1\MATLAB\R2021a\bin\win64\gmake" -f wrapper.mk all
C:\Users\filip\seminararbeit\Real_Model_ert_rtw>cd .
C:\Users\filip\seminararbeit\Real_Model_ert_rtw>chcp 1252
Aktive Codepage: 1252.
C:\Users\filip\seminararbeit\Real_Model_ert_rtw>if "" == "" ("C:\PROGRA~1\MATLAB\R2021a\bin\win64\gmake" -f wrapper.mk all ) else ("C:\PROGRA~1\MATLAB\R2021a\bin\win64\gmake" -f wrapper.mk )
"### Generating static library."
"C:/Program Files/MATLAB/R2021a/bin/win64/gmake" -j5 -C "C:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1" SHELL="%SystemRoot%/system32/cmd.exe" -f avrcore.mk all
gmake[1]: Entering directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1'
"### Successfully generated libcore.a library."
gmake[1]: Leaving directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1'
"C:/Program Files/MATLAB/R2021a/bin/win64/gmake" -j5 SHELL="%SystemRoot%/system32/cmd.exe" -f "Real_Model.mk" all
gmake[1]: Entering directory `C:/Users/filip/seminararbeit/Real_Model_ert_rtw'
"C:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/tools/avr/bin/avr-g++" -std=gnu++11 -fpermissive -fno-exceptions -fno-threadsafe-statics -c -w -ffunction-sections -fdata-sections -MMD -DARDUINO=10801 -MMD -MP -MF"Wire.dep" -MT"Wire.o" -Os -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MEGA2560_ -DARDUINO_NUM_SERIAL_PORTS=4 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DMW_TIMERID=1 -DMW_PRESCALAR=64 -DMW_TIMERCOUNT=63911 -DMW_SCHEDULERCOUNTER=1 -DARDUINO_NUM_SERIAL_PORTS=4 -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_BAUDRATE_SERIAL1_=9600 -D_RTT_BAUDRATE_SERIAL2_=9600 -D_RTT_BAUDRATE_SERIAL3_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DXCP_CUSTOM_PLATFORM -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -DRT -DMODEL=Real_Model -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/filip/seminararbeit -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire/utility -IC:/Users/filip/AppData/Roaming/MATHWO~1/MATLAB~1/COLLEC~1/RENSSE~1/RASPlib/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire/src -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire/src/utility -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/shared/svd/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~2/include -IC:/Users/filip/AppData/Roaming/MATHWO~1/MATLAB~1/COLLEC~1/RENSSE~1/RASPlib/src -IC:/Users/filip/seminararbeit/Real_Model_ert_rtw -IC:/PROGRA~1/MATLAB/R2021a/extern/include -IC:/PROGRA~1/MATLAB/R2021a/simulink/include -IC:/PROGRA~1/MATLAB/R2021a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2021a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2021a/rtw/c/ert -IC:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/arduino/avr/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/arduino/avr/variants/mega -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~1/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~1/SCHEDU~1/include -IC:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/tools/avr/avr/include/avr -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/shared/EXTERN~1/include -o "Wire.o" "C:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/arduino/avr/libraries/Wire/Wire.cpp"
[...]
"C:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/tools/avr/bin/avr-gcc" -std=gnu11 -c -w -ffunction-sections -fdata-sections -MMD -DARDUINO=10801 -MMD -MP -MF"ert_main.dep" -MT"ert_main.o" -Os -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MEGA2560_ -DARDUINO_NUM_SERIAL_PORTS=4 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DMW_TIMERID=1 -DMW_PRESCALAR=64 -DMW_TIMERCOUNT=63911 -DMW_SCHEDULERCOUNTER=1 -DARDUINO_NUM_SERIAL_PORTS=4 -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_BAUDRATE_SERIAL1_=9600 -D_RTT_BAUDRATE_SERIAL2_=9600 -D_RTT_BAUDRATE_SERIAL3_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DXCP_CUSTOM_PLATFORM -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -DRT -DMODEL=Real_Model -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/filip/seminararbeit -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire/utility -IC:/Users/filip/AppData/Roaming/MATHWO~1/MATLAB~1/COLLEC~1/RENSSE~1/RASPlib/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire/src -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/aIDE/hardware/arduino/avr/LIBRAR~1/Wire/src/utility -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/shared/svd/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~2/include -IC:/Users/filip/AppData/Roaming/MATHWO~1/MATLAB~1/COLLEC~1/RENSSE~1/RASPlib/src -IC:/Users/filip/seminararbeit/Real_Model_ert_rtw -IC:/PROGRA~1/MATLAB/R2021a/extern/include -IC:/PROGRA~1/MATLAB/R2021a/simulink/include -IC:/PROGRA~1/MATLAB/R2021a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2021a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2021a/rtw/c/ert -IC:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/arduino/avr/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/arduino/avr/variants/mega -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~1/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/SUPPOR~1/ARDUIN~1/SCHEDU~1/include -IC:/ProgramData/MATLAB/SupportPackages/R2021a/aIDE/hardware/tools/avr/avr/include/avr -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2021a/toolbox/target/shared/EXTERN~1/include -o "ert_main.o" "C:/Users/filip/seminararbeit/Real_Model_ert_rtw/ert_main.c"
gmake[1]: *** [Real_Model.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `C:/Users/filip/seminararbeit/Real_Model_ert_rtw'
gmake: *** [all] Error 2
C:\Users\filip\seminararbeit\Real_Model_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2
C:\Users\filip\seminararbeit\Real_Model_ert_rtw>exit /B 1
---------------------------------------------------------------------------------------
I would be very grateful for your help.