Upload to Nano ESP32 fails: "LIBUSB_ERROR_PIPE"

Continuing the discussion from Can't upload to nano esp32:

Hello I am also experiencing this issue. I have follow the troubleshoot steps that have been laid out above and have yet to have success. The upload with occasionally reach the percentage step of upload or with stop at the stage that I have shown below. Currently the only method that I can get new code on the device is by using the reset button built on the controller.

In file included from c:\Users\croff\OneDrive\Documents\Arduino\libraries\FastLED\src/FastLED.h:79,
                 from C:\Users\croff\OneDrive\Documents\Arduino\GameMaster4\GameMaster4.ino:5:
c:\Users\croff\OneDrive\Documents\Arduino\libraries\FastLED\src/fastspi.h:157:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sketch uses 731785 bytes (23%) of program storage space. Maximum is 3145728 bytes.
Global variables use 59340 bytes (18%) of dynamic memory, leaving 268340 bytes for local variables. Maximum is 327680 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
Device ID 2341:0070
Device DFU version 0101
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0101
Device returned transfer size 4096
Copying data from PC to DFU device

Download	[                         ]   0%            0 bytes
Download	[=                        ]   4%        32768 bytes
Download	[==                       ]   8%        61440 bytes
Download	[==                       ]  10%        73728 bytes
Download	[===                      ]  12%        90112 bytes
Download	[====                     ]  16%       118784 bytes
Download	[=====                    ]  20%       147456 bytes
Download	[======                   ]  24%       180224 bytes
Download	[=======                  ]  28%       208896 bytes
Download	[=======                  ]  31%       233472 bytes
Download	[========                 ]  32%       237568 bytes
Download	[=========                ]  36%       266240 bytes
Download	[==========               ]  40%       294912 bytesError during download get_status (LIBUSB_ERROR_PIPE)
Failed uploading: uploading error: exit status 74

Hi @christopherroff11. I did some research, but unfortunately didn't find a clear explanation of what could cause the uploads to fail with this distinctive "Error during download get_status (LIBUSB_ERROR_PIPE)" error.

I did find this interesting report from someone who experienced the problem and was able to find a way to make it stop occurring:

So this indicates that certain sketch program code produces the conditions under which the fault occurs. That would match well with your observation:

In order to test the hypothesis, please try this experiment:

  1. Select File > New Sketch from the Arduino IDE menus.
    A minimal sketch will open in a new Arduino IDE window.
  2. Perform the reset technique you found that allows you to successfully upload to the Nano ESP32 board.
  3. Upload the new sketch to the board as usual.
  4. Wait for the upload to finish successfully.
  5. Upload the new sketch to the board again. But this time, do not perform the reset technique.

Did the second upload you performed at step (5) in the instructions succeed, or did it fail with the "Error during download get_status (LIBUSB_ERROR_PIPE)" error?

The purpose of the experiment is to determine whether the problem is being caused by something in the sketch programs you are uploading to the sketch. The minimal sketch generated by File > New Sketch is a "known good" program that we know should not cause any problems when uploading. So if the fault occurs with your real sketch, but not with the minimal sketch, this would indicate that the cause is indeed something in your real sketch program. Once you have identified that as the cause, you can then focus your troubleshooting efforts on identifying exactly what it is in the real sketch's code that causes the fault, and finding a way to adjust that code.