flipflip:
python /path/to/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /path/to/hello_world/build/bootloader/bootloader.bin 0x10000 /path/to/hello_world/build/hello_world.bin 0x8000 /path/to/hello_world/build/partitions_singleapp.bin
This seems to be Linux. I was on Windows. Today I'm trying it on a Linux machine (Raspberry Pi 3B with Ubuntu Mate 16).
esptool.py is version 2.5.1 installed from pip3.
chip_id and flash_id commands work:
sunny@pimate:~$ sudo esptool.py --chip esp32 --port /dev/ttyACM0 --baud 115200 --before default_reset --after hard_reset flash_id
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting.....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: 84:0d:8e:11:2b:34
Uploading stub...
Running stub...
Stub running...
Manufacturer: c2
Device: 2815
Detected flash size: 2MB
Hard resetting via RTS pin...
sunny@pimate:~$ sudo esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset flash_id
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: 84:0d:8e:11:2b:34
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Manufacturer: c2
Device: 2815
Detected flash size: 2MB
Hard resetting via RTS pin...
But read_flash command does not work. With 115200 baud rate, it complains "corrupt data":
sunny@pimate:~$ sudo esptool.py --chip esp32 --port /dev/ttyACM0 --baud 115200 --before default_reset --after hard_reset read_flash 0 0x200000 wifinina.bin
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting......
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: 84:0d:8e:11:2b:34
Uploading stub...
Running stub...
Stub running...
A fatal error occurred: Corrupt data, expected 0x1000 bytes but received 0xb8d bytes
With 921600 baud rate, read_flash is stuck at changing baud rate:
sunny@pimate:~$ sudo esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset read_flash 0 0x200000 wifinina.bin
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: 84:0d:8e:11:2b:34
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
I tried the same esptool.py and USB cable with a Heltec WiFi_Kit_32 ESP32 unit (appearing as /dev/ttyUSB0 rather than /dev/ttyACM0). read_flash works with 115200 baud rate but not 921600 baud rate ("corrupt data").