Trying to reset my esp32-3 nano but it's stuck in DFU mode

Hello there!

Im trying to reset my arduino esp-32 nano by using the https://support.arduino.cc/hc/en-us/articles/9810414060188-Reset-the-Arduino-bootloader-on-the-Nano-ESP32 article. But I'm keeps getting stuck at step 10, When I'm trying to upload an empty stech these errors keeps coming up

c:/users/olive/appdata/local/arduino15/packages/esp32/tools/s3-gcc/2021r2-p5/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\olive\AppData\Local\arduino\cores\c30f7d16a1a5fb0d9adb0276d4670e8a\core.a(main.cpp.o):(.literal._Z8loopTaskPv+0x8): undefined reference to `setup()'
c:/users/olive/appdata/local/arduino15/packages/esp32/tools/s3-gcc/2021r2-p5/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\olive\AppData\Local\arduino\cores\c30f7d16a1a5fb0d9adb0276d4670e8a\core.a(main.cpp.o):(.literal._Z8loopTaskPv+0xc): undefined reference to `loop()'
c:/users/olive/appdata/local/arduino15/packages/esp32/tools/s3-gcc/2021r2-p5/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\olive\AppData\Local\arduino\cores\c30f7d16a1a5fb0d9adb0276d4670e8a\core.a(main.cpp.o): in function `loopTask(void*)':
C:\Users\olive\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/main.cpp:42: undefined reference to `setup()'
c:/users/olive/appdata/local/arduino15/packages/esp32/tools/s3-gcc/2021r2-p5/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\olive\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/main.cpp:48: undefined reference to `loop()'
collect2.exe: error: ld returned 1 exit status
exit status 1

Compilation error: exit status 1

This worked fine for just 3 weeks ago and I didnt have any problems at all uploading an empty sketch.

I have uninstalled and reinstalled the "Arudino ESP32 Borards", but nothing works, The arduino keeps disconecting and connecting to my computer.

What might be the problem?, or have any off you had the same problem?

Regards Oliver

:wrench: Method 1: Use Arduino IDE to Upload a Sketch

If the board is in DFU mode but still detected by your computer (usually as a USB device called “Arduino UNO R4 Minima (DFU)”), try this:

  1. Open the Arduino IDE (version 2.x recommended).
  2. Go to Tools > Board , and select Arduino UNO R4 Minima .
  3. Go to Tools > Port, and select the DFU port (if available).
  4. Open a basic sketch (like Blink) and upload it.

If successful, uploading a sketch will exit DFU mode automatically.

:electric_plug: Method 2: Double-Reset Trick

If the board is stuck or unresponsive:

  1. Press the Reset button twice quickly.
  • This attempts to put the board into the bootloader.
  • You may see a different USB device show up temporarily.
  1. Then upload a sketch immediately .

:warning: Timing can be tricky—try a few times if needed.

1 Like

Hi @OliverA

This is not related to a DFU mode. This is simply a matter of the compiler that runs on your computer not considering the sketch code on your computer to be valid. The error would occur even if you didn't have the Nano ESP32 board connected to your computer as it does not involve the board hardware in any way.

It might be that you have a separate problem with the board being in a DFU mode, but we need to focus all our attention on getting the sketch to compile successfully for now because Arduino IDE will only attempt an upload process after a successful compilation.

Every Arduino sketch must define a setup and a loop function. So if you the sketch is truly empty, then the error is normal and expected.

Please try this experiment and then report the results:

  1. Select File > Examples > 01.Basics > BareMinimum from the Arduino IDE menus.
    The "BareMinimum" example sketch will open in a new Arduino IDE window.
  2. Select Sketch > Verify/Compile from the Arduino IDE menus.
    ⓘ Alternatively, you can click the "Verify" button on the Arduino IDE toolbar if you prefer.
  3. Wait for the compilation to finish.

Please add a reply here on this forum topic to tell us whether the compilation of the "BareMinimum" sketch failed as happened with your "empty" sketch, or whether it was successful.

It worked, Thanks guys!!

You are welcome. I'm glad it is working now.

Regards, Per

A post was split to a new topic: Incorrect pin mapping on website