Home - Vegethalia/Esp32Projects GitHub Wiki
https://docs.platformio.org/en/latest/platforms/espressif32.html
The ESP by default only allows programs (sketchs) with a size lesser than 1.3mb. This is because the 4MB of data are partitioned roughly like: This is: 1.3Mb(app0) + 1.3Mb(app1) + 1.5Mb(spiffs) + other app1 is used for OTA updates. If you are not going to use OTA, one can eliminate this partition and enlarge app0/spiffs (see official info) For instance, to have a 2Mb app0 and spiffs partitions use the no_ota.csv predefined partition.
**no_ota.csv example**
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x200000,
spiffs, data, spiffs, 0x210000,0x1F0000,
To use the custom partition:
Create "partitions_custom.csv" with the contents of no_ota.csv (for instance) in the root of project directory, and add in the platformio.ini:
[env:custom_table]
board_build.partitions = partitions_custom.csv
Execute esptool.py from a terminal (or [PIO Terminal]), cd into the path for esptool.py (usually C:\Users<user>.platformio\packages\tool-esptoolypy) and execute it:
PS C:\Users\PChan\.platformio\packages\tool-esptoolpy> python esptool.py --port COM5 flash_id
esptool.py v2.6
Serial port COM5
Connecting........_____.
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 24:62:ab:c9:88:94
Uploading stub...
Running stub...
Stub running...
Manufacturer: 5e
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
See official info
- Create a /data folder in the project root (same level as /src) and put there all files that you want to be uploaded to SPIFFS partition
- From a pio terminal run
pio run -t uploadfs
. The whole partition will be created with the contents of the /data folder and will be uploaded into the ESP32
Building SPIFFS image from 'data' directory to .pio\build\az-delivery-devkit-v4\spiffs.bin
/myfile.txt
Looking for upload port...
Auto-detected: COM5
Uploading .pio\build\az-delivery-devkit-v4\spiffs.bin
esptool.py v2.6
Serial port COM5
Connecting........_____.....__
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 24:62:ab:c9:88:94
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 2031616 bytes to 3814...
Writing at 0x00210000... (100 %)
Wrote 2031616 bytes (3814 compressed) at 0x00210000 in 0.2 seconds (effective 91308.5 kbit/s)...
Hash of data verified.