MATLAB Answers

Compilation error in Simulink Support for Arduino

3 views (last 30 days)
Raghvendra Cowlagi
Raghvendra Cowlagi on 4 Aug 2017
Commented: Stefan Schmidt on 7 Sep 2017
I am trying to create a device driver block in Simulink for the Adafruit LSM303 IMU, but I keep running into compilation errors. I've copy-pasted the diagnostics output below. Any suggestions? It seems to be looking for avr/io.h somewhere in the MATLAB support package path.
### Generating code into build folder: C:\Users\Raghu\Documents\Git-SRCL\rvc_teaching_matlab\ae4733\simulink-arduino\lsm303u_test\lsm303u_driver\lsm303u_test1_ert_rtw ### Invoking Target Language Compiler on lsm303u_test1.rtw ### Using System Target File: C:\Program Files\MATLAB\R2017a\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 lsm303u_test1.h . ### Writing header file lsm303u_test1_types.h ### Writing header file rtwtypes.h ### Writing header file multiword_types.h ### Writing source file lsm303u_test1.c ### Writing header file lsm303u_test1_private.h . ### Writing header file rtmodel.h ### Writing source file ert_main.c ### TLC code generation complete. ### Generating TLC interface API. ... ### Creating data type transition file lsm303u_test1_dt.h .### Evaluating PostCodeGenCommand specified in the model ### Using toolchain: Arduino ARM v1.6.7 | gmake (64-bit Windows) ### 'C:\Users\Raghu\Documents\Git-SRCL\rvc_teaching_matlab\ae4733\simulink-arduino\lsm303u_test\lsm303u_driver\lsm303u_test1_ert_rtw\lsm303u_test1.mk' is up to date ### Building 'lsm303u_test1': "C:\PROGRA~1\MATLAB\R2017a\bin\win64\gmake" -f lsm303u_test1.mk all
C:\Users\Raghu\Documents\Git-SRCL\rvc_teaching_matlab\ae4733\simulink-arduino\lsm303u_test\lsm303u_driver\lsm303u_test1_ert_rtw>cd .
C:\Users\Raghu\Documents\Git-SRCL\rvc_teaching_matlab\ae4733\simulink-arduino\lsm303u_test\lsm303u_driver\lsm303u_test1_ert_rtw>if "" == "" ("C:\PROGRA~1\MATLAB\R2017a\bin\win64\gmake" -f lsm303u_test1.mk all ) else ("C:\PROGRA~1\MATLAB\R2017a\bin\win64\gmake" -f lsm303u_test1.mk ) C:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc -Os -c -g -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -DARDUINO=10607 -MMD -MP -MF"twi.dep" -MT"twi.o" -MD -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER=\""Unknown\"" -DUSB_PRODUCT=\""Arduino Due\"" -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_DUE_ -DMODEL=lsm303u_test1 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DEXT_MODE=1 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DMW_TIMERID=9 -DMW_TIMERCOUNT=131250 -DMW_SAM_CLOCKID=TC_CMR_TCCLKS_TIMER_CLOCK4 -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 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DEXT_MODE=1 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -DRT -DMODEL=lsm303u_test1 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/Raghu/Documents/Git-SRCL/rvc_teaching_matlab/ae4733/simulink-arduino/lsm303u_test/lsm303u_driver -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/arduino/avr/libraries/Wire -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/arduino/avr/libraries/Wire/src -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/arduino/avr/libraries/Wire/src/utility -IC:/Users/Raghu/Documents/Git-SRCL/rvc_teaching_matlab/ae4733/simulink-arduino/lsm303u_test/lsm303u_driver/include -IC:/Users/Raghu/Documents/Git-SRCL/rvc_teaching_matlab/ae4733/simulink-arduino/lsm303u_test/lsm303u_driver/lsm303u_test1_ert_rtw -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2017a/toolbox/coder/rtiostream/src/utils -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/sam/1.6.7/system/libsam -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/sam/1.6.7/system/CMSIS/CMSIS/Include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/sam/1.6.7/system/CMSIS/Device/ATMEL -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/sam/1.6.7/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/sam/1.6.7/cores/arduino/avr -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/sam/1.6.7/variants/arduino_due_x -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinotarget/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinotarget/scheduler/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/shared/externalmode_daemon/include -o twi.o C:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/arduino/avr/libraries/Wire/src/utility/twi.c C:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:20: fatal error: avr/io.h: No such file or directory #include avr/io.h ^ compilation terminated. gmake: * [twi.o] Error 1
C:\Users\Raghu\Documents\Git-SRCL\rvc_teaching_matlab\ae4733\simulink-arduino\lsm303u_test\lsm303u_driver\lsm303u_test1_ert_rtw>echo The make command returned an error of 2 The make command returned an error of 2
C:\Users\Raghu\Documents\Git-SRCL\rvc_teaching_matlab\ae4733\simulink-arduino\lsm303u_test\lsm303u_driver\lsm303u_test1_ert_rtw>An_error_occurred_during_the_call_to_make 'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command, operable program or batch file.

  1 Comment

Stefan Schmidt
Stefan Schmidt on 7 Sep 2017
My Problem is nearly the same. The error says, that rtwtypes.h is "missing"

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!