
Write a GNU ld Linker Script for an STM32 From Scratch
Write a complete GNU ld linker script for an STM32F407: MEMORY regions, vector table, .text, .data with AT>, .bss, heap and stack reserve, and link-time checks.
GCC, LLVM and Clang, the ARM GNU toolchain, linkers and linker scripts, ELF, cross-compiling, Make, CMake, Meson and Bazel, and writing a compiler of your own.

Write a complete GNU ld linker script for an STM32F407: MEMORY regions, vector table, .text, .data with AT>, .bss, heap and stack reserve, and link-time checks.

Build a Quartus Prime Lite 23.1 project for a Cyclone IV E board from the command line with a QSF file, an SDC clock constraint, quartus_sh and quartus_pgm.

Learn the difference between = and := in GNU Make, when ?= and += fit, and how a recursive variable can silently run a shell command many times.

Define bytes, words, strings, floats, arrays and zeroed buffers in NASM with db, dw, dd, dq, the res family and times, with exact little-endian layouts.

Replace the vendor assembly startup file with one C file for a Cortex-M4: vector table, weak aliases, data copy, bss clear and the GCC flags that keep it safe.

Build a bitstream for an Artix-7 board in Vivado 2024.1 with a non-project Tcl script, an XDC constraint file, implementation and write_bitstream.

Declare clean, all and test as .PHONY so a file with the same name cannot stop them, and learn phony prerequisites, subdirectory loops and force rules.

Assemble a GNU as source file on Linux x86-64 and link it three ways: with ld as a freestanding program, with gcc and libc, and with gcc driving as itself.

Learn the Cortex-M vector table layout: system entries, device IRQs, the Thumb bit, how VTOR finds the table, and why it must sit at the start of flash.

Replace one rule per source file with a single %.o: %.c pattern rule, add automatic header dependencies with -MMD, and know when make's built-in rule is enough.

Build the same NASM program two ways on Linux x86-64: a freestanding _start binary linked with ld, and a main function linked with gcc against libc.

Build an STM32F4 blinky with no HAL: one C file, a short linker script, a vector table and the arm-none-eabi-gcc commands that produce a flashable binary.
We send one email when a new post is published. No spam.