Søren ONeill
Søren ONeill

Reputation: 529

Fail: Arduino sketch upload to Wemos Lolin D32 -- timeout or invalid head of packet

Ubuntu 20.04 -- Arduino IDE 1.8.13

I have tried three different (same make/model) Wemos Lolin D32 boards without luck ... i.e. unlikely to be a hardware problem. This is the exact board: https://www.wemos.cc/en/latest/d32/d32.html

I have tried several sketches (incl. the example sketches like Hallsensor) : same outcome ... i.e. unlikely to be a coding problem.

I have tried with and without short circuiting EN/GND on the board and I get two different errors:

WITH EN grounded:

Arduino: 1.8.13 (Linux), Board: "LOLIN D32, Default, 40MHz, 921600, None"

Sketch uses 220270 bytes (16%) of program storage space. Maximum is 1310720 bytes. Global variables use 13448 bytes (4%) of dynamic memory, leaving 314232 bytes for local variables. Maximum is 327680 bytes. python /home/soon/snap/arduino/50/.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xe000 /home/soon/snap/arduino/50/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin 0x1000 /home/soon/snap/arduino/50/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_40m.bin 0x10000 /tmp/arduino_build_529817/HallSensor.ino.bin 0x8000 /tmp/arduino_build_529817/HallSensor.ino.partitions.bin esptool.py v3.0-dev Serial port /dev/ttyUSB0 Connecting........__ Chip is ESP32-D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: cc:50:e3:af:5a:78 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size...

A fatal error occurred: Invalid head of packet (0xE0) A fatal error occurred: Invalid head of packet (0xE0)

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

WITHOUT EN grounded:

Arduino: 1.8.13 (Linux), Board: "LOLIN D32, Default, 40MHz, 921600, None"

Sketch uses 220270 bytes (16%) of program storage space. Maximum is 1310720 bytes. Global variables use 13448 bytes (4%) of dynamic memory, leaving 314232 bytes for local variables. Maximum is 327680 bytes. python /home/soon/snap/arduino/50/.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xe000 /home/soon/snap/arduino/50/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin 0x1000 /home/soon/snap/arduino/50/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_40m.bin 0x10000 /tmp/arduino_build_529817/HallSensor.ino.bin 0x8000 /tmp/arduino_build_529817/HallSensor.ino.partitions.bin esptool.py v3.0-dev Serial port /dev/ttyUSB0 Connecting........___ Chip is ESP32-D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: cc:50:e3:af:5a:78 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size...

A fatal error occurred: Timed out waiting for packet header A fatal error occurred: Timed out waiting for packet header


This has me stumped ... any ides?

Upvotes: 1

Views: 990

Answers (2)

user16145709
user16145709

Reputation: 1

In macOS baud rate can be set in file boards.txt located at: /Users//Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/boards.txt

Upvotes: 0

Søren ONeill
Søren ONeill

Reputation: 529

Upload had to be 115200 baud - that fixed it

Upvotes: 1

Related Questions