diff --git a/components/platform/partitions-2MB.csv b/components/platform/partitions-2MB.csv index 957f28b5..62b9b45f 100644 --- a/components/platform/partitions-2MB.csv +++ b/components/platform/partitions-2MB.csv @@ -1,7 +1,7 @@ -# Espressif ESP32 Partition Table +# Espressif ESP32 Partition Table for 2MB flash # Name, Type, SubType, Offset, Size nvs, data, nvs, 0x9000, 0x6000 phy_init, data, phy, 0xf000, 0x1000 -factory, app, factory, 0x10000, 1M +factory, app, factory, 0x10000, 0x180000 # 0xC2 => NodeMCU, 0x0 => Spiffs -spiffs, 0xC2, 0x0, , 960K +nodemcuspiffs, 0xC2, 0x0, , 0x70000 diff --git a/components/platform/partitions.csv b/components/platform/partitions.csv new file mode 100644 index 00000000..cead9a3b --- /dev/null +++ b/components/platform/partitions.csv @@ -0,0 +1,5 @@ +# Espressif ESP32 Partition Table for 2MB flash +# Name, Type, SubType, Offset, Size +nvs, data, nvs, 0x9000, 0x6000 +phy_init, data, phy, 0xf000, 0x1000 +factory, app, factory, 0x10000, 0x180000 diff --git a/docs/en/build.md b/docs/en/build.md index 3294f9ce..16615591 100644 --- a/docs/en/build.md +++ b/docs/en/build.md @@ -92,9 +92,9 @@ Serial flasher config ---> ``` ### Partition Table -It is not required to set a custom partition table. Per default the IDF will select `Single factory app, no OTA` and the firmware will create a partition for SPIFFS automatically which fills the remaining flash space. +IDF's default partition table `Single factory app, no OTA` does not provide enough room for a firmware including large modules like e.g. `http` or `sodium`. To enable full feature sets, NodeMCU uses a custom partition table from `components/platform/partitions.csv` which allocates ~1.5 MB for the firmware image. During first boot, the firmware creates an additional partition for SPIFFS in the remaining flash space. -There is a template partition table available in `components/platform/partitions-2MB.csv` locates the SPIFFS partition at a fixed location. The file can be used as a template for custom partition tables with menuconfig: +For 2MB flash modules an alternative partition table available as `components/platform/partitions-2MB.csv`. It restricts the SPIFFS partition to ~448 kB and can be used with menuconfig: ``` Partition Table ---> diff --git a/sdkconfig.defaults b/sdkconfig.defaults index cfbf171b..4b70ba78 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -1,3 +1,7 @@ +# set custom partition table for 1.5MB firmware +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="components/platform/partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="components/platform/partitions.csv" + # Don't warn about undefined variables CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=n