-->
Page 1 of 1

Process of programming binary file with SPIFFS

PostPosted: Wed Sep 28, 2016 9:01 pm
by fd1
I am using ESP8266 Arduino with SPIFFS to store configuration settings.

This command is used for flashing the binary firmware.bin into ESP8266 for Arduino.
esptool.exe -cd nodemcu -cb 115200 -cp COM3 -ca 0x00000 -cf firmware.bin

This command is used for flashing the binary firmware.nin into ESPP8266 using the SMING framework.

esptool.exe -p COM3 -b 115200 write_flash -ff 40m -fm dio -fs 4m 0x00000 0x00000.bin 0x09000 0x09000.bin 0x44000 spiff_rom.bin

There are some puzzling aspects in the command used for Arduino flash download.
- Why isn't there a separate bin file for SPIFFS for Arduino? I noticed the tool "mkspiffs.exe" in esp8266\tools\mkspiffs folder is not used during compilation of the bin file. Why is it not used?
- How does Arduino esptool know which address to use for allocating to SPIFFS file system address?

I would like to understand the process of programming binary file as I encountered strange behavior with SPIFFS. See related thread viewtopic.php?f=32&t=11949

Can someone help? Thank you very much.

Re: Process of programming binary file with SPIFFS

PostPosted: Thu Sep 29, 2016 8:16 am
by martinayotte
mkspiffs is only used to produce file system binary, it doesn't need to be aware of the location of that file.
Only esptool need to be aware of that location during compile, and this location is determined by the menu option where you choose the Flash size and SPIFFS size, toggling between the LD script use by the linker (see esp8266/hardware/esp8266/2.3.0/tools/sdk/ld)

The issue that you've faced in the other thread is not related to SPIFFS, but simply a badly buffer initialization where you try to use strcat() with unknown string length.