I’d like to have a web flasher for firmware I made and have the user be able to set a user variable before flashing. I don’t want to have to recompile to insert this new hardcoded info since this is happening on a little web flasher page. Is there any way to do this ? I know about using WiFiManager to add custom vars during runtime but this isn’t an option because it’s an espidf project. I also had the idea of flashing a file to the filesystem but I don’t know how to accomplish that. I though that if I reserve plenty of space in the firmware for hardcoded value then I could do some sort of strings replace on the binary file somehow. Is this even possible ? thanks.
Modifying the final binary image is not a good idea.
Using a filesystem with configuration files is a much better apporach.
There are examples available on how to do it:
You seem to be correct. All of my attempts to modify the binary image cause a reboot loop in the esp32. Even when I am only modifying a string that fits inside of the original placeholder string. Is there some sort of checksum that the esp32 uses to verify the binary has not been modified since compile time ?
This requires very extensive background knowledge.
Even if it is possible to edit the firmware.bin manually, it is not worth the effort.
Actually it’s not that hard. Somebody on reddit wrote a script to correct the checksum and now it works perfectly ! https://www.reddit.com/r/esp32/comments/1e86eqd/altering_a_binary_image_for_flashing/