Page 1 of 3

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

Posted: Thu Oct 13, 2016 5:59 am
by analoglamb
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

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

Posted: Thu Oct 13, 2016 6:38 am
by ESP_Angus
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").

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

Posted: Thu Oct 13, 2016 8:02 am
by analoglamb
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 54066 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

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

Posted: Thu Oct 13, 2016 8:24 pm
by ESP_Angus
What hardware did you take this capture from? If it's the board in your first post, can you please post the schematic?

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

Posted: Fri Oct 14, 2016 1:55 am
by analoglamb
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

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

Posted: Fri Oct 14, 2016 3:10 am
by ESP_Angus
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.

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

Posted: Fri Oct 14, 2016 4:35 am
by analoglamb
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

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

Posted: Fri Oct 14, 2016 5:53 pm
by hydrabus
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)

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

Posted: Sat Oct 15, 2016 12:23 am
by WiFive
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?

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

Posted: Sat Oct 15, 2016 2:30 pm
by rudi ;-)
analoglamb wrote:
aggressive and annoying advertising .jpg
aggressive and annoying advertising .jpg (30.3 KiB) Viewed 53978 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 ;-)