Can't compile, previously could

Hi all,
I am having trouble compiling my code from the web ide. I have been running the same code for years but I recently have made some changes to my network and changed a where my mqtt connection string to a different dns entry… exact line only changed:

MQTT client(“hc.idilks.com”, 1883, mqttCallback);
to
MQTT client(“mqtt.idilks.com”, 1883, mqttCallback);

here is the compiler error:

 Building target: target/workspace.elf
Invoking: ARM GCC C++ Linker
mkdir -p target/
arm-none-eabi-g++ -DSTM32_DEVICE -DSTM32F10X_MD -DPLATFORM_THREADING=0 -DPLATFORM_ID=0 -DPLATFORM_NAME=core -DUSBD_VID_SPARK=0x1D50 -DUSBD_PID_DFU=0x607F -DUSBD_PID_CDC=0x607D -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -flto -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=0 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.6.2 -DRELEASE_BUILD -Werror -I../user/inc -I../wiring/inc -I../hal/inc -I../hal/shared -I../hal/src/core -I../hal/src/stm32 -I../system/inc -I../services/inc -I../communication/src -I../platform/shared/inc -I../platform/MCU/STM32F1xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F1xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F1xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F1xx/CMSIS/Include -I../platform/MCU/STM32F1xx/CMSIS/Device/ST/Include -I../platform/NET/CC3000/CC3000_Host_Driver -I../dynalib/inc -I. -MD -MP -MF target/workspace.elf.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DMODULE_VERSION=0 -DMODULE_FUNCTION=3 -DMODULE_DEPENDENCY=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE target/obj/./src/module_info.o  target/obj/startup/startup_stm32f10x_md.o --output target/workspace.elf -nostartfiles -Xlinker --gc-sections -flto -Os -fuse-linker-plugin -Tlinker_stm32f10x_md_dfu.ld -L../build/arm/linker --specs=nano.specs -lc -lnosys -u _printf_float -Wl,-Map,target/workspace.map  -L../build/target/user/platform-0-lto -L../build/target/wiring/platform-0-lto/ -L../build/target/system/platform-0-lto/ -L../build/target/services/platform-0-lto/ -L../build/target/communication/platform-0-lto-prod-0/ -L../build/target/hal/platform-0-lto/ -L../build/target/platform/platform-0-lto/ -L../build/target/wiring_globals/platform-0-lto/ -L../build/target/newlib_nano/platform-0-lto -L../build/arm/linker -Wl,--whole-archive -lnewlib_nano -luser -lwiring -lhal -lsystem -lservices -lcommunication -lplatform -lwiring_globals -Wl,--no-whole-archive
/usr/local/gcc-arm-embedded/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: target/workspace.elf section `.data' will not fit in region `APP_FLASH'
/usr/local/gcc-arm-embedded/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: region `APP_FLASH' overflowed by 740 bytes
collect2: error: ld returned 1 exit status
../build/module.mk:222: recipe for target 'target/workspace.elf' failed
make: *** [target/workspace.elf] Error 1

I have the orig spark core, targeting 0.6.2 firmware. I tried putting back the code to hc.idilks.com but still no luck. Any help greatly appreciated.

Thanks,
Brian

Some reason my paste got cut off… line of interest:

user -lwiring -lhal -lsystem -lservices -lcommunication -lplatform -lwiring_globals -Wl,--no-whole-archive
/usr/local/gcc-arm-embedded/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: target/workspace.elf section `.data' will not fit in region `APP_FLASH'
/usr/local/gcc-arm-embedded/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: region `APP_FLASH' overflowed by 740 bytes
collect2: error: ld returned 1 exit status
../build/module.mk:222: recipe for target 'target/workspace.elf' failed

I see it says I am overflowing by 740 bytes but I didn’t change my program… and it use to fit, not sure whats up.

The newer system version might be using slightly more resources pushing you just over the limit of what you were previously under. Give an older version a shot to see if that makes a difference, or try slimming down your code?

Thanks @Moors7

So I tried different firmware versions but no luck… code really doesn’t do too much, but I’ll see if I can cut anything out.

Ugh really frustrating, my code is already bare minimum. I don’t get what could have changed? I picked all different firmware versions. The code previously compiled. Is there something I can add or remove from my headers to have a more slimmer firmware?

Alight I got it… seems like with some code removed and if I go back to 0.6.0 I can compile. Must be extra code on the newer versions… go figure. Proton has more flash space correct?

Yup, the Photon is the way to go for bigger projects :wink:

5 Likes

So I am having the same issue. I’ve been using the same code for about 3.5 years on a couple of sparks. I went in to change one variable and it refuses to compile (changing the start color on an RGB LED from blue to more of a teal color.) For the target OS, I went as far back as 0.34.

/usr/local/gcc-arm-embedded/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld: target/workspace.elf section .data' will not fit in regionAPP_FLASH’

/usr/local/gcc-arm-embedded/bin/…/lib/gcc/arm-none-eabi/5.3.1/…/…/…/…/arm-none-eabi/bin/ld: region `APP_FLASH’ overflowed by 128 bytes

I spent about an hour trying to strip out stuff to no avail. It was working fine for years and years. Any suggestions?