litechniks
litechniks

Reputation: 11

How to properly download SPIFFS bin by using mkspiffs and esptool

I am working on an application generator tool for esp8266 devices and cannot use properly the mkspiffs and esptool tools.

I have read the available documentation for mkspiffs and esptool, also enabled the verbose output in the Arduino IDE to see how Arduino IDE uses these programs work but still couldn't make it work properly.

In the ESP Core documentation there is some info about the address map (https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html) but I am not sure how to properly set build parameters according to this.

My goal is to upload an application binary and a 1M SPIFFS binary on a 4M flash size device.

This is where I am right now:

All of these commands run and return with 0 so seem to be OK.

The application on the ESP8266 runs properly, the SPIFFS mounts but none of the files are found by the application running on the ESP8266. How can I properly do this?

Upvotes: 1

Views: 2673

Answers (1)

ANAU designs
ANAU designs

Reputation: 1

Here is a suggestion/remark (finding your post 4 years later...), as it does not yet give a solution, but highlights something surprising. Note that this remark comes from the *nix usage, might differ on your platform, but maybe not, I do not have any Microsoft Windows to try.

When you build the application with arduino-cli, the parameter --build-path expect a directory to put all the build'ing files, including the "final" binary, which should be C:\app_output.bin\<your_application_ino_filename>.bin.

Then in esptool.exe --port COM1 --baud 512000 write_flash 0x000000 app_output.bin 0x300000 spiffs_output.bin your should have C:\app_output.bin\<your_application_ino_filename>.bin instead of app_output.bin something more like that (again, this is how it would work under *nix):

esptool.exe --port COM1 --baud 512000 write_flash 0x000000 C:\app_output.bin<your_application_ino_filename>.bin 0x300000 spiffs_output.bin

A note you can only flash the SPIFFS data with:

esptool.exe --port COM1 --baud 512000 write_flash 0x300000 spiffs_output.bin

This is where I do not get your remark, maybe the command simply fails and the core is running the previously flashed binary... this is surprising anyhow.

Maybe try to wipe the entire flash memory prior to anything

esptool.exe --port COM1 erase_flash

Upvotes: 0

Related Questions