|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Directories | |
| src | |
Demonstrates the Flash Translation Layer (libs/ra8_ftl) end to end over the RA8D2's on-chip extra MRAM – a non-volatile, erase-before-write medium programmed through the MACI command sequencer (#258). The FTL turns that into a clean free-overwrite block device and spreads wear by relocating every logical-block write to a fresh, least-worn physical block (copy-on-write).
The window is a couple of dozen 512-byte blocks. The demo hands the FTL all but the last, presents a smaller set of logical blocks so the remainder is relocation headroom, and reserves that last physical block as a non-volatile slot for the mapping checkpoint. The FTL never touches the reserved block; the demo erases and programs it directly through the raw block device.
ra8_ftl stores only user data in each physical block – there is no per-block logical-address tag on the medium – so the logical-to-physical map cannot be reconstructed from the data alone once the volatile tables are lost. The minimal persistent metadata for survival is therefore an explicit, versioned checkpoint of the mapping tables in a caller-chosen non-volatile block. The checkpoint blob is architecture-local (native layout), so it is always restored on the same device that wrote it.
A bench run. Off-target the MACI program/erase sequence is modelled and the MRAM retains its bytes for the whole run, so the in-process "power cycle" – drop SRAM state, keep MRAM – is a faithful model of a real reset. Both the programming and the retention-across-reset it depends on are therefore emulator-proven and silicon-unverified.