Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) ESP32 Upload Error (Read 9924 times)
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
ESP32 Upload Error
May 21st, 2022 at 2:23pm
Print Post  
I have loaded the correct driver for the ESP32 and I can sometimes flash to the ESP32 but more often than not it fails with the following message "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header". Any ideas what might be causing this. Thanks.
  
Back to top
 
IP Logged
 
Acuario
Full Member
***
Offline


Posts: 233
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 Upload Error
Reply #1 - May 22nd, 2022 at 9:32am
Print Post  
Sounds like a serial comms failure to me. 
Are you using an ESP32 module with a USB connection cable?
Try reducing the upload speed (vMicro Upload speed) to something lower and try that.

What module/version of ESP32 are you using?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32 Upload Error
Reply #2 - May 23rd, 2022 at 9:48am
Print Post  
Can you also confirm which version of the CP2104 driver is installed from Device Manager?
  
Back to top
 
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #3 - Jun 2nd, 2022 at 3:04pm
Print Post  
Yes, using USB cable.
SparkFun Thing Plus - ESP32 WROOM
Upload speed:115200 I think this is the lowest setting in VM.
CP2104 driver: 11.1.0.53

Upload is failing every time today with:
esptool.py v3.1
Serial port COM8
___
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

I thought I had solved this last week after I changed Remote Transport to Bridge in project properties and it worked but it failed again today.

Serial output continues to work fine for app previously uploaded to ESP32.

Thanks.
« Last Edit: Jun 2nd, 2022 at 3:17pm by StockBrick »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32 Upload Error
Reply #4 - Jun 2nd, 2022 at 6:26pm
Print Post  
You need to use the driver marked for windows, not for windows universal. It is misleading on their page, the windows version is 6.7.6

use this link and click downloads

https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
« Last Edit: Jun 2nd, 2022 at 6:27pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #5 - Jun 3rd, 2022 at 9:09pm
Print Post  
I changed the driver to Windows version 6.7.6 but am still getting same error. Any ideas?

I’m confused about which is the correct driver. Sparkfun say that it should be a version at or above 10.1.3.2130 and their link sends you to the Windows Universal Version.

https://learn.sparkfun.com/tutorials/esp32-thing-plus-hookup-guide?_ga=2.2332489...

Thanks 
« Last Edit: Jun 3rd, 2022 at 9:15pm by StockBrick »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32 Upload Error
Reply #6 - Jun 3rd, 2022 at 9:21pm
Print Post  
Thanks, we will review. Historically the CP210 10x driver for windows universal did not work with the std C# SerialPort commands. It got the baud rate wrong but because of the term "windows universal" everyone thinks it will work with normal windows. It might be that the 11x version of the CP210 driver fixes the issues, we will review. 

It might also be unrelated therefore please follow the guide in yellow above so that we can see your build settings and verbose output.

Thanks
  
Back to top
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #7 - Jun 4th, 2022 at 3:09pm
Print Post  
Thanks. I have emailed you the output file when using driver v6.7.6.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32 Upload Error
Reply #8 - Jun 4th, 2022 at 6:26pm
Print Post  
Looks like your Visual Micro version is running a version from June last year?

Please update then submit output again if an issue.
  
Back to top
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #9 - Jun 5th, 2022 at 2:53pm
Print Post  
Thanks. I've updated VM to the latest version but still have the same issue. I'll email the output file. Output is using 11.1.0.53 Universal Windows driver but can swap back again 6.7.6 again if you need the output from that.

It's very odd. Got it to upload once yesterday using previous version of VM and driver 11.1.0.53 but when I repeated the upload it failed. I'll attached the upload output for that too.

Many thanks
  
Back to top
 
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #10 - Jun 10th, 2022 at 4:54pm
Print Post  
@Tim@Visual Micro Did you get a chance to review this error your end? Thanks
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32 Upload Error
Reply #11 - Jun 11th, 2022 at 12:56pm
Print Post  
Sorry for the delay. Simon from vm will review first thing next week.
  
Back to top
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #12 - Jun 11th, 2022 at 1:09pm
Print Post  
No problem. Thanks.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32 Upload Error
Reply #13 - Jun 13th, 2022 at 3:09pm
Print Post  
Can you confirm if this works normally in the Arduino IDE, or whether this suffers the same issue?

  
Back to top
 
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #14 - Jun 13th, 2022 at 4:06pm
Print Post  
Yes, same issue with Arduino IDE. Thanks.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32 Upload Error
Reply #15 - Jun 13th, 2022 at 5:09pm
Print Post  
Thanks for confirming. This means it is not an issue with Visual Micro directly, and we have been unable to replicate this on similar ESP32 boards on our side to investigate further.
  
Back to top
 
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #16 - Jun 13th, 2022 at 6:22pm
Print Post  
Thanks for looking at this. Do the settings look right from the log? It would be useful to know what driver you are running and do you have this specific Sparkfun board?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32 Upload Error
Reply #17 - Jun 14th, 2022 at 9:35am
Print Post  
From what we can see the settings look right, the upload process is handed over to the esptool.exe, so the upload can also be run from the command line to remove Visual Micro / Arduino IDE from the equation completely (this is seen in the output after enabling vMicro > Uploader > Verbose, and performing an upload in vMicro).

We do not have the specific Sparkfun board, however our ESP32 Dev Module has an ESP32 chip, and the same CP210x port.

Currently we are running the 11.1.0.53 driver, but found no issues with 10.1.10.103, or 6.7.6.2130 either.

As it has worked correctly for you a couple of times, have you tried the below options to troubleshoot?
a) Changing the USB lead
b) Changing the port it is connected to on your PC (ideally not through an external USB hub)
c) Remove all external connections from the board
d) Upload a very simple sketch (e.g blink)
  
Back to top
 
IP Logged
 
StockBrick
Junior Member
**
Offline


Posts: 28
Joined: May 9th, 2021
Re: ESP32 Upload Error
Reply #18 - Jun 25th, 2022 at 9:54pm
Print Post  
Thanks. I tried those things and it still did not work. Solution was to press button 0 on Sparkfun ESP32 when connecting as described in this post on their forum. https://forum.sparkfun.com/viewtopic.php?f=97&t=49164
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: ESP32 Upload Error
Reply #19 - Jun 27th, 2022 at 10:50am
Print Post  
Thanks for the update and solution clarification on this aspect.

It is very confusing their guide says the auto reset should work, when this solution shows it clearly doesn't. They are working on improving the new esp32 board cores, it might be one to report on their github site.
« Last Edit: Jun 27th, 2022 at 1:41pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint