AgonConsole8 / agon-vdp

Official Firmware for the Agon Console8: ESP32 VDP
MIT License
43 stars 17 forks source link

Add updater to receive firmware via UART serial link from ez80. #69

Closed astralaster closed 1 year ago

astralaster commented 1 year ago

This code leverages the ESP32 OTA functions to enable the ez80 to upload VDP firmware binaries. They get written to a second partition on the ESP32 flash and then the bootselector gets changed to this partition and the ESP32 restarts itself. Another great feature is switching between two VDP versions without uploading anything new, just by changing the bootselector.

For safety reasons this module contains a knockcode. You first have to send a specific byte sequence to unlock it. Otherwise it would be possible to switch the bootselector by accident. The firmware upload is already secured by a mandatory checksum, but better be safer. :)

Current commands: VDU 23 29 0 117 110 108 111 99 107 unlocks the updater. Code is "unlock". VDU 23 29 1 <24bit filesize> <n data bytes> <single byte checksum> To upload a firmware binary. VDU 23 29 2 to toggle between the two partitions.

This can be now used with the official agon-flash tool: https://github.com/envenomator/agon-flash

stevesims commented 1 year ago

This PR got merged in upstream - yay :grin:

A subsequent PR with the suggested changes from the discussion above has been raised here as #73 and upstream as breakintoprogram/agon-vdp#126