Wanted to blog about playing with the USB Army Knife on a LilyGo T-Dongle S3 USB device (ESP32-S3) and steps I took to implement it. I did not develop the tool, but I wanted to try out each of the tool features and write about it. Some helpful references to start:
I used the LilyGo T-Dongle S3 USB device because it was easy to source on Amazon.com for about $25. I also purchased a 32GB microSD card for best compatibility. Short video showing the first boot with OEM firmware.
On windows the command to install the esptool software:
python -m esptool version
Backup existing firmware
- Inserted USB device, did not have to hold down any button on the device
- python -m esptool flash_id
- Observed "Detected flash size" of 16MB for the LilyGo
- python -m esptool --baud 115200 --port COM3 read_flash 0x0 0x1000000 fw-backup-16MiB.bin
- Adjust port per previous flash_id
- 16MiB = hex 0x1000000
- For many devices you can change the baud rate to something faster (922190) and the device will auto-adjust.
- It may take a little bit for the complete flash to dump
Getting necessary firmware
You can use a web browser to flash firmware, but I wanted to have a CLI method. The download files come from the GitHub Wiki instructions.
- Go to the git commits page
- Click on the title of the first (top-most) result
- Look under Artifacts
- Download the LILYGO-T-Dongle-S3 Firmware binaries
- Extract the zip file
- Download the raw boot_app0.bin from espressif
Installation
Pieces of command syntax from https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/flashing-firmware.html
- Open a terminal/command prompt (admin not necessary)
- cd into the directory where all the firmware .bin files are located
- Plug in your device, holding down any boot button that may exist
python -m esptool --baud 922190 --before default_reset --after hard_reset write_flash 0x0000 bootloader.bin 0x8000 partitions.bin 0xE000 boot_app0.bin
-
python -m esptool --baud 922190 --before default_reset --after hard_reset write_flash 0x10000 firmware.bin
- I'm not sure why, but I had to do this separate to avoid "Detected overlap at address: 0x10000 for file: firmware.bin"
You may find python -m esptool flash_id useful for getting your device flash size and Crystal speed (e.g. --flash_freq 40m), but I found leaving it in auto-detect worked fine.
|