Local compiling on Ubuntu 14.04 (Linux Mint 17.3 Rosa)


#1

I’d like to get a toolchain setup and working but am balking at using https://launchpad.net/gcc-arm-embedded since my system already has arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2.

Has anyone successfully used this gcc on Ubuntu to compile Bluz GW firmware? The dependencies docs say that “The build requires version 4.9.3 20150529 or newer of ARM GCC and will print an error message if the version is older than this” but @eric recommended version 4.8 as recently as Feb 25th in this thread.

I’m getting this error about missing “string.h”:

# make PARTICLE_DEVELOP=1 APP=tinker PLATFORM=bluz-gw

 /home/rgm/src/bluzDK-firmware/modules/bluz-gw/system-part1/makefile /home/rgm/src/bluzDK-firmware/modules/bluz-gw/user-part/makefile
make -C /home/rgm/src/bluzDK-firmware/modules/bluz-gw/system-part1/   PLATFORM=bluz-gw APP=tinker PARTICLE_DEVELOP=1
make[1]: Entering directory `/home/rgm/src/bluzDK-firmware/modules/bluz-gw/system-part1'
make -C ../../../communication 
make[2]: Entering directory `/home/rgm/src/bluzDK-firmware/communication'
Building file: lib/mbedtls/library/aes.c
Invoking: ARM GCC C Compiler
mkdir -p ../build/target/communication/platform-269-m-prod-269/./lib/mbedtls/library/
arm-none-eabi-gcc -DSTM32_DEVICE -DNRF51 -DPLATFORM_THREADING=0 -DPLATFORM_ID=269 -DPLATFORM_NAME=bluz-gw -DUSBD_VID_SPARK=0x1D50 -DUSBD_PID_DFU=0x607F -DUSBD_PID_CDC=0x607D -g3 -Os -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -mabi=aapcs -DSOFTDEVICE_PRESENT -DBLE_STACK_SUPPORT_REQUIRED -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DUSE_CUSTOM_STATIC_ASSERT -DBLUZ -DS110_SUPPORT_REQUIRED -DS120_SUPPORT_REQUIRED -DPRODUCT_ID=269 -DPRODUCT_FIRMWARE_VERSION=65535 -DSYSTEM_VERSION_STRING=1.1.47 -DRELEASE_BUILD -Werror -I./src -I../hal/inc -I../hal/shared -I../dynalib/inc -I../services/inc -I./lib/mbedtls/include -I./lib/tropicssl/include -Ilib/tropicssl/include -I. -MD -MP -MF ../build/target/communication/platform-269-m-prod-269/./lib/mbedtls/library/aes.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 -DMBEDTLS_CONFIG_FILE="<mbedtls_config.h>" -DUSER_FIRMWARE_IMAGE_SIZE=0x5000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x00037000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=3 -DMODULE_FUNCTION=4 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=0,0,0 -std=gnu99 -Wno-pointer-sign -std=gnu99 -c -o ../build/target/communication/platform-269-m-prod-269/./lib/mbedtls/library/aes.o lib/mbedtls/library/aes.c
lib/mbedtls/library/aes.c:38:20: fatal error: string.h: No such file or directory
 #include <string.h>
                    ^
compilation terminated.
make[2]: *** [../build/target/communication/platform-269-m-prod-269/./lib/mbedtls/library/aes.o] Error 1
make[2]: Leaving directory `/home/rgm/src/bluzDK-firmware/communication'
make[1]: *** [communication] Error 2
make[1]: Leaving directory `/home/rgm/src/bluzDK-firmware/modules/bluz-gw/system-part1'
make: *** [/home/rgm/src/bluzDK-firmware/modules/bluz-gw/system-part1/makefile] Error 2

I tried installing both the libc6-armel-cross and linux-libc-dev-armel-cross packages with no luck.


#2

Got past string.h issue by installing libnewlib-arm-none-eabi, but now am hitting:

In file included from src/spark_protocol.h:29:0,
                 from src/spark_protocol.cpp:25:
src/protocol_defs.h:3:22: fatal error: functional: No such file or directory
 #include <functional>
                      ^
compilation terminated.
make[2]: *** [../build/target/communication/platform-269-m-prod-269/src/spark_protocol.o] Error 1
make[2]: Leaving directory `/home/rgm/src/bluzDK-firmware/communication

Could that be referring to “functional.hpp” provided by libboost or libquantlib0-dev? Maybe I should just unpack the pre-built archive after all…

Edit: I’d better go read this thread: https://community.particle.io/t/how-to-install-the-spark-toolchain-in-ubuntu-14-04/4139/21