I managed to get the parameters by installing the arduino-esp32fs-plugin.
First need to find where to put the plugin. This is on a Raspberry Pi 4.
Arduino IDE -> File -> Preferences -> Sketchbook location
which is /home/pi/Arduino
Download the plugin and put it in:
/home/pi/Arduino/tools/ESP32FS/tool/esp32fs.jar
restart the Arduino IDE, load the LITTLEFS_test example and save it to a suitable location, e.g.:
/home/pi/dev/esp32/LITTLEFS_test/LITTLEFS_test.ino
/home/pi/dev/esp32/LITTLEFS_test/partitions.csv
then create a data directory and file with some content in the sketch directory:
/home/pi/dev/esp32/LITTLEFS_test/data/test.txt
then in the Arduino IDE:
Tools -> ESP32 Sketch Data Upload
choose LittleFS
and OK
.
The required data is then in the output window of the Arduino IDE:
[LittleFS] data : /home/pi/dev/esp32/LittleFS_test/data
[LittleFS] offset : 0
[LittleFS] start : 2162688
[LittleFS] size : 1856
[LittleFS] page : 256
[LittleFS] block : 4096
I added some debug output to the plugin, compiled it and put it in the Arduino IDE to come up with a commandline version. Note that the size
parameter in the Arduino IDE output window is divided by 1024
, so need to multiply it by 1024
for the commandline version:
/home/pi/.arduino15/packages/esp8266/tools/mklittlefs/3.0.4-gcc10.3-1757bed/mklittlefs -c ./data2 -p 256 -b 4096 -s 1507328 spiffs.bin
installing esptool:
pip install esptool
and adding more debug output to the plugin gave me the commandline for uploading the littlefs image:
python -m esptool --chip esp32 --baud 921600 --port /dev/ttyUSB0 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 2686976 spiffs.bin