ARM

This article is not about Linux running on ARM.

Building with crossdev
If nanolib, hardfloat and C++ support are not important, you may proceed to building.

Enable C++ support
C++ support can be enabled with the  USE flag in both  and  packages.

Enable nanolib support
Support for the nano library exists as part of since at least version   by use of the   USE flag.

Enable hardfloat support
This is a bit tricky. One way to enable it, supposing the target processor has an FPU unit, is the following.

Analyzing the above command, the previous -none- part has been replaced with -hardfloat-.

As for the EXTRA_ECONF flags, they were copied from a file found in the ARM toolchain source's root or the following path for the pre-built version:. Here are the contents of the for convenience:

You may now proceed to writing code.

Building
The simplest command to build a toolchain is:

Using the pre-built one
A pre-built toolchain is the GNU Arm Embedded Toolchain. Remember to update your  by prepending the location of the toolchain's bin folder:

Error message: .... uses VFP register arguments ... does not
This probably means that some of the libraries being linked, were compiled with   while others with   or. This can also happen when the compiler was compiled in an opposite to the code manner.

Error message: undefined reference to `__stack_chk_guard'
In the case of compilation errors like, make sure the   USE flag was not enabled for.

Using Mbed
Mbed is an online platform for writing and compiling code for various boards. It has an export function that enables retrieving the said code including a and the imported libraries.

Missing mbed_config.h
If compilation fails with a missing file,  needs to be adapted with a point to the root folder's  file.

Using STM32CubeMX
STM32CubeMX can be used to initialize code. In provides a graphical user interface to choose pin modes and clocks.

Using pre-built toolchain's samples
The pre-built GNU Arm Embedded Toolchain, comes with code samples and s.

External resources

 * 1) Embedded Artistry explains the difference between ,   and   (the three ARM floating point compiler options).
 * 2) Discussion on the problems enabling hardfloat.
 * 3) Another similar discussion in the Gentoo forums.