Hello.
You can use esptool. Install it using pip Python package manager: `pip install esptool` or `pip3 install esptool` or `python -m pip install esptool`, depending on your system. In case you want to use virtual environment, please follow these instructions:
https://docs.espressif.com/projects/esp ... to-install.
Do you use arduino or esp-idf core in PlatformIO? Do you know how does the partition table looks like (sizes and offsets of partitions)?
This is how a partition table looks by default in ESP-IDF (your partition table will look different though):
Code: Select all
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 1M,
The bootloader has offset of 0x1000 and size of 0x7000 (usually), so the partition table should start at 0x8000. Other partition specified in the partition table can be placed at offset of 0x9000 and higher.
This is a command ESP-IDFs idf.py generates to flash hello_world example to the device:
Code: Select all
esptool.py --chip esp32 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
This is a partition table for LittleFS example in ESP-IDF :
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 1M,
storage, data, littlefs, 0x110000, 0xF0000,
And a command generated by idf.py flash to flash the LittleFS example:
Code: Select all
esptool.py --chip esp32 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 littlefs_example.bin 0x8000 partition_table/partition-table.bin 0x110000 storage.bin
So this is probably how the command you need to use would look like (I am omitting few flags which have some default value to make it more readable):
Code: Select all
esptool.py --chip <esp chip type> -p <port> write_flash 0x1000 <path to the bootloader .bin> 0x10000 <path to your application .bin> 0x8000 <path to the partition table .bin> 0x110000 <path to the littlefs partiton .bin>