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 Send TopicPrint
Hot Topic (More than 8 Replies) ESP32-Program: uploader process failed (Read 2814 times)
KriSog
Newbies
*
Offline


Posts: 6
Joined: Jun 23rd, 2020
ESP32-Program: uploader process failed
Jun 23rd, 2020 at 9:30am
Print Post  
Hi.
I have had the ESP32-Prog running for a week on a new design. So cables and stuff should be fine.
But now this morning after receiving an update to vMicro I can't upload program.
Here is the output below.

The line: 
****[vMicro]**** Uploading App :Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
has been there since day one, and it seemed to work anyway. 

Output:
Uploading 'XXX' to 'ESP32 Dev Module' using 'ESP32 PROG'
Uploader started for board ESP32 Dev Module
Uploader will use programmer name: esp32prog
C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin\openocd.exe -d2 -s s/" -f "interface/ftdi/minimodule-lowcost.cfg" -f "board/esp-wroom-32.cfg" -c "echo -n {****[vMicro]**** Uploading App :}" -c "telnet_port disabled; program ls/partitions/boot_app0.bin} 0xe000" -c "echo -n {****[vMicro]**** Uploading Bootloader :}" -c "program ls/sdk/bin/bootloader_qio_80m.bin} 0x1000" -c "echo -n {****[vMicro]**** Uploading Sketch :}" -c "program {C:\Users\NUC-W7\AppData\Local\Temp\VMBuilds\XXX\esp32_esp32\Debug/XXX.ino.bin} 0x10000" -c "echo -n {****[vMicro]**** Uploading Partitions :}" -c "program tions.bin} 0x8000 reset; shutdown"
Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:57)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
adapter speed: 2000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
****[vMicro]**** Uploading App :Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 2000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : Target halted. PRO_CPU: PC=0x40090633 (active)    APP_CPU: PC=0x40000400 
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active)    APP_CPU: PC=0x00000000 
Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F).
Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active)    APP_CPU: PC=0x40000400 
** Programming Started **
auto erase enabled
Error: timed out while waiting for target halted / 4 - 2
Info : Target halted. PRO_CPU: PC=0x40090627 (active)    APP_CPU: PC=0x40000400 
Error: xtensa_wait_algorithm: not halted 0, pc 0x40090627, ps 0x60025
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!
Error: Failed to run flasher stub (-302)!
Warn : Failed to get flash mappings (-302)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: Algorithm run failed (-4)!
Error: Failed to run flasher stub (-4)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: Algorithm run failed (-4)!
Error during upload using programmer
The uploader process failed

The uploader process failed
Error: Failed to run flasher stub (-4)!
The uploader returned an error
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 539
at file "embedded:startup.tcl", line 480
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: ESP32-Program: uploader process failed
Reply #1 - Jun 23rd, 2020 at 11:22am
Print Post  
Thanks for the report, and the "LIBUSB_ERROR_NOT_SUPPORTED" can safely be ignored as you say.

Does resetting the ESP32 just before the upload help? (from the Error timed out while waiting for target)
Does the ESP32 have the option to upload over Serial? (and if so does this still work as expected?)

Once known firmware is on the board, please enable the options shown at the top of the page in the yellow box, and try attaching the debugger as this can be easier to inspect from the logs.



  
Back to top
 
IP Logged
 
KriSog
Newbies
*
Offline


Posts: 6
Joined: Jun 23rd, 2020
Re: ESP32-Program: uploader process failed
Reply #2 - Jun 23rd, 2020 at 12:40pm
Print Post  
Hi.
Resetting just before uploading actually allow for upload.
If I switch to serial upload there is no problem.

I did:
    Enabled vMicro > Compiler > Show Build Properties and Verbose
    Re-Compile your program with these settings enabled
Is that what you mean by yellow box?

But I am not sure were I can find the logs?
« Last Edit: Jun 23rd, 2020 at 12:43pm by KriSog »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: ESP32-Program: uploader process failed
Reply #3 - Jun 23rd, 2020 at 12:58pm
Print Post  
Thanks for the update, and cannot see any changes which would affect this in the updates at present.

The logs are just in the Visual Studio Output Window, and select "show output from" Build.  This can be copied to a text file and uploaded.

Does this happen every time, or only after a debugging session was running before the upload?
  
Back to top
 
IP Logged
 
KriSog
Newbies
*
Offline


Posts: 6
Joined: Jun 23rd, 2020
Re: ESP32-Program: uploader process failed
Reply #4 - Jun 23rd, 2020 at 1:32pm
Print Post  
I think you are onto something. Now I tried to stop the debugger, and then just build, then build&upload, and there was no problem.
Okay so now I know how to get out of that situation.

I do believe I actually restarted VS at least twize before reporting this, as well as rebuilding. That did nothing.

Also while we are at it. When I single-step it is talking around 20 seconds so move from one line to the next. A long time. Is that to be expected? Or is that noise on wires or something else? (10 cm long)
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: ESP32-Program: uploader process failed
Reply #5 - Jun 24th, 2020 at 2:27pm
Print Post  
It may be how the debugger is stopping, and we will update this thread if we find anything further around the debug stop/upload element.

The step action shouldn't take 10s from one line to the next (unless there is a 10s delay), this snippet on YouTube shows it working at a normal speed which is faster than you are seeing.

It could be noise on the lines, however it normally crashes when this is the case due to the random errors.  Are you using a breadboard or is it board to board wiring?

To inspect this further can you perform the following:-
1) Attach the debugger, and perform the slow step operation, then stop it.
2) Then attach the log file (sketchName.ino_DebugOpenOCD.log) which you can find following this step of the Troubleshooter


  
Back to top
 
IP Logged
 
KriSog
Newbies
*
Offline


Posts: 6
Joined: Jun 23rd, 2020
Re: ESP32-Program: uploader process failed
Reply #6 - Jun 24th, 2020 at 2:42pm
Print Post  
Have uploaded many times during today, and only had the upload problem once, and the resetting just before fixes the situation.

Thank you for the youtube vid.
Then there is clearly something wrong here. My times are very long.
I am working on a finished PCB and the ESP32-Prog is going through a pogo pin connector on fixture that has serial and debug together on 2 rows of pins.
And there is 10cm wires between the programmer and the board.
I shall follow your instructions and return tomorrow with more.
  
Back to top
 
IP Logged
 
KriSog
Newbies
*
Offline


Posts: 6
Joined: Jun 23rd, 2020
Re: ESP32-Program: uploader process failed
Reply #7 - Jun 25th, 2020 at 9:22am
Print Post  
Hi.
Here is the log. (Thank you for link to path. I couldn't find it before.)
I started the debug session, made a few steps and stopped again. 
I see there are several warnings. Can you make out what that is about?
On average a step from one line to the next (F11) is taking 5-10 seconds.
« Last Edit: Jun 25th, 2020 at 9:24am by KriSog »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: ESP32-Program: uploader process failed
Reply #8 - Jun 25th, 2020 at 12:45pm
Print Post  
The warning shown is from the debugger itself, as it only allows 2 concurrent hardware breakpoints.  If more than two are set it has to swap them around in the background, which adds to the slow down.

We have published a video going over this on You Tube, and how to identify the issue.

The solutions available are:-
1) Only set 2 x breakpoints at any one time, and use step tools to navigate once reached (and move them around as needed when stopped)
2) Use a different hardware debugger, though the maximums rarely exceed 6 breakpoints
3) Use the Visual Micro Serial debugger instead, which supports more concurrent breaks

The differences between GDB and the Visual Micro Debugger are outlined here for clarity.
  
Back to top
 
IP Logged
 
KriSog
Newbies
*
Offline


Posts: 6
Joined: Jun 23rd, 2020
Re: ESP32-Program: uploader process failed
Reply #9 - Jun 26th, 2020 at 7:54am
Print Post  
Hello Simon.

Excellent video!

And indeed setting only 1 breakpoint speeds things up dramatically. 
I notice that when jumping over a Serial.print line it is slow.
And I get below maybe 5-10 times. Where as on other lines of code it appears only once: 
<@"Target halted. PRO_CPU: PC=0x400F63EE             APP_CPU: PC=0x400D227A (active)\n">

On occasion I still  have the problem where I need to reset before upload. But I can live with that no problem. 

I really needed to ensure my setup and understanding was correct because I am at the beginning of a large project so I shall be seeing this a million times over.

Thank you excellent help with solving these issues. Kristian
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint