Problem compiling firmware app

Hi All,

I’m getting the following error when compiling my app using make on the ubuntu command line:

% cd firmware/main
% make APP=test
. . .
    Invoking: ARM GCC CPP Compiler
    mkdir -p ../build/target/user/platform-0-lto/applications/test/applications/test/
    arm-none-eabi-gcc -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 -DSPARK_PLATFORM -DFLASHEE_EEPROM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -flto -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=0 -DPRODUCT_FIRMWARE_VERSION=65535 -DMBEDTLS_CONFIG_FILE="<mbedtls_config.h>" -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.4.9 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/src -I../communication/lib/mbedtls/include -I../communication/lib/tropicssl/include -I../hal/inc -I../hal/shared -I../hal/src/core -I../hal/src/stm32 -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./applications/test -I./libraries -I. -MD -MP -MF ../build/target/user/platform-0-lto/applications/test/applications/test/test.o.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 -DSPARK_PLATFORM_NET=CC3000 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DMODULE_VERSION=0 -DMODULE_FUNCTION=3 -DMODULE_DEPENDENCY=0,0,0  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++11 -c -o ../build/target/user/platform-0-lto/applications/test/applications/test/test.o applications/test/test.cpp
    In file included from /usr/arm-none-eabi/include/sys/select.h:27:0,
                     from /usr/arm-none-eabi/include/sys/types.h:89,
                     from /usr/arm-none-eabi/include/time.h:27,
                     from ../platform/NET/CC3000/CC3000_Host_Driver/socket.h:39,
                     from ../hal/src/core/platform_headers.h:23,
                     from ./inc/application.h:32,
                     from applications/test/test.cpp:21:
    /usr/arm-none-eabi/include/sys/_timeval.h:51:8: error: redefinition of 'struct timeval'
     struct timeval {
            ^
        indent prIn file included from ../hal/src/core/platform_headers.h:20:0,
                     from ./inc/application.h:32,
                     from applications/test/test.cpp:21:
    ../platform/NET/CC3000/CC3000_Host_Driver/cc3000_common.h:168:8: error: previous definition of 'struct timeval'
     struct timeval
            ^

Debug

% which arm-none-eabi-gcc
/usr/bin/arm-none-eabi-gcc

% /usr/bin/arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848]
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% apt-cache policy  gcc-arm-embedded
gcc-arm-embedded:
  Installed: 5-2015q4-1~wily1
  Candidate: 5-2015q4-1~wily1
  Version table:
 *** 5-2015q4-1~wily1 0
        500 http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu/ wily/main amd64 Packages
        100 /var/lib/dpkg/status
% git branch
  develop
* latest

% git log latest
commit c192999b7b2da9cdf9a1f954c2be7915716b41fe
Author: Matthew McGowan <mat.mcgowan+github@gmail.com>
Date:   Fri Jan 29 00:18:00 2016 +0100

    produces a compiler error when `Paritcle.variable()` is called with a `float`. Fixes #842

Any ideas what I’m doing wrong?

Thanks!

Please downgrade arm-gcc to 4.9.x - the firmware build doesn’t support the latest 5.x series.

1 Like

Great, will do.

Thanks for the quick help!

1 Like