Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Pages: 1 2 
Send Topic Print
ESP32 Upload Error (Read 516 times)
StockBrick
Junior Member
**
Offline



Posts: 25
ESP32 Upload Error
May 21st, 2022 at 3:23pm
 
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: 177
Re: ESP32 Upload Error
Reply #1 - May 22nd, 2022 at 10:32am
 
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
*****
Online



Posts: 1361
Re: ESP32 Upload Error
Reply #2 - May 23rd, 2022 at 10:48am
 
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: 25
Re: ESP32 Upload Error
Reply #3 - Jun 2nd, 2022 at 4:04pm
 
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
Connecting........_____....._____....._____....._____....._____....._____.....__
___
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.
Back to top
« Last Edit: Jun 2nd, 2022 at 4:17pm by StockBrick »  
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11355
United Kingdom
Re: ESP32 Upload Error
Reply #4 - Jun 2nd, 2022 at 7:26pm
 
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
Back to top
« Last Edit: Jun 2nd, 2022 at 7:27pm by Tim@Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline



Posts: 25
Re: ESP32 Upload Error
Reply #5 - Jun 3rd, 2022 at 10:09pm
 
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
Back to top
« Last Edit: Jun 3rd, 2022 at 10:15pm by StockBrick »  
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11355
United Kingdom
Re: ESP32 Upload Error
Reply #6 - Jun 3rd, 2022 at 10:21pm
 
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
 

Tim Leek
home
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline



Posts: 25
Re: ESP32 Upload Error
Reply #7 - Jun 4th, 2022 at 4:09pm
 
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: 11355
United Kingdom
Re: ESP32 Upload Error
Reply #8 - Jun 4th, 2022 at 7:26pm
 
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
 

Tim Leek
home
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline



Posts: 25
Re: ESP32 Upload Error
Reply #9 - Jun 5th, 2022 at 3:53pm
 
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: 25
Re: ESP32 Upload Error
Reply #10 - Jun 10th, 2022 at 5:54pm
 
@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: 11355
United Kingdom
Re: ESP32 Upload Error
Reply #11 - Jun 11th, 2022 at 1:56pm
 
Sorry for the delay. Simon from vm will review first thing next week.
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
StockBrick
Junior Member
**
Offline



Posts: 25
Re: ESP32 Upload Error
Reply #12 - Jun 11th, 2022 at 2:09pm
 
No problem. Thanks.
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Online



Posts: 1361
Re: ESP32 Upload Error
Reply #13 - Jun 13th, 2022 at 4:09pm
 
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: 25
Re: ESP32 Upload Error
Reply #14 - Jun 13th, 2022 at 5:06pm
 
Yes, same issue with Arduino IDE. Thanks.
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Online



Posts: 1361
Re: ESP32 Upload Error
Reply #15 - Jun 13th, 2022 at 6:09pm
 
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: 25
Re: ESP32 Upload Error
Reply #16 - Jun 13th, 2022 at 7:22pm
 
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
*****
Online



Posts: 1361
Re: ESP32 Upload Error
Reply #17 - Jun 14th, 2022 at 10:35am
 
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: 25
Re: ESP32 Upload Error
Reply #18 - Jun 25th, 2022 at 10:54pm
 
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
*****
Online



Posts: 1361
Re: ESP32 Upload Error
Reply #19 - Jun 27th, 2022 at 11:50am
 
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.
Back to top
« Last Edit: Jun 27th, 2022 at 2:41pm by Tim@Visual Micro »  
 
IP Logged
 
Pages: 1 2 
Send Topic Print