It's not the clean, OS-mediated segfault you'd get on a desktop. Accessing an address that has no memory or peripheral behind it raises a BusFault, which (if not separately enabled and handled) escalates to a HardFault, the MCU's catch-all fault exception. A null-pointer dereference is interesting: address 0x0000_0000 is usually mapped (it aliases flash or the vector table), so *(int*)0 reads a valid-but-wrong value or, on a write, may fault or silently corrupt depending on whether that region is writable, so null derefs aren't guaranteed to crash cleanly, which makes them sneaky on bare metal. The practical implications: stray pointers and wrong peripheral base addresses show up as HardFaults rather than silent garbage, you debug them by inspecting the fault status registers (in the SCB) and the stacked PC to find the offending instruction, and you can use the MPU to turn specific illegal accesses (like a null region) into deterministic faults. The absence of an OS means you are the only safety net.
Embedded Systems Fundamentals · Interview question
What happens if you dereference a null pointer or access an unmapped address on a Cortex-M?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
The Memory Map
Why code lives at 0x08000000 and variables at 0x20000000: the Cortex-M address layout of flash, SRAM, and peripherals, and how stack and heap share the SRAM with no MMU to referee.