Skip to main content

ESP32 Flasher Functions

dev.wireless.esp32_flasher - wire path w\a - generated from fwMenuESP32Flasher.

enter_bootloader​

Connect To Bootloader. Instruct the ESP32 to enter into bootloader

Connect To Bootloader​

Drives the ESP32's BOOT and EN pins to put the target into ROM bootloader (download) mode and establishes a serial-loader sync over the UART. Once synced, this command is a prerequisite for all other flash/memory/register operations in this menu.

Argument​
  • upgrade_transmission_rate (decU32, baud)
    • Baud rate to switch to after a successful sync.
    • Initial sync always occurs at the default 115200 baud.
    • Pass 0 to keep the link at 115200.
    • Typical values: 230400, 460800, 921600.
    • Ignored on ESP8266 targets (not supported by ROM).
Returns​
  • success — true if the bootloader handshake (and optional rate change) completed.
Behavior​
  1. Toggle BOOT/EN to enter ROM download mode.
  2. Sync with the ESP loader at 115200.
  3. If upgrade_transmission_rate != 0, request the target to switch baud and reconfigure the host UART to match.
Typical Workflow​
b <baud> # Connect To Bootloader
i # Read Chip ID / security info
k # Read flash size
f ... # Start flash operations
o ... # Write flash data
p 1 # Finish flash, reboot
Troubleshooting​
  • Timeout — check wiring of EN, BOOT, TX, RX, GND.
  • Invalid target — chip or revision not supported by the loader build.
  • Invalid response at high baud — retry with 0 (stay at 115200) or shorter / better-quality wires.

Wire command: w\a\b

ArgWire type
upgrade_transmission_ratedecU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.enter_bootloader(upgrade_transmission_rate: int) -> Result
ow_status ow_wireless_esp32_flasher_enter_bootloader(ow_device* dev, int32_t upgrade_transmission_rate);
dev.wireless().esp32_flasher().enter_bootloader(upgrade_transmission_rate: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.enter_bootloader(upgrade_transmission_rate) # check dev.ok

enter_application​

Reset. Instruct the ESP32 to enter into application

Wire command: w\a\r

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.enter_application() -> Result
ow_status ow_wireless_esp32_flasher_enter_application(ow_device* dev);
dev.wireless().esp32_flasher().enter_application() -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.enter_application() # check dev.ok

get_i_dand_security​

Read Chip ID And Security Info. Toggle ESP32's Enable Pin

Wire command: w\a\i

Returns: esp_chip_id (decU32), version (decU32), sb_en (bool), sbar_en (bool), sdm_en (bool), sbrk_1 (bool), sbrk_2 (bool), sbrk_3 (bool), jtag_sw_dis (bool), jtag_hw_dis (bool), flash_enc_en (bool), dcache_dis (bool), icache_dis (bool)

dev.wireless.esp32_flasher.get_i_dand_security() -> Result
ow_status ow_wireless_esp32_flasher_get_i_dand_security(ow_device* dev, int32_t* esp_chip_id, int32_t* version, bool* sb_en, bool* sbar_en, bool* sdm_en, bool* sbrk_1, bool* sbrk_2, bool* sbrk_3, bool* jtag_sw_dis, bool* jtag_hw_dis, bool* flash_enc_en, bool* dcache_dis, bool* icache_dis);
dev.wireless().esp32_flasher().get_i_dand_security() -> Result<(i32, i32, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.get_i_dand_security() # returns value; check dev.ok

read_flash_size​

Read Flash Size. Toggle ESP32's Enable Pin

Wire command: w\a\k

Returns: flash_size_bytes (decU32)

dev.wireless.esp32_flasher.read_flash_size() -> Result
ow_status ow_wireless_esp32_flasher_read_flash_size(ow_device* dev, int32_t* flash_size_bytes);
dev.wireless().esp32_flasher().read_flash_size() -> Result<i32, OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.read_flash_size() # returns value; check dev.ok

read_esp32mac​

Read MAC. Returns MAC of esp32

Wire command: w\a\m

Returns: esp32_mac (string)

dev.wireless.esp32_flasher.read_esp32mac() -> Result
ow_status ow_wireless_esp32_flasher_read_esp32mac(ow_device* dev, char* esp32_mac, size_t esp32_mac_cap);
dev.wireless().esp32_flasher().read_esp32mac() -> Result<String, OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.read_esp32mac() # returns value; check dev.ok

erase_all_flash​

Erase All Flash. Toggle ESP32's Enable Pin

Wire command: w\a\e

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.erase_all_flash() -> Result
ow_status ow_wireless_esp32_flasher_erase_all_flash(ow_device* dev);
dev.wireless().esp32_flasher().erase_all_flash() -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.erase_all_flash() # check dev.ok

start_flash_operations​

Start Writing Flash Operations. Prepares ESP32 to write flash at offset and expected size. Block size can be up to 128 bytes

Wire command: w\a\f

ArgWire type
offsethexU32
sizedecU32
block_sizedecU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.start_flash_operations(offset: int, size: int, block_size: int) -> Result
ow_status ow_wireless_esp32_flasher_start_flash_operations(ow_device* dev, uint32_t offset, int32_t size, int32_t block_size);
dev.wireless().esp32_flasher().start_flash_operations(offset: u32, size: i32, block_size: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.start_flash_operations(offset, size, block_size) # check dev.ok

stop_flash_operation​

Finish Flash Writing Operations. Ends ESP32 Flashing Operations.

Wire command: w\a\p

ArgWire type
rebootbool

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.stop_flash_operation(reboot: bool) -> Result
ow_status ow_wireless_esp32_flasher_stop_flash_operation(ow_device* dev, bool reboot);
dev.wireless().esp32_flasher().stop_flash_operation(reboot: bool) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.stop_flash_operation(reboot) # check dev.ok

flash_write​

Write Flash. Writes Binary Blob into flash

Wire command: w\a\o

ArgWire type
flash_databytearray

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.flash_write(flash_data: bytes | bytearray) -> Result
ow_status ow_wireless_esp32_flasher_flash_write(ow_device* dev, const uint8_t* flash_data, size_t flash_data_len);
dev.wireless().esp32_flasher().flash_write(flash_data: &[u8]) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.flash_write(flash_data) # check dev.ok

flash_read​

Read Flash. Reads binary blob from flash with given address and size.

Wire command: w\a\j

ArgWire type
offsethexU32
sizedecU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.flash_read(offset: int, size: int) -> Result
ow_status ow_wireless_esp32_flasher_flash_read(ow_device* dev, uint32_t offset, int32_t size);
dev.wireless().esp32_flasher().flash_read(offset: u32, size: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.flash_read(offset, size) # check dev.ok

start_write_memory_operations​

Start Memory Write Operations. Perpares memeory write operations on the esp32. Max Block Size size is 128

Wire command: w\a\y

ArgWire type
offsethexU32
memory_blockhexU32
block_sizedecU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.start_write_memory_operations(offset: int, memory_block: int, block_size: int) -> Result
ow_status ow_wireless_esp32_flasher_start_write_memory_operations(ow_device* dev, uint32_t offset, uint32_t memory_block, int32_t block_size);
dev.wireless().esp32_flasher().start_write_memory_operations(offset: u32, memory_block: u32, block_size: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.start_write_memory_operations(offset, memory_block, block_size) # check dev.ok

memory_write​

Write Memory. Perpares memeory write operations on the esp32. Max Block Size size is 128

Wire command: w\a\0

ArgWire type
offsethexU32
memory_blockhexU32
block_sizedecU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.memory_write(offset: int, memory_block: int, block_size: int) -> Result
ow_status ow_wireless_esp32_flasher_memory_write(ow_device* dev, uint32_t offset, uint32_t memory_block, int32_t block_size);
dev.wireless().esp32_flasher().memory_write(offset: u32, memory_block: u32, block_size: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.memory_write(offset, memory_block, block_size) # check dev.ok

stop_memory_operation​

Stop Memory Write Operations. Disables memory write operations on esp32 and sets entry point in ram

Wire command: w\a\t

ArgWire type
entry_addresshexU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.stop_memory_operation(entry_address: int) -> Result
ow_status ow_wireless_esp32_flasher_stop_memory_operation(ow_device* dev, uint32_t entry_address);
dev.wireless().esp32_flasher().stop_memory_operation(entry_address: u32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.stop_memory_operation(entry_address) # check dev.ok

register_write​

Write Register. Writes a 4 byte value onto a register in the esp32

Wire command: w\a\g

ArgWire type
offsethexU32
valuehexU32

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.register_write(offset: int, value: int) -> Result
ow_status ow_wireless_esp32_flasher_register_write(ow_device* dev, uint32_t offset, uint32_t value);
dev.wireless().esp32_flasher().register_write(offset: u32, value: u32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.register_write(offset, value) # check dev.ok

register_read​

Read Register. Reads a 4 byte value from a register in the esp32

Wire command: w\a\c

ArgWire type
offsethexU32

Returns: memory_block (hexU32)

dev.wireless.esp32_flasher.register_read(offset: int) -> Result
ow_status ow_wireless_esp32_flasher_register_read(ow_device* dev, uint32_t offset, uint32_t* memory_block);
dev.wireless().esp32_flasher().register_read(offset: u32) -> Result<u32, OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.register_read(offset) # returns value; check dev.ok

flash_default​

Flash Default App. Flash default application onto ESP32

Wire command: w\a\n

Returns: none (Ok/Err only)

dev.wireless.esp32_flasher.flash_default() -> Result
ow_status ow_wireless_esp32_flasher_flash_default(ow_device* dev);
dev.wireless().esp32_flasher().flash_default() -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.wireless.esp32_flasher.flash_default() # check dev.ok