Check a layout and write its table
Check a layout
$ nanoflash layout check layouts/esp32-s3-8mb.toml
flash 8 MiB (0x800000), unallocated 4 KiB
name role offset end size image headroom
bootloader bootloader 0x0 0x8000 32 KiB - -
partition-table partition-table 0x8000 0x9000 4 KiB - -
nvs custom 0x9000 0xf000 24 KiB - -
application firmware 0x10000 0x310000 3 MiB - -
storage storage 0x310000 0x800000 5056 KiB - -
The command exits with 1 and names the partitions and the addresses when the layout has an error.
See the headroom of an image
Pass the image of a partition:
$ nanoflash layout check layouts/esp32-s3-8mb.toml --image application=build/application.bin
Or check every image that a manifest writes:
$ nanoflash layout check --manifest boards/esp32-s3.toml
Without a layout file, --manifest checks the layout of the board of the manifest. Add
--board-identifier when its boards use different layouts. In a Cargo package with
[package.metadata.nanoflash], nanoflash layout check alone checks the layout of that board with
its images.
An ELF file or an Intel HEX file is accepted as an image too. mise run example uses
nanoflash layout check --image application=<ELF file> to check that the firmware starts at the
offset of its partition and fits its size.
Preview a larger chip
A layout with size = "detect" is checked for its minimum flash size. To see the layout on a
larger chip, pass --flash-size:
$ nanoflash layout check layouts/esp32-s3-detect.toml --flash-size "8 MiB"
flash 8 MiB (0x800000), minimum 4 MiB (0x400000), unallocated 60 KiB
name role offset end size minimum growth image headroom
...
storage storage 0x320000 0x800000 4992 KiB 0 B +4992 KiB - -
Images are still checked against the partition sizes on the minimum flash, as flash does. A
fixed layout refuses --flash-size, and so does a size below the minimum.
Get JSON for a script
Add --json for one JSON document with the same data.
Write the table
$ nanoflash layout write layouts/esp32-s3-8mb.toml --format espressif --output partition-table.bin
--format is espressif, mbr, linker or constants. Layout
file describes each output. flash writes the
Espressif table by itself, so you need this command only to give the table to another tool.