- the stack
- space for dynamic memory allocation
- space for the code itself
- space reserved for linking libraries
### Failed to generate all binary outputs.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Abdelkarem
il 27 Ago 2022
Commentato: Walter Roberson
il 3 Set 2022
C:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64/ssc_sli_51dbd3b5.c: In function 'ssc_sli_VWUIfbRWEMtiV9ZRRaNbxF': C:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64/ssc_sli_51dbd3b5.c:1166:1: error: total size of local objects too large ssc_sli_VWUIfbRWEMtiV9ZRRaNbxF(const PmIntVector ssc_sli_F7UcMb_yyWdcfq7zAn1cYG ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64/ssc_sli_51dbd3b5.c:1166:1: error: total size of local objects too large "C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/tools/avr/bin/avr-gcc" -std=gnu11 -c -w -ffunction-sections -fdata-sections -MMD -DARDUINO=10801 -MMD -MP -MF"ssc_sli_9abcdb7f.dep" -MT"ssc_sli_9abcdb7f.o" -Os -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -D_RUNONTARGETHARDWARE_BUILD_ -DMODEL=Battery_two_RC_UKF -DNUMST=2 -DNCSTATES=12 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=0 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DXCP_CUSTOM_PLATFORM -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -D_MW_ARDUINO_LOOP_=1 -DMW_ARDUINO_STEP_SIZE=1000000 -DMW_ARDUINO_MICROS -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=0 -DONESTEPFCN=1 -DMAT_FILE=0 -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=Battery_two_RC_UKF -DNUMST=2 -DNCSTATES=12 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/acer/Desktop/the_two_RC_model -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/shared/svd/include -IC:/Users/acer/Desktop/the_two_RC_model/Battery_two_RC_UKF_ert_rtw -IC:/PROGRA~1/POLYSP~1/R2020a/extern/include -IC:/PROGRA~1/POLYSP~1/R2020a/simulink/include -IC:/PROGRA~1/POLYSP~1/R2020a/rtw/c/src -IC:/PROGRA~1/POLYSP~1/R2020a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/POLYSP~1/R2020a/rtw/c/ert -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/compiler/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/network_engine/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/math/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/lang/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/external/library/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/foundation/core/c/win64 -IC:/Users/acer/Desktop/the_two_RC_model/slprj/ert/_sharedutils -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/arduino/avr/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/arduino/avr/variants/standard -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/libraries/Servo/src -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/SUPPOR~1/ARDUIN~1/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/SUPPOR~1/ARDUIN~1/SCHEDU~1/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/SUPPOR~1/ARDUIN~2/include -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/tools/avr/avr/include/avr -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/shared/EXTERN~1/include -o "ssc_sli_9abcdb7f.o" "C:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64/ssc_sli_9abcdb7f.c" "C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/tools/avr/bin/avr-gcc" -std=gnu11 -c -w -ffunction-sections -fdata-sections -MMD -DARDUINO=10801 -MMD -MP -MF"ssc_sli_9b67747c.dep" -MT"ssc_sli_9b67747c.o" -Os -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -D_RUNONTARGETHARDWARE_BUILD_ -DMODEL=Battery_two_RC_UKF -DNUMST=2 -DNCSTATES=12 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=0 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DXCP_CUSTOM_PLATFORM -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -D_MW_ARDUINO_LOOP_=1 -DMW_ARDUINO_STEP_SIZE=1000000 -DMW_ARDUINO_MICROS -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=0 -DONESTEPFCN=1 -DMAT_FILE=0 -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=Battery_two_RC_UKF -DNUMST=2 -DNCSTATES=12 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/acer/Desktop/the_two_RC_model -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/shared/svd/include -IC:/Users/acer/Desktop/the_two_RC_model/Battery_two_RC_UKF_ert_rtw -IC:/PROGRA~1/POLYSP~1/R2020a/extern/include -IC:/PROGRA~1/POLYSP~1/R2020a/simulink/include -IC:/PROGRA~1/POLYSP~1/R2020a/rtw/c/src -IC:/PROGRA~1/POLYSP~1/R2020a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/POLYSP~1/R2020a/rtw/c/ert -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/compiler/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/network_engine/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/math/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/lang/core/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/external/library/c/win64 -IC:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/common/foundation/core/c/win64 -IC:/Users/acer/Desktop/the_two_RC_model/slprj/ert/_sharedutils -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/arduino/avr/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/arduino/avr/variants/standard -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/libraries/Servo/src -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/SUPPOR~1/ARDUIN~1/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/SUPPOR~1/ARDUIN~1/SCHEDU~1/include -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/SUPPOR~1/ARDUIN~2/include -IC:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/arduinoide.instrset/hardware/tools/avr/avr/include/avr -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2020a/toolbox/target/shared/EXTERN~1/include -o "ssc_sli_9b67747c.o" "C:/PROGRA~1/POLYSP~1/R2020a/toolbox/physmod/simscape/engine/sli/c/win64/ssc_sli_9b67747c.c" gmake[1]: *** [ssc_sli_51dbd3b5.o] Error 1 gmake[1]: *** Waiting for unfinished jobs.... gmake[1]: Leaving directory `C:/Users/acer/Desktop/the_two_RC_model/Battery_two_RC_UKF_ert_rtw' gmake: *** [all] Error 2 C:\Users\acer\Desktop\the_two_RC_model\Battery_two_RC_UKF_ert_rtw>echo The make command returned an error of 2 The make command returned an error of 2 C:\Users\acer\Desktop\the_two_RC_model\Battery_two_RC_UKF_ert_rtw>exit 1 Error(s) encountered while building "Battery_two_RC_UKF":
0 Commenti
Risposta accettata
Walter Roberson
il 27 Ago 2022
There might be more than one way this can happen, but one of the ways it can happen is if you have a function that has local variables whose size exceeds the maximum stack size for the Arduino you are targetting.
In some cases, it can mean that you are asking for local variables larger than the entire memory of the Arduino. In other cases it can mean that the stack size is configured for smaller than that and you have exceeded the configured stack size.
It is not uncommon for a stack size to be configured when building programs. When you build a program, you are always having to balance between:
Some systems allow you to adjust the balance.
It is common that systems are configured so that the stack starts at one side and dynamic memory starts at the other side and they grow towards the middle. If you are working on an embedded system, there would not be any dynamic link libraries, and in theory you would not need to configure a maximum stack size for the purpose of reserving space for the dynamic libraries. On the other hand when you are using embedded systems it is often in the context of needing a guarantee that the program will never run out of stack space, so a maximum stack size is often configured anyhow...
4 Commenti
Walter Roberson
il 3 Set 2022
It looks like on Arduino, the stack pointer is initialized to the top of memory; https://community.platformio.org/t/how-can-i-change-the-stack-size-on-arduino/15625
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Arduino Hardware in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!