Failed to generate binary outputs when calling Simulink command?

I get this error when I try to run Simulink command that is linked to my Arduino board. However, I obtain this error which I deduced is due to the missing Arduino.h file based on the last few lines.

------------------------------------------------------------------------- C:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -std=gnu++11 -fno-threadsafe-statics -fno-rtti -fno-exceptions -Os -c -g -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -DARDUINO=10801 -MMD -MP -MF"MW_PWM.dep" -MT"MW_PWM.o" -MMD -mcpu=cortex-m0plus -fpermissive -DF_CPU=48000000L -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x824e -DUSBCON -DUSB_MANUFACTURER=""Unknown"" -DUSB_PRODUCT=""Genuino MKR1000"" -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MKR1000_ -DMODEL=myDCMotorControl -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DEXT_MODE=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=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_PRESCALAR=256 -DMW_TIMERCOUNT=18750 -DMW_SCHEDULERCOUNTER=1 -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_BAUDRATE_SERIAL1_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DEXT_MODE=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=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=myDCMotorControl -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/PROGRA~1/MATLAB/SAVEDW~1/RLCCIR~1/207201~1/CONTRO~1/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/shared/svd/include -IC:/PROGRA~1/MATLAB/SAVEDW~1/RLCCIR~1/207201~1/CONTRO~1/arduino/myDCMotorControl_ert_rtw -IC:/PROGRA~1/MATLAB/R2018a/extern/include -IC:/PROGRA~1/MATLAB/R2018a/simulink/include -IC:/PROGRA~1/MATLAB/R2018a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2018a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2018a/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2018a/toolbox/coder/rtiostream/src/utils -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.6.12/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.6.12/variants/mkr1000 -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinotarget/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinotarget/scheduler/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/armcortexmbase/scheduler/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/shared/externalmode_daemon/include -o MW_PWM.o C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp:6:21: fatal error: Arduino.h: No such file or directory #include "Arduino.h" ^ compilation terminated. gmake: * [MW_PWM.o] Error 1 The make command returned an error of 2 'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command, operable program or batch file.


So I went to Arduino file and obtain the Arduino.h file and copy it to the C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox... directory. However a new source of error comes out and this time it is another file missing. I try searching for the file on my Arduino folder but I can't find. I guess there is a lot of missing files but I don't know why because I follow the steps for my this project from Mathwork itself.


In file included from C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp:6:0: C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/Arduino.h:28:26: fatal error: avr/pgmspace.h: No such file or directory #include avr/pgmspace.h ^


FYI, the project I am working on: Arduino Profile

Maybe the mathworks forum at the mathworks website could also help you.

It usually takes a bit of fiddling and time to get simulink working with arduino for the first time.

A big question is..... have you managed to get simulink to work with arduino in any particular way .... such as via one of their provided examples? Simulink has at least 1 example. You should mention if you managed to get that (or any) example working. This should be automatically mentioned..... because nobody can read your mind and know what you've done before (or not) with simulink.

Hi I did ask on mathworks too but no one has yet to reply :frowning:

Anyway simulink so far does not work with Arduino yet as this is my first project.

Arduino do work with Matlab itself by typing through the command window or as script. This is the example Arduino works with Matlab, Arduino Profile .