MATLAB Answers

0

How can I solve the problem about arduino error?

Asked by Alaa Al-Ibadi on 17 Mar 2017
Latest activity Answered by Alisha Schor on 21 Mar 2017
I have this error when run the Simulink , could you help please? Simulation Clear 10:26 AM Elapsed: 2 sec Simulation 3 1 Clear 10:27 AM Elapsed: 7 sec Simulation 3 1 Clear 10:33 AM Elapsed: 6 sec Simulation 3 1 Clear 10:44 AM Elapsed: 8 sec Simulation 3 1 Clear 10:54 AM Elapsed: 7 sec ### Starting build procedure for model: controllersingle4 Code Generation 1 Elapsed: 6 sec ### Generating code into build folder: C:\Users\Virtalis\Desktop\single\controllersingle4_ert_rtw ### Invoking Target Language Compiler on controllersingle4.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 controllersingle4.h . ### Writing header file controllersingle4_types.h ### Writing header file controllersingle4_private.h ### Writing header file rtwtypes.h ### Writing header file multiword_types.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 rtGetNaN.h ### Writing source file rtGetNaN.c ### Writing source file controllersingle4.c ### Writing header file rtmodel.h ### Writing source file controllersingle4_data.c ### Writing source file ert_main.c . ### TLC code generation complete. ### Generating TLC interface API. ................................................... ### Creating data type transition file controllersingle4_dt.h .### Evaluating PostCodeGenCommand specified in the model ### Using toolchain: Arduino AVR v1.6.13 | gmake (64-bit Windows) ### 'C:\Users\Virtalis\Desktop\single\controllersingle4_ert_rtw\controllersingle4.mk' is up to date ### Building 'controllersingle4': "C:\PROGRA~1\MATLAB\R2017a\bin\win64\gmake" -f controllersingle4.mk all C:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/tools/avr/bin/avr-gcc -std=gnu11 -c -g -w -ffunction-sections -fdata-sections -MMD -DARDUINO=10613 -MMD -MP -MF"controllersingle4.dep" -MT"controllersingle4.o" -Os -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MEGA2560_ -DDAEMON_MODE -DMODEL=controllersingle4 -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DEXT_MODE=1 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=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=5 -DMW_PRESCALAR=1024 -DMW_TIMERCOUNT=62411 -DMW_SCHEDULERCOUNTER=1 -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 -DEXT_MODE=1 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=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=controllersingle4 -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/Virtalis/Desktop/single -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Virtalis/Desktop/single/controllersingle4_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/arduino-1.6.13/hardware/arduino/avr/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2017a/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/arduino/avr/variants/mega -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/3P.instrset/arduinoide.instrset/arduino-1.6.13/hardware/tools/avr/avr/include/avr -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/shared/externalmode_daemon/include -o controllersingle4.o controllersingle4.c controllersingle4.c: In function 'controllersingle4_step0': controllersingle4.c:580:1: error: unable to find a register to spill in class 'POINTER_REGS' } ^ controllersingle4.c:580:1: error: this is the insn: (insn 197 196 199 12 (set (reg:SF 89 [ D.3751 ]) (mem:SF (post_inc:HI (reg:HI 2 r2 [orig:231 ivtmp.87 ] [231])) [5 MEM[base: _675, offset: 0B]+0 S4 A8])) controllersingle4.c:195 100 {*movsf} (expr_list:REG_INC (reg:HI 2 r2 [orig:231 ivtmp.87 ] [231]) (nil))) controllersingle4.c:580: confused by earlier errors, bailing out gmake: * [controllersingle4.o] Error 1 ### Creating HTML report file controllersingle4_codegen_rpt.html ### Build procedure for model: 'controllersingle4' aborted due to an error. Error(s) encountered while building "controllersingle4": ### Failed to generate all binary outputs.

  0 Comments

Sign in to comment.

1 Answer

Answer by Alisha Schor on 21 Mar 2017
 Accepted Answer

Please try changing the solver from the default (ode3) to one of the following:
  • ode8 (Dormand-Prince RK8(7))
  • ode5 (Dormand-Prince)
  • ode2 (Heun)
  • ode1 (Euler)
Solver settings are accessible by clicking the Gear icon on the toolstrip (Configuration Parameters) and choosing the "Solver" pane.
More information on solver settings can be found here: http://www.mathworks.com/help/simulink/gui/solver-pane.html#bq9mhyj-1

  0 Comments

Sign in to comment.