I’m not sure if this is a bug in the current code, or something I’m doing wrong, however when working with the latest develop branch of the firmware, on Windows 7, with Arm 4.9 2015q2, I’m getting an error when building for the Photon platform, that I’m not seeing when building for the Core. I’m doing a git reset --hard
prior to these builds, and building with make clean all v=1
with PLATFORM=photon
for the photon build. Here’s the end of the build output:
Building target: ../../../build/target/user-part/platform-6-m-lto/user-part.elf
Invoking: ARM GCC C++ Linker
mkdir -p ../../../build/target/user-part/platform-6-m-lto/
arm-none-eabi-g++ -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -DINCLUDE_PLATFORM=1 -fno-builtin -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=2 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,2 -DRELEASE_BUILD -Werror -I./inc -I../../../user/inc -I../../../dynalib/inc -I../../../services/inc -I../../../hal/inc -I../../../hal/shared -I../../../hal/src/photon -I../../../hal/src/stm32f2xx -I../../../hal/src/photon/api -I../../../system/inc -I../../../rt-dynalib/inc -I../../../wiring/inc -I../../../modules/photon/system-part1/inc -I../../../platform/shared -I../../../platform/MCU/STM32F2xx/CMSIS/Include -I../../../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../../../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I. -MD -MP -MF ../../../build/target/user-part/platform-6-m-lto/user-part.elf.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -flto ../../../build/target/user-part/platform-6-m-lto/src/module_info.o ../../../build/target/user-part/platform-6-m-lto/src/user_export.o ../../../build/target/user-part/platform-6-m-lto/src/user_module.o ../../../build/target/user-part/platform-6-m-lto/src/newlib_stubs.o --output ../../../build/target/user-part/platform-6-m-lto/user-part.elf -Wl,--whole-archive ../../../hal/src/photon/lib/STM32F2xx_Peripheral_Libraries.a -Wl,--no-whole-archive --specs=nano.specs -lnosys -L../../../modules/photon/system-part2 -L../../../modules/photon/system-part1 -L. -T./linker.ld -Wl,--defsym,USER_FIRMWARE_IMAGE_SIZE=0x20000 -Wl,--defsym,USER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -Wl,-Map,../../../build/target/user-part/platform-6-m-lto/user-part.map -L../../../build/target/user/platform-6-m-lto/src/ -L../../../build/target/services-dynalib/arm/ -L../../../build/target/hal-dynalib/platform-6-m-lto/ -L../../../build/target/system-dynalib/platform-6-m-lto/ -L../../../build/target/rt-dynalib/platform-6-m-lto/ -L../../../build/target/wiring/platform-6-m-lto/ -L../../../build/target/communication-dynalib/platform-6-m-lto/ -L../../../build/target/platform/platform-6-m-lto/ -L../../../hal/src/photon/lib/ -Wl,--whole-archive -luser -lhal-dynalib -lservices-dynalib -lsystem-dynalib -lrt-dynalib -lwiring -lcommunication-dynalib -lplatform -Wl,--no-whole-archive -L../../../build/arm/linker -nostartfiles -Xlinker --gc-sections -flto -Os -fuse-linker-plugin
C:\Users\Daniel\AppData\Local\Temp\ccUG1Xr6.ltrans0.ltrans.o: In function `sscanf':
C:\Users\Daniel\Documents\GitHub\firmware\modules\photon\user-part/./inc/rt_dynalib.h:33: multiple definition of `sscanf'
d:/dev/gnu tools arm embedded/4.9 2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7-m\libg_nano.a(lib_a-sscanf.o):sscanf.c:(.text.sscanf+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make[2]: *** [../../../build/target/user-part/platform-6-m-lto/user-part.elf] Error 1
make[2]: Leaving directory `C:/Users/Daniel/Documents/GitHub/firmware/modules/photon/user-part'
make[1]: *** [modules/photon/user-part] Error 2
make[1]: Leaving directory `C:/Users/Daniel/Documents/GitHub/firmware/main'
make: *** [main] Error 2
I tried taking the offending line out of the rt_dynalib.h
file, DYNALIB_FN(rt, sscanf)
, which results in a successful compile, however I’m afraid to try flashing the result, as I’m not sure if it’ll screw something up. Any ideas? Thanks!