Notifications
Clear all

Bricked XIAO ESP32 C3 After Upload

8 Posts
2 Users
0 Reactions
1,858 Views
(@patapom)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

Help! I bricked 2 (TWO!) XIAOs in a row doing the same mistake twice!

I'm using Platform IO with VSCode but I'm pretty sure it would have been the same using the Arduino IDE.

Originally, my XIAO was successfully showing as /dev/ttyAMA0 on my Ubuntu machine.

I connected the XIAO to another device that communicates using UART like so:

image

 

Then :

  • I plugged the XIAO to my PC via USB (as I usually do to upload my compiled code)
  • I compiled and uploaded my new code to the XIAO successfully
  • It performed a hard reset (as it usually does after a successful upload)
  • Then I got an error saying it couldn't find the device as /dev/ttyAMA0 anymore

And indeed, the device is not showing anymore.

I tried various USB cables and on my Windows machine too but it says there's an issue with the USB device that is not recognized.

I had no problem so far — compiled and uploaded several versions of the same code— I suspect it happened when I connected the RX/TX pins, which are probably not used for the purpose I thought. 😓 

Help! I've lost my XIAOs! I can't talk to them anymore... 😱 

How can I recover from this bricked state, please?



   
Quote
(@davee)
Member
Joined: 5 years ago
Posts: 2069
 

Hi @patapom,

  I haven't used any Xiao boards, and I haven't had to 'debrick' an ESP32 board, But based on random browsing on the web, (which can obviously be good or bad!!), please take this reply at your own risk

My understanding is that ESP32 boards are usually delivered with some handy bootloader code pre-installed, which makes it easy to use the programme (probably called ESPtool), which is used by Arduino IDE.  etc. However, ESPtool, which is also available directly on the web, can be used on a board which does not have the bootloader code, (perhaps because it got overwritten by mistake), providing you tell it precisely what to do. 

Whilst you could investigate ESPtool directly, in your case SEEED, appear to have written a web page describing a method specifically for your board, so hopefully it will be easier for you!

Try looking at https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/#troubleshooting

Hopefully some combination of the first 3 questions & answers will rescue your boards.

Good luck and best wishes, Dave



   
ReplyQuote
(@patapom)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

Thank you so much, Dave! I´ll try that ASAP. 😁



   
ReplyQuote
(@patapom)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

Okay so I followed the steps and it turns out that, even after flashing the factory firmware, my device only appears when I plug it while keeping the boot button pressed...

I have no idea why it's behaving this way now, it worked fine and got detected as soon as it was plugged in before, no need for that boot button business.

I don't know what deep change my code triggered but it looks like it's now constantly in that state... 🙄 

Anyway, I have nonetheless a way to connect to it and upload my code again thanks to your precious link, it's not "bricked" after all! Thanks a lot!



   
ReplyQuote
(@davee)
Member
Joined: 5 years ago
Posts: 2069
 

Hi @patapom, 

Good to hear that you have managed to restore some sort of operation. I would have hoped flashing the factory firmware to restore it to the 'as new' state would have worked, but as I haven't personally done the procedure, I can't confirm it.

----
Sorry, if the following thought sounds patronising, but I'll mention it, just in case ...

I assume you have tried to use the 'flashed' board in its 'as it came out of the box' state, with nothing connected to any of the pins?  

ESP32's change their boot behaviour, when certain pins are held high or low at boot time ... this can be accidentally triggered by something like connecting an LED to the specific pin, if you do not realise that the pin has a 'special' role at boot time.

Random Nerd Tutorials discuss this topic for a 'standard' ESP32 on their page

  https://randomnerdtutorials.com/esp32-pinout-reference-gpios/

I haven't looked, but I guess there will be comparable restrictions for ESP32-C3, which will be documented somewhere on the web.

Good luck! Best wishes Dave



   
ReplyQuote
(@davee)
Member
Joined: 5 years ago
Posts: 2069
 

Hi @patapom,

 RE: You´re absolutely right! I need to check the pins I´ve been using...

I presume your reply ended up in the other thread by mistake ... an easy mistake to make!

------------

As I said, the ESP32 family chips change their boot up behaviour, when certain pins are 'tied' to Vdd or Ground at boot up time, and that 'tie' can be an accidental one via something like an LED, resistor, connection to another chip, etc. ... it doesn't need to be a 'zero resistance' piece of wire.

I 'guess' detecting the USB connection involves a short 'conversation' between the ESPtool program on the PC and the bootstrap programme on the ESP. Thus, if the boot up behaviour is altered by a pin being tied, the bootstrap programme will not be executed, the conversation will not happen, and hence the USB connection will not be detected.

Of course, the above paragraph is just speculation, as I haven't checked it.

Best wishes, Dave



   
ReplyQuote
(@patapom)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

Oh I did reply elsewhere? Oh god... I'm so awkward with smartphones... 😆 

Thanks for your help!



   
ReplyQuote
(@davee)
Member
Joined: 5 years ago
Posts: 2069
 

Hi @patapom,

   I manage to make similar mistakes with laptop and desktop computers, with sensible sized screens and keyboards ... I have a 100% fail rate with a smartphone, and hence my 'mobile' is normally confined to being used as a 'voice phone' regardless of what it proclaims to being capable of doing.

Best wishes, Dave



   
ReplyQuote