Skip to content

F0067 mem-1

Rule: The FLASH region of memory.x leaves out the regions kept for other uses.

Code F0067 (stable, never reused)
Id mem-1
Category mem
Source spirit_level
Fix by hand

Level per tier

Tier Level Reason
small off
small-workspace off
medium off
big off
ai off
embedded deny bedrock error: FLASH length in memory.x covers a region kept for something else (settings, bootloader state, DFU): the image can grow into it
ui off
egui off
units-strict off
units-paranoid off

Why

memory.x's FLASH region sized so the application image can grow into flash that's actually reserved for settings, the bootloader, or the DFU slot.

The linker only enforces the region it's told about; if FLASH is sized too generously, an image that grows past its intended boundary links successfully and overwrites the next region's first bytes at flash time instead of failing the build.

Example

Usb_io_fw PLAT-13/PLAT-15: the application region overlapped space meant for settings and bootloader state.

How to fix

Regenerate memory.x from the current flags rather than hand-editing region lengths; if hand-edited, match the generator's partition order (BOOTLOADER, FLASH, BOOTLOADER_DFU, SETTINGS).

How it is checked

cfg mid: recompute the partition table from memory-layout.md's rules (flash base, sector sizes, --bootloader/--settings flags) and compare against the FLASH length actually in memory.x.

Source

Ported from embedded_bedrock's firmware check catalogue, MEM-1 (book/checks.md, detail in book/checks/mem.md). Found on: usb_io_fw PLAT-13/15.

Configure

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

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