@@ -221,6 +221,30 @@ import machine
221
221
antenna = machine.Pin(16 , machine.Pin.OUT , value = 0 )
222
222
```
223
223
224
+ Partition table and filesystem size
225
+ -----------------------------------
226
+
227
+ ESP32 firmware contains a bootloader, partition table and main application
228
+ firmware, which are all stored in (external) SPI flash. The user filesystem
229
+ is also stored in the same SPI flash. By default, MicroPython does not have
230
+ a fixed entry in the ESP32 partition table for the filesystem. Instead it
231
+ will automatically determine the size of the SPI flash upon boot, and then --
232
+ so long as there is no existing partition called "vfs" or "ffat" -- it will
233
+ create a partition for the filesystem called "vfs" which takes all of the
234
+ remaining flash between the end of the last defined partition up until the
235
+ end of flash.
236
+
237
+ This means that firmware built for, say, a 4MiB flash will work on any
238
+ device that has at least 4MiB flash. The user "vfs" filesystem will then
239
+ take up as much space as possible.
240
+
241
+ This auto-detection behaviour can be overridden: if the ESP32 partition
242
+ table does contain an entry called "vfs" or "ffat" then these are used for
243
+ the user filesystem and no automatic "vfs" partition is added. This is
244
+ useful in cases where only the MicroPython ESP32 application is flashed to
245
+ the device (and not the bootloader or partition table), eg when deploying
246
+ .uf2 files.
247
+
224
248
Defining a custom ESP32 board
225
249
-----------------------------
226
250
0 commit comments