Skip to content

F0071 mem-3

Rule: The RAM init and zeroing ranges stay clear of .uninit.

Code F0071 (stable, never reused)
Id mem-3
Category mem
Source spirit_level
Fix by hand
Needs the firmware's linked ELF (--elf); skipped without a firmware binary

Level per tier

Tier Level Reason
small off
small-workspace off
medium off
big off
ai off
embedded deny bedrock error: RAM init or zeroing range overlaps .uninit (crash record, handoff data)
ui off
egui off
units-strict off
units-paranoid off

Why

The startup code's RAM-zeroing range (from init_ram.rs, per memory-layout.md's "every other RAM bank gets a NOLOAD section ... and zeroes it at boot") overlapping .uninit — the section that holds the crash record or handoff data across a reset.

.uninit exists specifically to survive a reset unzeroed; if the generic RAM-zero loop's address range includes it by accident, the crash record from the fault that just happened is wiped before the next boot can read and report it.

Example

Template 0.4: a bank-zeroing range computed from the RAM map's new layout started overlapping bedrock_crash's .uninit section in usb_io_fw's init_ram.rs until the ranges were split apart explicitly.

How to fix

Exclude .uninit's range from any generic RAM-zero loop; it's zeroed only by an explicit factory-reset path, never at every boot.

How it is checked

elf mid: read both the zeroing loop's address range (from the compiled init_ram.rs) and .uninit's linked address range, and check they don't intersect.

Source

Ported from embedded_bedrock's firmware check catalogue, MEM-3 (book/checks.md, detail in book/checks/mem.md). Found on: template 0.4 bedrock_crash vs usb_io_fw init_ram.rs.

Configure

[lints.mem-3]
level = "deny"
reason = "why this project wants it at this level"

Allow one finding in the code with // spirit-level: allow(mem-3) <reason> (waivers); the code works there too, as in [lints.F0071].