espwebtool icon indicating copy to clipboard operation
espwebtool copied to clipboard

Example of flashing custom config file to flash ?

Open tavdog opened this issue 1 year ago • 1 comments

I would love to use your tool to flash firmware and also allow a user to add custom config data by selecting a text or json file or something. Is there any example of how to do this ?

tavdog avatar Dec 18 '24 10:12 tavdog

I use littlefs for my project so I can use this as a good example. This should apply to all similar partition with SPIFS.

For littlefs, You can use littlefs-python to create the binary image of all the files in a folder. The block size should be 4096 and the fs-size is what is defined in the partition file. In the partition csv file, define this partition. In your app_main.c, mount and use the data as you wish.

After that, you can either combine all binary files into one with esptool.py to flash it from address 0x0 or flash binary files with according address.

Or if you want to get fancy, you can convert the data binary to C with xxd, store it as a const and write to the partition with the API partition_write or something (it may be sightly different as it's from my memory).

However, it would be much much more difficult to do everything like this within only espwebtool than above. Just image the parameters that user needs to input along with so many possibilities, which makes this request out of the scope of this project IMHO.

ONLYA avatar Sep 03 '25 11:09 ONLYA