Skip to content

Toolchain ​

The bootcamp builds with the free Arm GNU toolchain and a Makefile, and flashes with lm4flash. There is no IDE and no vendor library: registers are written through the CMSIS device header, in struct style (GPIOF->DATA), exactly as the datasheet names them.

Install ​

bash
brew install --cask gcc-arm-embedded
brew install lm4tools clang-format
bash
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi lm4flash clang-format
bash
yay -S arm-none-eabi-gcc arm-none-eabi-newlib lm4flash clang

On macOS the cask installs to /Applications/ArmGNUToolchain/<version>/ without adding it to PATH; the starter's Makefile finds the newest version there by itself. The LaunchPad's debugger needs no USB driver on macOS or Linux.

Get the starter project ​

bash
git clone https://github.com/mabushelbaia/tiva-c-bare balance-bot
PathWhat it is
Makefilemake, make flash, make size, make format, make clean
linker.ldThe TM4C123GH6PM memory map: 256 KB flash, 32 KB SRAM
device/CMSIS register headers, the vector table (startup_TM4C123.c) and SystemInit
src/main.cYour program. It starts as a blink example

Plug the LaunchPad's DEBUG USB port in, power switch on DEBUG, then:

bash
make flash

Check: the LED blinks. make info prints which compiler and C library the build used.

Common problems
SymptomCause and fix
arm-none-eabi-gcc: command not foundThe toolchain isn't on PATH and the Makefile didn't find it. Run make TOOLCHAIN_DIR=/path/to/bin
lm4flash: Unable to find any ICDI devicesThe cable is in the DEVICE port, or the switch is on DEVICE. Use DEBUG for both
undefined reference to memcpy or snprintfThe toolchain has no newlib (Homebrew's arm-none-eabi-gcc formula). Install the Arm cask instead

Balance Bot Bootcamp