Go Down

Topic: RobotDyn SAMD21 MINI seems dead after bootloader upload (Read 523 times) previous topic - next topic

TheRealdps

So, I was doing something foolish and trying to get my RobotDyn branded SAMD21 MINI boardto take circuitpython, so I tried following the instructions to do so from the Adafruit website and I downloaded the .ino for one of the feather M0's, and then uploaded it.
  The board responded to the update, doing the usual signs of rx and tx, but then the board blinked a few more times, and the blue light faded out. I unplugged it and then plugged it back in, and the boards "on" light is on, but not the other three, "L, TX and RX".
  It doesn't show up in the IDE ports selection any more, neither does it show up in my system via
Code: [Select]
lsusb.

I do however notice that when I touch the D13 pin, the "L" led slowly lights up, and then dims down again upon not touching it.
  The reset button has no effect.
    Any ideas?

pert

Try this:
  • Press the reset button on your board quickly twice. You should now see the LED on the board pulsing, which means the bootloader is running. The double press causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done), which means you don't need to get the timing of the reset just right.
  • Select the port of your board from the Tools > Port menu. The port will be different when the bootloader is running so don't assume you already have the correct port selected.
  • Start an upload in the Arduino IDE.

The upload should now finish successfully. After this, you should be able to go back to doing normal uploads without needing to press the reset button. If you still need to do the reset trick to do uploads after this, the problem may be caused by your code. You can verify this by uploading a simple sketch like File > Examples > 01.Basics > BareMinimum.

TheRealdps

I keep trying to do the "double click" trick with the reset button, but nothing happens. The light doesn't begin to flash, and nothing shows up in my ports.
  I was uploading a new bootloader to my board when this happened, if that helps out at all.

pert

Unfortunately, I don't have any experience with the SAMD21 MINI board or CircuitPython. I would not expect that you could change the bootloader by uploading a .ino file to your board so I'm a bit confused. Please post a link to the instructions you were following on the Adafruit site so I can learn more about this.

TheRealdps

Its this page, https://learn.adafruit.com/installing-circuitpython-on-samd21-boards?view=all
 If you scroll down some, it gives you a link and tells you to go there and find the .ino file, and download it.

Quote
Newer releases of the UF2 bootloader are found at the top of the page. Find the .ino file with your board's name and with the newest version number. The file will have the following naming scheme (with [your board's name] replaced by the name of your board and vx.x.x-adafruit.x replaced by the newest release number):

update-bootloader-[your board's name]-vx.x.x-adafruit.x.ino

For example, if you wanted to download the UF2 installer for the Arduino MKRZero, you would look for a filename like update-bootloader-mkrzero-vx.x.x-adafruit.x.ino. Click on that name to download the .ino file.
and then it goes on to say this:
Quote
Upload UF2 with Arduino

In Arduino, click on File > Open..., and locate your downloaded .ino file. Select it, and click Open. If you get a pop-up window stating that the file "needs to be inside a sketch folder" with the same name, click OK.
Now I think I see what you're saying, or maybe I'm just confused. It says to upload the .ino file, but it's describing the ino file a a UF2.

But yeah, those are the exact instructions that I followed to do it.

pert

Cool! I didn't realize you could update the bootloader by uploading an Arduino sketch to the SAMD boards. That's very interesting. I'm still a bit new to the SAMD boards. Most of my experience is with the AVR boards, but I'm learning more about SAMD every day.

It does seem to be a bad sign that the LED is not pulsing after you do the double reset, as the instructions say that should happen even after installing the UF2 bootloader. It is possible that the Feather M0 board whose bootloader file you used has the LED on a different pin than your RobotDyn branded SAMD21 MINI board though. Do you see the board present as a drive in your file system, as described by the instructions?


TheRealdps

#6
Aug 20, 2019, 07:19 pm Last Edit: Aug 20, 2019, 07:31 pm by TheRealdps
Nice!
 But, no. It no longer shows up at all, even with
Code: [Select]
lsusb
.
 I was thinking that maybe when I uploaded the code to the board, it changed the pinout completely, and changed it to the feather boards pinout, and thus, my onboard usb is wired to somewhere else lol. Do you know if I am able to program this board another way? The ICSP was unpopulated when I got it, but I threw some headers in there. But there was also these other pins on the boards, right below the ICSP... its like 8x2 or 2x8, and really small compared to the other pins.

Also, if it makes any difference, I have this USB to TTL serial adapter. I used it to program my ESP32's that I have, and it also has a bunch of other pins on it that I have no idea what they're for lol. Here's the exact product: https://www.amazon.com/gp/product/B00IJXZQ7C/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1

TheRealdps

Hmm,so I just hooked the M0 up to a Nano, via the ICSP pins, and the M0 board actually lights up as it should, and when I press the reset button on it, the "L" light on the nano lights up  I have the nano connected to my PC).
  I was trying to follow a tutorial from spark fun, that said I could use an UNO to program the other board via the ICSP, by using the Arduino as ISP code. But of course, it failed saying "Unsupported board". I figured it would, as I'm trying to use a Nano and not a Duo.
   Is there any way that I can re-burn the original boot loader onto it, without having to buy something like the ICE programmer?
  Whats kind of cool is, when I selected "Arduino as ISP", it showed up as the bootloader for the SAMD21 chip I was trying to program. Is that what that sketch is soley for?

Juraj

the ICSP header is for SPI only.

the small header is for attaching a programmer. only two pins are important: SWCLK and SWDIO. the ground can be wired to any ground pin. but you need a programmer or other SAMD board.

Robotdyn M0 Mini is small version of Arduino M0. https://store.arduino.cc/arduino-m0

TheRealdps

What programmer can I use? I found one on amazon, that has a 10 pin connector, which is what the board that I have has (cortex debugger/programmer pins-per the official RobotDyn site). You said that I can use another SAMD board to program it again? I have a few more of the same exact board (9 to be specific), but I can purchase a programmer if you could suggest one for me.

Juraj

What programmer can I use? I found one on amazon, that has a 10 pin connector, which is what the board that I have has (cortex debugger/programmer pins-per the official RobotDyn site). You said that I can use another SAMD board to program it again? I have a few more of the same exact board (9 to be specific), but I can purchase a programmer if you could suggest one for me.
I have this one https://www.embeddedartists.com/products/lpc-link2/

before it I used https://learn.adafruit.com/programming-an-m0-using-an-arduino/overview# once. with luck

@pert has more info to this topic

pert

Definitely give that Adafruit_DAP library at the second link Juraj provided a try. That should turn a spare board into a programmer. I didn't have any luck using it, but Juraj and one other forum member have reported to me that it worked for them so my problem may well have been user error.

What I did find to work for me in the end was one of the JLink clones you can buy on eBay for ~$5 USD w/ free shipping from China with the Adalink script:
https://github.com/adafruit/Adafruit_Adalink

Here's an example of the programmer I used successfully:
https://www.ebay.com/itm/303205116546
I only wanted the JLink to be able to flash the bootloader to the MKR boards I managed to "brick" by messing up the bootloader. I don't know if it's good for any other purpose.

TheRealdps

ah, thank you guys so much. I'm grabbing coffee and going to get this done. I'll report back my findings

TheRealdps

I have this one https://www.embeddedartists.com/products/lpc-link2/

before it I used https://learn.adafruit.com/programming-an-m0-using-an-arduino/overview# once. with luck

@pert has more info to this topic
When you used the method that is in that Adafruit link, did you also use the "flash from SD"? Or can I configure it to flash directly through?

pert

When I tried to use the Adafruit_DAP library, I used the flash_from_SD example sketch. The reason is that I was trying to flash the MKR boards bootloaders and that seemed like the easiest solution, since I was using a MKR board with an onboard SD card reader anyway. I didn't try the other methods.

Go Up