Dear Forum,
I know this might have been reported/discussed a gazillion times but I'm desperate with my brand new Nano ESP32. It started that uploading a sketch (from Examples) ended in the well known Error 74, using my MackBook Air M1 and Arduino IDE 2.3.2 - switching to my NUC with Ubuntu 22.04 LTS and managed to upload once. Returning to my MacBook and tried a sketch I am developing for the Atmel Nano V3 and then the trouble started: the USB ports shows up and disappears every couple of seconds. On the Mac as well as on the Linux NUC. On Linux, dmesg shows that every second the USB device is found and deactivated in turn. It appears the Nano ESB 32 is caught in an endless reset loop. I tried to burn the Bootloader using the IDE and a wire between GND and B1 and since then I get the same result and "Invalid Header 0xffff....."
Surprisingly, I can install the Micropython firmware and connect with the Arduino Lab for MicroPython and run a simple sketch. Burning the Arduino Bootloader for C++ and the problem shows up again. I wonder if I now have a Micropython only Nano ESP 32 and if it is worth having getting another Nano ESP 32. Maybe there is something wrong with the firmware provided by the Arduino IDE? That Nano ESP32 is brand new. Not a huge investment, but still kind of a bummer.
Reason why I want to switch vom Nano to Nano ESP32 is that I'm starting to run short of memory.
@ekatus usually all I have to do to get back from Micropython to C/C++ is first use esptool to erase the total flash make sure you are erasing the controller on the correct port.
esptool.exe erase_flash
then go to the Arduino IDE and upload a sketch, blink.ino for example, and that's it.
Hi @ekatus. Please try this experiment and then report back with the results:
Connect the Nano ESP32 board to your computer with the USB cable.
Press and release the button on the board marked "RST".
Wait for the RGB LED near the "RST" button to turn on.
It does this almost immediately, but you do need to wait for it.
While the RGB LED is still on (it only stays on for a second so you need to be somewhat quick), press and release the "RST" button again.
The green LED of the RGB LED should now start pulsing. If not, repeat the process in case you didn't get the timing quite right.
If it is already open, close the Tools > Port menu in Arduino IDE.
Open the Tools > Port menu in Arduino IDE.
Now please reply here on the forum thread with the answers to the following questions:
Do you now see the green LED pulsing?
Do you see a port for the Nano ESP32 board in the Tools > Port menu?
Does the problem of the port appearing and disappearing still occur while the board is in that state?
Connect the Nano ESP32 board to your computer with the USB cable. Done
Press and release the button on the board marked "RST". Done
Wait for the RGB LED near the "RST" button to turn on.
It does this almost immediately, but you do need to wait for it. Turns on immediately
While the RGB LED is still on (it only stays on for a second so you need to be somewhat quick), press and release the "RST" button again.
The green LED of the RGB LED should now start pulsing. If not, repeat the process in case you didn't get the timing quite right. Stays on permanently and doesn't start to pulse.
Serial Monitor in Arduino IDE is flooded with "Invalid Header 0xffff....."
So strange. MicroPython works (wonder if there is a decent IDE and documentation) but Arduino "native" is gone. Is there anything else one can apply to the ESP32 using the "esptool"?
OK, there is a more powerful recovery technique available for when the double reset technique is not sufficient:
Disconnect the USB cable of the Nano ESP32 from your computer.
Use a jumper wire to connect the pin marked "B1" on the board to the pin marked "GND" on the board.
Connect the Nano ESP32 to your computer with a USB cable.
Select File > New Sketch from the Arduino IDE menus.
The basic sketch will open in a new Arduino IDE window.
Open the Tools > Port menu in Arduino IDE.
You should see a new port in the menu. Select that port. ⓘ This port might be labeled as being any random ESP32 board instead of "(Arduino Nano ESP32)" as usual. This is normal and doesn't indicate a problem.
Select Tools > Board > Arduino ESP32 Boards > Arduino Nano ESP32 from the Arduino IDE menus. ⓘ Alternatively, if you installed the "esp32" boards platform instead of Arduino ESP32 Boards, you should select Tools > Board > esp32 > Arduino Nano ESP32.
Select Tools > Programmer > Esptool from the Arduino IDE menus.
Select Sketch > Upload Using Programmer from the Arduino IDE menus.
An upload operation will start.
Wait for the operation to finish successfully.
Disconnect the USB cable of the Nano ESP32 from your computer.
Disconnect the jumper wire from the "B1" and "GND" pins on the board.
Connect the Nano ESP32 to your computer with a USB cable.
You should now find that the IDE lists a port for the Nano ESP32 board and that you can upload sketches to that port as usual.
Please let me know if you have any questions or problems while following those instructions.
Thank you for your help and effort so far. Alas, it still doesn't work. Jumpered GND and B1 as described, selected the port (as almost always /dev/ttyATCM0 ) and uploaded bootloader via esptool, which took only ~1 sec. Nothing changed, the serial monitor is still flooded with "Invalid header 0xfff...." and no sketch can be uploaded. I'd record a video from this if that helps.
Dear Forum,
I got some news on this topic and maybe these are helpful for others, too!
I've been able to manage to restore the ability to upload sketches. So for the time being, my little Nano ESP 32 is back to work. I still wonder why it went berzerk and refused working in Arduino C++ mode altogether. Here's what I did:
a) connect B1 and GND pins, attached Nano ESP32 to USB
b) open a blank sketch in Arduino IDE
c) select Board and Port (already selected in my setup)
d) selected esptool as the programmer
e) drumroll did not hit "upload" in the Sketch Menu but "upload using Programmer".
f) unpowered Nano ESP32 and re-connected with USB
The Nano behaved peacefully and I could get it into upload mode by pressing RST twice. Uploaded the WiFi scan sketch and it worked right away!