I had this same issue. It was strange because micropython was already on the device so I could connect with putty and interact with micropython, proof that both the RX/TX lines were working.
I then held down the boot button while plugin, and was able to reflash the device. I think that somehow my code was preventing it from working correctly as after the first time of reflashing, I no longer had to hold down the button to reflash.
Uploading firmware and MicroPyhton REPL communication uses the USB port, not the UART interface. And you do not neet to push the boot button for firmware uploading because esptool.py switches the board itself to boot mode.
I do not know an answer to the problem of @nefarious. I rarely use the Arduino environment. From the log, the board switches properly to boot loader mode, but then no software is uploaded, Could be a configuration issue with Arduino and the OS.
I have been working with this device for a while without issue and had put it aside for a month. I pull it back out and now I hit this same exact issue. Hold the boot was plugging it in allowed a once time upload but when it was done it failed to reconnect.
Workaround is to set the upload speed to 115200 (default is 921600). This seems to allow normal operation again.
What I suspect has happened is that the serial driver was updated/patched/replaced in Windows causing some incompatibility (a lot of security fixes and patches in the last few weeks from PC maker and Microsoft).
I had the same issue my ESP32-S3 XIAO but i managed to fix that by setting the serial baud rate to 115200 and go to tools>USB CDC on BOOT> Enabled!
Hope it works. Happy hacking
I was successfully able to upload a sketch using the Arduino IDE (2.3.2) running on Windows 11 Home 21H2. The sketch was this off the shelf one from the vendor website:
This sketch ran fine. In fact, it is still running and returning the current voltage across the voltage divider circuit (soldered on as per the instructions there) in the serial monitor.
When I try to upload anything now I get this error:
Sketch uses 217040 bytes (16%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13404 bytes (4%) of dynamic memory, leaving 314276 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port COM5
Connecting...
Chip is ESP32-C3 (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: ec:da:3b:be:74:5c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
A fatal error occurred: No serial data received.
Failed uploading: uploading error: exit status 2
I tried to flash the chip using Thonny as well. It recognizes the board and also returns the voltage values in the shell. I cannot stop the process though or upload a new script.
This seems irrelevant but this problem occurred after I connected the external antenna. I have since removed it.
I tried all of the suggestions here but to no avail.
HI there,
Did you do the steps outlined in order?
since your code is currently running. There is two reasons you can’t upload currently IMO, 1 your A0 wire is acting as a strapping pin.(that’s why you need to remove it)
the second is NO-Time!. If your Loop function doesn’t have any delay in it, the xiao has no idle time enough to detect the upload mode signal by the serial port (arduino IDE bounces) the serial flow control signal to indicate an incoming code upload request for bootloader speed, etc.
those are two of the most common issues that prevent upload while code is running, BTW.
Freeze it by manually putting it in BL-Mode, You know how ?
after that it will work and let you upload , be sure to set the board type and port each time regardless what the status line says in the IDE.
HTH
GL PJ
That worked! I tried those one step at a time. After step 2, I was able to upload to a different board that did not have the voltage divider circuit soldered on. Once I removed the resistors from the A0 pin on the first board, everything worked. That is too bad as I really liked being able to read battery voltage.
I also need to disconnect the USB and reconnect before anything printing to the serial monitor works.