Tag

Firmware Debugging

Technical notes tagged Firmware Debugging.

2026-12-04

Cortex-M Unaligned Access Faults: Why a Cast Packed-Struct Parser Crashes on LDRD, and How to Fix It

A protocol parser that works for months then raises a UsageFault or HardFault on a 4-byte-aligned-looking buffer: which Cortex-M instructions tolerate unaligned addresses, which never do, and safe ways to read wire data.

→
2026-12-03

cortex-m-fault-decoder: From a HardFault Dump to the Cause, and How to Fork It

An open-source tool that turns CFSR, HFSR, fault addresses and the stacked frame into a plain-language cause. How it works, how it was tested on a real STM32F401, and how to run, fork and extend it.

→
2026-12-03

Cortex-M Bootloader to Application Jump: What to Reset When the App Crashes Only Sometimes

A bootloader jump that works on the bench but HardFaults or hangs now and then is usually leaking state: SysTick, pending interrupts, PRIMASK, VTOR. A checklist and a tested jump routine.

→
2026-12-02

STM32H7 DMA Buffers in DTCM: Why Transfers Fail and How to Fix the Linker Script

DMA1/DMA2 on STM32H7 cannot reach DTCM, yet default linker scripts often put .bss, the heap and the stack there. How to recognise it, prove it, and place DMA buffers correctly.

→
2026-12-01

STM32 UART Reception with DMA and IDLE Line Detection: Variable-Length Data Without Losing Bytes

How to receive variable-length UART frames on STM32 with circular DMA and IDLE line detection: register-level setup on STM32F4, the HAL ReceiveToIdle API, wrap-around handling, and the pitfalls that drop bytes in production.

→
2026-06-01

STM32 Timer Input Capture: Measuring Frequency and Duty Cycle at Register Level

A practical STM32 firmware guide to timer input capture: single/dual-channel frequency and duty-cycle measurement, register-level configuration, overflow handling, and real-world pitfalls on STM32F4 and G4.

→
2026-05-27

ESP-IDF 6.x I2C Master Driver: Migrating Without Hiding Bus Faults

A practical embedded firmware guide to the ESP-IDF I2C master bus/device driver, register reads, NACK handling, timeouts, and migration from legacy I2C code.

→