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-formatbash
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi lm4flash clang-formatbash
yay -S arm-none-eabi-gcc arm-none-eabi-newlib lm4flash clangOn 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| Path | What it is |
|---|---|
Makefile | make, make flash, make size, make format, make clean |
linker.ld | The TM4C123GH6PM memory map: 256 KB flash, 32 KB SRAM |
device/ | CMSIS register headers, the vector table (startup_TM4C123.c) and SystemInit |
src/main.c | Your program. It starts as a blink example |
Flash the blink example
Plug the LaunchPad's DEBUG USB port in, power switch on DEBUG, then:
bash
make flashCheck: the LED blinks. make info prints which compiler and C library the build used.
Common problems
| Symptom | Cause and fix |
|---|---|
arm-none-eabi-gcc: command not found | The 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 devices | The cable is in the DEVICE port, or the switch is on DEVICE. Use DEBUG for both |
undefined reference to memcpy or snprintf | The toolchain has no newlib (Homebrew's arm-none-eabi-gcc formula). Install the Arm cask instead |