espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.34k stars 1.56k forks source link

Missing option to generate and flash external spiffimg (GIT8266O-833) #1257

Open Asanga-Viraj opened 1 year ago

Asanga-Viraj commented 1 year ago

In IDF for ESP32, there is an option to generate external project folder into spiffimg.bin and flash it to ESP32 chip. Can use following line in cmakelist.txt inside the main.c folder.

spiffs_create_partition_image(storage ../data FLASH_IN_PROJECT)

ESP8266, this command is not working and I couldn't find any option to do it. Is there a way exists?

praveens-git commented 7 months ago

Are there any updates on this?

AMKrol commented 7 months ago

I don't see any similar function in SDK, but...

You can use a mkspiffs project.

  1. All its need is to compile the project with the parameters:

    make dist CPPFLAGS="-DSPIFFS_OBJ_NAME_LEN=32 -DCONFIG_SPIFFS_META_LENGTH=4 -DSPIFFS_USE_MAGIC=1 -DSPIFFS_USE_MAGIC_LENGTH=1 -DSPIFFS_ALIGNED_OBJECT_INDEX_TABLES=4" BUILD_CONFIG_NAME=-custom
  2. Next create the partition image from files in directory (e.g. data folder)

    ./mkspiffs -p 256 -b 4096 -s 458752 -d 5 -c ./data ./spiffs.bin
  3. Upload image to the ESP8266 to data storage partition:

    esptool.py --port /dev/ttyUSB0 write_flash 0x90000 /app/spiffs.bin