"Bricked" Arduino M0

Hello,

I was trying to code on an Arduino M0 clone board the RTC in mode 0, clocked from GCLK4, clocked form DFLL48M without prescaling to generate an interrupt every second (ie. comp = 48 000 000)

After loading the code, I can't communicate with the board anymore and can't upload a sketch. Apparently either the RTC configuration broke the USB com or the board is "too busy" to answer.

I don't have an Atmel programmer to try this way.

What can I do?

Hi mrguen,

Have you tried double tapping the reset button (two presses in quick succession)? This will place the microcontroller in bootloader mode.

Entering bootloader mode, the board will reconnect on a different COM port, so it will be necessary to manually select the new port in the Arduino IDE before uploading as usual.

Normally, an Arduino sketch is monitoring COM port in the background and will auto upload when it senses that the IDE has set the baud rate to 1200bps. However, if your sketch crashes for whatever reason, the auto upload will fail. In this instance it's necessary to place the microcontroller in bootloader mode in order to recover.

@MartinL Thanks for your answer. Yes I tried the double reset. Here is what I get:

Try 1:

  • Plug the board: enumerates "COM5 (Arduino M0)"
  • Press the load button: Hangs after "Forcing reset using 1200bps open/close on port COM5"
  • After let say 1 minute double press reset: prints

PORTS {COM1, } / {COM1, } => {}
PORTS {COM1, } / {COM1, } => {}
...
"Couldn't find a Board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload."

Try 2

  • Don't plug the board
  • Press the upload button and plug the board just when the compilation finishes, to try to avoid hanging because the board is busy. Indeed it goes a little further, but fails:

"PORTS {COM1, } / {COM1, } => {}
PORTS {COM1, } / {COM1, COM5, } => {COM5, }

Found upload port: COM5

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -PCOM5 -b57600 -Uflash:w:C:\Users\TG\AppData\Local\Temp\arduino_build_269424/SimpleRTC.ino.hex:i

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM5
Using Programmer : stk500v2
Overriding Baud Rate : 57600
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
"

Have you tried plugging in the board, allow the COM port to enumerate, then double tap the reset button to place the microcontroller into bootloader mode. Your board should re-enumerate, before selecting the new COM port and then attempting to upload a new sketch?

Also, at this stage its best to upload a known working sketch such as "Blink", to ensure that everything's working OK again.

yes, it does not re-enumerate. I suppose the code brakes the USB support. I have seen re-enumeration when the sketch uploaded successfully.

Anyway I bought an atmel ICE from aliepxress (PCB in case + cables). I suppose that I will be able to program it in any case?

But if someone has any method to avoid the sketch code to launch that might be interesting.

When you burn the new bootloader on your Arduino M0, it might be worth considering switching to either the Arduino Zero, or Adafruit M0 UF2 bootloader. Both are really robust, I've never had an issue with either of them.

I could solve the problem by getting this device https://fr.aliexpress.com/item/32968876164.html
Here is my experience:

  • First surprised because I did not know how to connect the small 2*5 connector since I was not really certain of the pinout. This sentiment was reinforced because I could not find Vcc on any pins.
  • Finally, I suppose this was done on purpose to avoid any wrong connection. The board to program has to have its own power.
  • Also badly surprised by having to install a 1 Gb resource, the Microchip Studio for SAM and AVR devices to get the drivers. The installation is heavy and takes quite a lot of time.
    After this the programmer was correctly enumerated as a "Microchip Tools/ Atmel ICE Data Gateway» and I could upload the bootloader and use again the board.
    Now it enumerates directly as an "Arduino M0 native port".
    Of course, the need to power the board while programming it with Atmel ICE is not very nice and I will probably continue using the USB/bootloader upload option.
    Thanks for the help.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.