Example of building a STM32 project using nob.h. It is based on this project where I did the same using bash.
gcc mk.c -o mk
./mkYou can install the ARM GNU Toolchain either locally (for this project only) or system-wide. Choose the method that best fits your needs:
- Download the official ARM GNU Toolchain:
wget https://developer.arm.com/-/media/Files/downloads/gnu/14.3.rel1/binrel/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz- Extract the toolchain in your project directory:
tar -xf arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz- Use the binaries by specifying their path in your build scripts or by temporarily adding them to your PATH:
export PATH="$PWD/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin:$PATH"- Create installation directory:
sudo mkdir -p /opt/arm-gnu-toolchain-14.3.rel1- Extract the toolchain to
/opt:
sudo tar -xJf arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz -C /opt/arm-gnu-toolchain-14.3.rel1 --strip-components=1- Add the toolchain to your PATH (append to
~/.bashrc):
echo 'export PATH=/opt/arm-gnu-toolchain-14.3.rel1/bin:$PATH' >> ~/.bashrc
source ~/.bashrcRun the following command to check the toolchain is available:
arm-none-eabi-g++ -v