Firmware Development
Languages, startup, linking, bootloaders, drivers, DMA and the tools to debug firmware.
This is an overview — pick a sub-topic below.
Sub-topics (22)
C for Embedded Systems
The main firmware language: direct register access, predictable output, tiny runtime.
C++ for Embedded Systems
Modern C++ adds type safety and zero-cost abstractions to firmware.
Embedded Rust
Rust brings memory safety without garbage collection to microcontrollers.
Startup Code
The code that runs before `main`: sets the stack, copies initialised data from flash to RAM, zeroes `.bss`, configures clocks.
Linker Scripts
Tell the linker where each section goes in memory.
Memory Sections
`.text` (code), `.rodata` (constants), `.data` (initialised globals, copied to RAM), `.bss` (zeroed globals), heap and stack.
Bootloaders
A small program at the start of flash that decides whether to run the application or update it.
Firmware Updates
Replace firmware safely in the field.
OTA Updates
Over-the-air firmware updates via Wi-Fi, BLE or cellular.
HAL (Hardware Abstraction Layer)
Vendor or custom APIs that hide register details: `HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);`.
BSP (Board Support Package)
Code that adapts software to a specific board: pin assignments, clocks, external chips, memory.
Device Drivers
Code that operates a peripheral or external chip through a clean API.
Register-Level Programming
Configure peripherals by reading and writing their registers directly.
DMA (Direct Memory Access)
A hardware engine that moves data between peripherals and memory without the CPU.
Interrupt Service Routines in Practice
Keep ISRs short: clear the flag, capture data, set a flag or push to a queue, return.
Fixed-Point Arithmetic
Represent fractions with integers scaled by a power of two — fast on MCUs without an FPU.
MISRA C and C++
Safety-critical coding guidelines (MISRA C:2023, MISRA C++:2023).
CERT C
SEI CERT secure coding standard for C — rules to prevent vulnerabilities.
Static Analysis for Firmware
Find bugs without running code: buffer overflows, null dereferences, MISRA violations.
JTAG
A standard debug and test interface (IEEE 1149.1) using TCK, TMS, TDI, TDO pins.
SWD (Serial Wire Debug)
ARM's two-pin debug interface (SWDIO, SWCLK) — the usual way to flash and debug Cortex-M chips.
GDB Debugging for Firmware
Debug the target with GDB via OpenOCD, pyOCD or J-Link GDB Server.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.