Initial setup for compiling, loading, linking, uploading and debugging embedded programs
If you look at the Makefile, you can see the CC variable get set,
this will be set to a particular cross-compiler, the LD variable will often
get set to the same compiler since most compilers allow linking as well. This
section highlights different cross compilers that are available, what they are
for, and how to install them.
GCC ARM Embedded, aka gcc-arm-none-eabi
This is a "GNU toolchain with a GCC source branch targeted at Embedded ARM processors. I first heard of it when trying to setup a STM32F4 Discovery Board, I found a very helpful article about setting it up that showed me how to install it and also informed me of stlink which I discuss in the Flashing & Debugging Tools section.
There are a couple of things to watch out for when installing it, if you follow the readme.txt you should be alright:
# Install 32-bit libc
sudo apt-get install libc6-i386
# Install 32-bit libncurses
sudo apt-get install libncurses5:i386
# Install 32-bit python2.7
sudo apt-get install libpython2.7:i386Then you can use the binaries located in the expanded folder, such as
bin/arm-none-eabi-gcc, when invoking it you can reference it directly or set
$PATH.
- stlink contains st-util to use gdb on the Discovery, and st-flash to write / read the flash memory on the Discovery.