F0020 firmware-readable¶
Rule: Every file of a firmware crate that the embedded lints read can be read.
| Code | F0020 (stable, never reused) |
| Id | firmware-readable |
| Category | embedded |
| 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 |
a firmware file the embedded lints cannot read hides every finding in it |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
The embedded lints read a firmware crate's memory.x, bedrock_fw.json, .cargo/config.toml, build.rs, its Rust sources and the ELF given with --elf. A file they cannot read (a syntax error, JSON that does not parse, a memory.x without a MEMORY block, a file that is not a 32-bit ELF) gives them nothing to look at: every lint that needs it finds nothing in that crate, and the run would look clean.
Example¶
A memory.x whose MEMORY block lost its closing brace: siz-1, stk-3 and mem-1 have no regions to measure and say nothing; this lint names the file instead.
How to fix¶
Fix the file the finding names, or pass the right ELF with --elf target/<triple>/release/<name>.
Source¶
bedrock_lint printed these as loader notes beside its report; spirit_level reports them as findings so a deny level can fail the run.
Configure¶
Allow one finding in the code with // spirit-level: allow(firmware-readable) <reason> (waivers); the code works there too, as in [lints.F0020].