A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

analoglamb
Posts: 25
Joined: Thu Oct 13, 2016 5:53 am

A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby analoglamb » Thu Oct 13, 2016 5:59 am

Hello,

I download firmware to ESP32 with make flash in Ubuntu, It prompts error:

A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

But I use Espressif download tool, It is OK.

Anyone has same experience, Please give me some suggestion.

Thanks
Last edited by analoglamb on Mon Oct 17, 2016 3:12 am, edited 2 times in total.
ESP32 Chip, Module, Development board! Go: http://analoglamb.com/shop/esp32

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby ESP_Angus » Thu Oct 13, 2016 6:38 am

Try setting the baud rate to a lower value (either by changing the "--baud" argument on the command line, or the setting in "make menuconfig").

analoglamb
Posts: 25
Joined: Thu Oct 13, 2016 5:53 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby analoglamb » Thu Oct 13, 2016 8:02 am

ESP_Angus wrote:Try setting the baud rate to a lower value (either by changing the "--baud" argument on the command line, or the setting in "make menuconfig").

Thanks for your answer. But I use default baudrate 115200, It prompts the error. And I use 230400, It prompts the MD5 error like this
http://esp32.com/viewtopic.php?f=2&t=322

I have other question: Please see the attachment.
Blue - IO0
Yellow - EN.
558934208.jpg
558934208.jpg (63.98 KiB) Viewed 54258 times
Why IO0's wave like this? It looks like that there is a big capacitor on IO0. But from schematic, there is no capacitor. I feel that It refers to the error

Thanks
ESP32 Chip, Module, Development board! Go: http://analoglamb.com/shop/esp32

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby ESP_Angus » Thu Oct 13, 2016 8:24 pm

What hardware did you take this capture from? If it's the board in your first post, can you please post the schematic?

analoglamb
Posts: 25
Joined: Thu Oct 13, 2016 5:53 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby analoglamb » Fri Oct 14, 2016 1:55 am

ESP_Angus wrote:What hardware did you take this capture from? If it's the board in your first post, can you please post the schematic?

It's same with ESP32-DevKitC of Espressif.

Thanks
ESP32 Chip, Module, Development board! Go: http://analoglamb.com/shop/esp32

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby ESP_Angus » Fri Oct 14, 2016 3:10 am

The V1 (blue PCB) DevKitC boards have a bug with the auto-reset circuit where it doesn't work reliably. You need to hold down the "Boot" button (J3, pulls down IO0) in order to reliably enter the bootloader. V2 (black PCB, "ESP32_Core_Board_V2" marked on bottom) DevKitC does not have this problem.

analoglamb
Posts: 25
Joined: Thu Oct 13, 2016 5:53 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby analoglamb » Fri Oct 14, 2016 4:35 am

ESP_Angus wrote:The V1 (blue PCB) DevKitC boards have a bug with the auto-reset circuit where it doesn't work reliably. You need to hold down the "Boot" button (J3, pulls down IO0) in order to reliably enter the bootloader. V2 (black PCB, "ESP32_Core_Board_V2" marked on bottom) DevKitC does not have this problem.

Thank you very much.
Can you send me ESP32_Core_Board_V2 schematic? 1814830468@qq.com

Thanks again
ESP32 Chip, Module, Development board! Go: http://analoglamb.com/shop/esp32

User avatar
hydrabus
Posts: 29
Joined: Wed Nov 25, 2015 11:45 pm
Location: France
Contact:

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby hydrabus » Fri Oct 14, 2016 5:53 pm

Hi,

I have received an ESP32_Core_board_V2 from AdaFruit 1 week ago (also called ESP32DevC or Espressif ESP32 Development Board - Developer Edition PID: 3269 in AdaFruit shop see link https://www.adafruit.com/products/3269)

I'm using an ASUS N56VZ Laptop with 16GB RAM + Samsung 512GB SSD + Corei7-3630QM @2.4GHz + Windows7 64bits
I have created an ESP32 development environment using VirtualBox Version 5.1.6 r110634 (Qt5.5.1) with image Xubuntu 14.04.5 LTS
I can build all esp-idf example with xtensa-esp32-elf and latest esp-idf trunk
I have tested the board with stock firmware and all work fine (even if stock firmware is pretty limited with ssc commands which are not documented => "Please refer to document ssc_commands.xlsx for detail", even if I have reversed some command it is pretty limited).
The board use a 4MBytes Flash (FM25Q32 chipset) soldered on the ESP-WROOM-32 shield.
The board use a Silicon Labs CP2102 USB to Serial chipset

So then I have tried to use different command in order to have info about the ESP32

Code: Select all

xubuntu@xubuntu-VirtualBox:~/esp$ sudo /home/xubuntu/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 -b 115200 -p /dev/ttyUSB0 flash_id
esptool.py v2.0-dev
Connecting...
Uploading stub...
Running stub...
Stub running...
Manufacturer: a1
Device: 4016
So 2nd time i try an other command i obtain error Invalid head of packet ('\x1b'):

Code: Select all

xubuntu@xubuntu-VirtualBox:~/esp$ sudo /home/xubuntu/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 -b 115200 -p /dev/ttyUSB0 flash_id
esptool.py v2.0-dev
Connecting...

A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('\x1b')
If I retry multiple time sometime it works again ...
I have tested different command and baudrate but I have always the same random error to communicate with the board
I have done lot of tests and I have about 3 fail out of 4 tests (so 1 work and 3 fail)
I never have more than 2 consecutive test working the 3rd is always a fail ...

Are you aware of this problem ?
Do you have a fix to have better / more robust communication ? (it seems to be not related to baudrate but more with a timing issue ...)
I will do some oscilloscope & logic analyzer traces to better understand what happen, but before to loose time on that I would like to know if such issue is known and maybe if there is already a fix/workaround... ?

For information when I'm using esp-idf/components/esptool_py/esptool/esptool.py on Windows7 it always fail so the best is to use VirtualBox today (and anyway I plan to do all with the VirtualBox image)

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby WiFive » Sat Oct 15, 2016 12:23 am

hydrabus wrote:I have done lot of tests and I have about 3 fail out of 4 tests (so 1 work and 3 fail)
If you put the board in download mode first using buttons does it ever fail?

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')

Postby rudi ;-) » Sat Oct 15, 2016 2:30 pm

analoglamb wrote:
aggressive and annoying advertising .jpg
aggressive and annoying advertising .jpg (30.3 KiB) Viewed 54170 times
ESP_Angus wrote:The V1 (blue PCB) DevKitC boards have a bug with the auto-reset circuit where it doesn't work reliably. You need to hold down the "Boot" button (J3, pulls down IO0) in order to reliably enter the bootloader. V2 (black PCB, "ESP32_Core_Board_V2" marked on bottom) DevKitC does not have this problem.

Thank you very much.
Can you send me ESP32_Core_Board_V2 schematic? 1814830468@qq.com

Thanks again
hi
please guy, Your advertising is very aggressive and annoying.
hope you understand my posting very well meaned.

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

Users browsing this forum: No registered users and 185 guests