How much space do I need to leave at the end of a partition?
Posted: Mon Jul 21, 2025 11:53 pm
I'm flashing a bin to a nvs partition called 'mfg'.
I discovered (after much head bashing) that I cannot flash a bin to a partition that is the size of the partition. Otherwise you get a ESP_ERR_NVS_NO_FREE_PAGES error when you try to init the partition.
My partition table looks like this:
Right now I'm writing a 0x1000 byte bin to the mfg partition.
But what I'd like to do is size a mfg partition with 0x1000 bytes and write a smaller bin to that partition as I only need to write a couple small strings.
So my question is: what is the minimum amount of blank space I need to leave at the end of a partition?
Or, with a partition sized at 0x1000 bytes, what is the maximum size of the bin I can flash to that partition?
P.S. is that the correct way to have both readonly and encrypted flags set on a partition?
I discovered (after much head bashing) that I cannot flash a bin to a partition that is the size of the partition. Otherwise you get a ESP_ERR_NVS_NO_FREE_PAGES error when you try to init the partition.
My partition table looks like this:
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
mfg, data, nvs, 0xE000, 0x2000, readonly,encrypted
nvs, data, nvs, , 0x4000,
nvs_key, data, nvs_keys, , 0x1000,
phy_init, data, phy, , 0x1000,
otadata, data, ota, , 0x2000,
factory, app, factory, , 2M,
ota_0, app, ota_0, , 2M,
ota_1, app, ota_1, , 2M, But what I'd like to do is size a mfg partition with 0x1000 bytes and write a smaller bin to that partition as I only need to write a couple small strings.
So my question is: what is the minimum amount of blank space I need to leave at the end of a partition?
Or, with a partition sized at 0x1000 bytes, what is the maximum size of the bin I can flash to that partition?
P.S. is that the correct way to have both readonly and encrypted flags set on a partition?