XIAO-RP2040 was bricked by simple sketch

I had this code working on an Arduino Nano and I tried to move it over to this MCU reading temperature on digital input 0. I purchased three of these and I just bricked two of them after attempting to download this sketch with Arduino IDE. The only thing I changed was the pin number for 2 to 0. Is there any way to recover so I can download another sketch or is it scrap metal. I thought I had mis-wired something so I tried downloading to a 2nd MCU so I’ve already lost 2 of 3 that I purchased. I was using Arduino IDE 2.2.1

/*
Seed Studio XIAO RP2040
*/

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 0

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup(void)
{
  Serial.begin(9600);
  sensors.begin();
}

void loop(void){ 
  sensors.requestTemperatures();
  
  Serial.print("TS1: ");
  Serial.print(sensors.getTempFByIndex(0));
  Serial.println(" F");

  Serial.print("TS2: ");
  Serial.print(sensors.getTempFByIndex(1));
  Serial.println(" F");
}

i think the RP2040 is supposed to be programmed in micropython

Not according to their web page. It was actually fairly straightforward to download board drivers and another program which worked fine.

You may need to include a delay() in the loop() section of your program, so the serial port could listen to enter bootloader mode.

Have you tried to enter bootloader mode by pressing the BOOT and RESET buttons?

1 Like

sketch is very bare bones, may need to add some erroro handling
i always sudgest using all seeed products when posable

take a look at the code for this one and see if you can get some clues of the programming

Hi there,
You must be sure to select the Board type each and every time you upload, Sounds like it had the wrong board selected.
Simply unplug from computer USB, PRESS the BOOT button and hold it while plugging the USB back in. You should hear the windows device connected DONG and be ready to go again if not Press the RESET button and Select the Appropriate com port and try the download again. It may take a few tries.
YMMV
HTH
GL :slight_smile: PJ

1 Like

That is an issue I’ve had with the Seeeed Xiao ESP32-C3. Way too much falderall between compiles (button pushing / re-selecting device/ etc). Never an issue with the original Seeed Xiao or any other micro-controller in the dozen or so different types I’ve used over the years, including a few different versions of ESP32’s. Something is not as right at is could/should be in that area. Two recent project started out with a Seeeed Xiao ESP32-C3 but ended up with a different micro-controller due to this unwelcome situation. Any real life development / debug cycle, especially without a decent debugger, WILL result in many many compiles & reloads. The above mentioned issues just cannot be tolerated.

1 Like

Yes I prototype with the XIAO SAMD21 and XIAO Expansion Board

with WIFI enabled Boards, consider Arduino OTA update
and installing a heartbeat or end(0); end program execution command
you can set it on a timer, lets say 5 minutes after you start the test program the program will automaticly drop out of execution

this will sometime allow you to get the attention of the processor and it will allow an upload

No idea what that has to do with the subject.

Hi there,
Yes, I feel your Pain. (I don’t know looks like a sales pitch) :wink: I can say after using ALL of the SEEED mcu’s , If you botch the Initial selection in the IDE , or in the case of the ESP32C3 (probably the most sensitive) if You give it bad code resulting in a BOOT LOOP a reload will be hit or miss without the button shenanigans. I usually only have to press the buttons for the initial Upload Waiting prompt in the case of the ESP32C3, The Nrf52 Xiao’s don’t have that issue , UNLESS you switch from Non-embed to or from Embed BSP’s. YMMV

Bottom line is, for me It’s 99% an issue between the keyboard and the Floor.
My opinion is the Arduino IDE is not SEEED friendly. PlatformIO is much better and the debugger works.
my .02
HTH
GL :slight_smile: PJ

PS> I even developed a RESET button cover for the NRF’s after my initial foray.i.e don’t use a scalpel :v:

2 Likes

Well, if it is self induced, I don’t have that issue with any other micro-controllers. As for PlatformIO, I’ve used it, it has it’s own set of issues and I no longer use it. I spent a career developing software & used many platforms both HW & SW so I have a pretty good idea what is and isn’t up to snuff. When tools or platforms get excessively in the way I go to others when I can. I have no problem using either a scalpel or a sledge hammer when it’s appropriate.

2 Likes

Thats Awesome!, yes i am getting ready to try to switch over to platform io because i am tired of hurry up and wait for arduino IDE… also the IDE automaticly opens the wrong sketch every time…