mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-18 07:44:21 +01:00
Sphinx Key Factory App
The main function of this app is to write any update.bin files from the sd card to the flash of the ESP, and configure the ESP so that on the next boot, it boots the freshly written app.
Background Reading
- Partition Tables: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-guides/partition-tables.html
- Over-the-Air Updates: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/ota.html
Flashing factory and sphinx-key
- First flash the factory app here using the usual
espflashcommand, but add the--partition-tableflag and point it totable.csvhere. Seeespflash -hfor more info. - Then use
esptool.pyto flash the sphinx-key binary at offset0xc0000. - Finally use this command to tell the ESP to boot the sphinx-key binary first ( there is no update to write to the ESP yet, so we don't boot the factory app ):
otatool.py switch_ota_partition --slot 0