I just received a shiny new ESP32 Dev Board from Adafruit and am getting the above error when trying 'make flash' with the hello world getting started example.
The exact log output is:
lane@ESPDev:~/esp/esp-idf/examples/get-started/hello_world$ make flash
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.0-beta1
Connecting...........................................
A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('6')
/home/lane/esp/esp-idf/components/esptool_py/Makefile.projbuild:52: recipe for target 'flash' failed
make: *** [flash] Error 2
Everything is pretty much as defined following along with the tutorials. This is a brand new Virtual Box Ubuntu 16.04 VM (running on a Win10 host) built just for this purpose so other than apt update and the esp-idf tutorials its straight from the ISO.
I can connect to the device with minicom and I see UART/serial output when I RST the device so the USB port is okay. I did see some threads with folks having a similar issue with the REV1 boards. I confirmed I have the REV2 board. I also saw a thread saying to hold the EN button for 2 seconds for the REV2 boards. That made no difference for me (also the error was slightly different anyways).
Out of fear of bricking the new shiny I am punting. Can anyone offer some ideas of things to try?
Failed to connect to ESP32: Invalid head of packet ('6')
Re: Failed to connect to ESP32: Invalid head of packet ('6')
Howdy,
I too am running Ubuntu on Virtual Box on Windows 10 ... and I had the exact same issue. The solution (for me) was thankfully very simple.
Run "make menuconfig" and then navigate to "Serial flasher config". From there, find the entry labeled "Before flashing" and change the option to be "Reset with ESP32R0 Windows workaround".
Once done ... you might find it works as desired.
Good luck.
I too am running Ubuntu on Virtual Box on Windows 10 ... and I had the exact same issue. The solution (for me) was thankfully very simple.
Run "make menuconfig" and then navigate to "Serial flasher config". From there, find the entry labeled "Before flashing" and change the option to be "Reset with ESP32R0 Windows workaround".
Once done ... you might find it works as desired.
Good luck.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Failed to connect to ESP32: Invalid head of packet ('6')
For me pressing the boot button on the board during the 'make flash' process helped. My error was ...Invalid head of packet(' ') i guess.
Re: Failed to connect to ESP32: Invalid head of packet ('6')
Looks like it's not Windows specific. I'm on a Mac and running IDF in Virtualbox.
I'm running Ubuntu 14.04 in Virtualbox on macOS Sierra 10.12 and had to install CP210x to get serial access to the device (Olimex dev kit board v2). Had the same issue, where I couldn't flash unless I manually put the board in download mode with buttons and disable reset before flash.
Setting "Before flashing" to "Reset with ESP32R0 Windows workaround" fixed it for me, now board resets into download mode automatically. No need to press any buttons, yay!
I'm running Ubuntu 14.04 in Virtualbox on macOS Sierra 10.12 and had to install CP210x to get serial access to the device (Olimex dev kit board v2). Had the same issue, where I couldn't flash unless I manually put the board in download mode with buttons and disable reset before flash.
Setting "Before flashing" to "Reset with ESP32R0 Windows workaround" fixed it for me, now board resets into download mode automatically. No need to press any buttons, yay!
Re: Failed to connect to ESP32: Invalid head of packet ('6')
Worked like a charm! Thanks!kolban wrote:Run "make menuconfig" and then navigate to "Serial flasher config". From there, find the entry labeled "Before flashing" and change the option to be "Reset with ESP32R0 Windows workaround".
Re: Failed to connect to ESP32: Invalid head of packet ('6')
Thanks kolban for helping lanegg figure this one out.
We're going to merge a workaround for this issue (which originally was thought to only affect Windows, but seems to sometimes affect people using VM guests on any host platform) into the default behaviour of esptool soon (thanks Marty!), so setting this option soon won't be necessary to get a successful flash.
We're going to merge a workaround for this issue (which originally was thought to only affect Windows, but seems to sometimes affect people using VM guests on any host platform) into the default behaviour of esptool soon (thanks Marty!), so setting this option soon won't be necessary to get a successful flash.
-
- Posts: 1
- Joined: Thu Mar 02, 2017 6:19 pm
Re: Failed to connect to ESP32: Invalid head of packet ('6')
Sorry to hijack the thread.
Just to say I had to enable "Reset with ESP32R0 Windows workaround" setting to get this to work on a bare metal linux (mint 18) install.
Cheers.
Just to say I had to enable "Reset with ESP32R0 Windows workaround" setting to get this to work on a bare metal linux (mint 18) install.
Cheers.
Who is online
Users browsing this forum: No registered users and 90 guests