Building Firmware Problems

I get errors when try to build the firmware. I seriously have no idea what you mean by this:

arm-none-eabi-gcc and other required gcc/arm binaries not in the PATH. Solution: Add the /bin folder to your $PATH (i.e. export PATH="$PATH:<SOME_GCC_ARM_DIR>/bin). Google “Add binary to PATH” for more details.

I searched Google, nothing close to my answer. Any tips?

are you on the web IDE or building local?

Building locally on my computer, following this:

I get this error:

Building file: ../CC3000_Host_Driver/evnt_handler.c
Invoking: ARM GCC C Compiler
mkdir -p obj/CC3000_Host_Driver/
arm-none-eabi-gcc -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb  -I../CC3000_Host_Driver -I../SPARK_Firmware_Driver/inc -I../SPARK_Services/inc -I../SPARK_Services/src/inc -I../STM32F10x_StdPeriph_Driver/inc -I../STM32_USB-FS-Device_Driver/inc -I../CMSIS/Include -I../CMSIS/Device/ST/STM32F10x/Include -I. -ffunction-sections -Wall -Wno-switch -fmessage-length=0 -MD -MP -MF obj/CC3000_Host_Driver/evnt_handler.o.d -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DRELEASE_BUILD -c -o obj/CC3000_Host_Driver/evnt_handler.o ../CC3000_Host_Driver/evnt_handler.c
../CC3000_Host_Driver/evnt_handler.c:61:23: fatal error: stdatomic.h: No such file or directory
compilation terminated.
make[1]: *** [obj/CC3000_Host_Driver/evnt_handler.o] Error 1
make: *** [check_external_deps] Error 2

Sounds like you are missing some files or your computer doesn’t know where to look for them.

stdatomic.h is part of GNU GCC arm toolchain files used to compile your code. Have you installed them? you can get the link from here https://github.com/spark/firmware

If you have installed them then the computer doesn’t know where they are. the location will need to be set in your Path Variables. the path variables can be set in Control panel - system - Advanced system settings - Evnironment variables… make sure path is highlighted and click edit. you should find something like this, if not then you will need to add it in (just make sure that the folder structure matches your setup and the version matches the one your using)

C:\GNU Tools ARM Embedded\4.8 2014q2\bin
1 Like

Im on Mac… I can’t find this thing:
" Add the /bin folder to your $PATH (i.e. export PATH="$PATH:/bin) "

I tried the Gist here:

And added also in my .bash_profile
export PATH="$PATH:/usr/local/gcc_arm/gcc-arm-none-eabi-4_8-2014q2/bin/"

But still doesn’t work

Looks like you need to upgrade to version 4.8 of arm gcc.

EDIT: oops saw your last post.

  • Did you move the downloaded gcc-arm to the /usr/local path?
  • Is the directory named gcc-arm-none-eabi-4_8 (or however referenced in your bash_profiles path)?
  • Did you restart your Terminal after adding the line to your ~/.bash_profile
  • Are all repositories (firmware, core-communication-lib and core-common-lib) placed in the same folder?

:sunflower:

Tick YES on all the above! Still the same problem as before!!! Btw Im on 10.6.8 if something has got to do with it.

Question: Are the repositories (firmware, core-communication-lib and core-common-lib) supposed to go altogether? I have created a folder namer Spark in my User/Local directory, and in there each folder exists (with the gcc_arm too).

Shouldn’t matter, as all the build related binaries/includes are coming from the arm-gcc package.

Yep as they are currently included in the makefile via relative paths and assuming you trigger make from inside core-firmware/build/.

It’s a little bit weird issue, as stdatomic should indeed be a part of the arm-gcc toolchain. To get closer to the source of this error, please copy&paste the output of arm-none-eabi-gcc --version - thanks!

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.4 20140401 (release) [ARM/embedded-4_7-branch revision 209195]
Copyright © 2012 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.

However, I suspect that there might be a problem with the installation of arm using brew. I used this process to install it at first, and possibly I have to undo this installation and install it fresh.

brew tap PX4/homebrew-px4
brew update
brew install gcc-arm-none-eabi

Yeyyy, you are using an outdated version supplied by the brew tap :wink:

Let me guess:

$ which arm-none-eabi-gcc

won’t point to your /usr/local/.../gcc-arm-none-eabi-...?

So! Two solutions to your problem:

either

  • in your .bash_profile, change export PATH="$PATH:/...gcc-arm-.../bin/" to export PATH="/...gcc-arm-.../bin/:$PATH" to solve it via a lookup priority

  • brew uninstall gcc-arm-none-eabi to avoid multiple versions on your system

Either or - it will solve your problem :wink:

Enjoy! :sunflower:

Tears of joy…!!!
Many thanks for the help!

1 Like

Earlier the make command worked fine! Now, I do it again and I get this:

collect2: error: ld returned 1 exit status
make: *** [core-firmware.elf] Error 1

What I am trying to do is to create a new firmware version using the OSC library as described here:

This is a very unrelated problem to the previous on, I tried compiling the mentioned sparkcore_osc and ran into deprecated and dozens of other compilation errors. Try directly contacting the software maintainers with a detailed error output copy&paste via their https://github.com/trublion/sparkcore_osc/issues tracker (or maybe their post here or here) to get support related to their code - good luck! :sunflower:

1 Like

Louis, Did you ever get a solution to this? I’m having the same problem.

Nope…no luck…try to do it in another way…

Does the issue remain?

I get the same

collect2: error: ld returned 1 exit status make: *** [core-firmware.elf] Error 1

Hi @acatus

This means your program did not link, so there is something still undefined when you are done with compiling and try to link it all together.

Are there any other errors above this in the output?

1 Like

Hi @bko,

I have posted the complete terminal response here: https://github.com/trublion/sparkcore_osc/issues/2
There is this first defined here issue that appears a lot.

Could that cause the problem? If yes, any idea on how to solve it :smile:

Thank you for your quick reply btw.

It looks the compiler thinks you are defining all the OSC stuff more than once. Assuming you don’t have multiple copies of the code being compiled, then the usual way this happens is by #include'ing something like a header file more than once and it is not protected against that.

Try going to into any .h file and adding this at the top:

#pragma once

See if that helps.

1 Like