This package implements (parts of) the esp serial flasher protocol
For simple usage from an ESP32 host, to flash another ESP32 host:
import esp_serial_flasher show *
BLOCKSIZE ::= 0x1000
// blocks is a list of bytearrays of size BLOCKSIZE
flash offset/int blocks/List gpio0 en rx tx:
flasher := Flasher --host=(Esp32Host --gpio0_pin=gpio0 --enable_pin=en --rx_pin=rx --tx_pin=tx)
target := flasher.connect
image_flasher := target.start_flash offset blocks.size*BLOCKSIZE BLOCKSIZE
blocks.do: image_flasher.write it
If special host control is needed, implement the HostAdapter
To speed up the flash, change the baud rate with Target.change_baud_rate