MKR1000 - No device found ttyACM0

Hello,

I’m unable to upload even the standard 01.Basics Blink example to a previously working MKR1000 board.

I’ve removed all Arduino board connections to the desktop (viz. Ubuntu 20.04 running IDE v1.18.13) except the one for the MKR1000 board which is now selectable from ToolsPort/dev/ttyACM0 (Arduino MKR1000) and its presence confirmed by ToolsGet Board Info with entries for BN, VID, PID & SN.

The error message during the sketch upload to the board is:

Arduino: 1.8.13 (Linux), Board: “Arduino MKR1000”

Sketch uses 11216 bytes (4%) of program storage space. Maximum is 262144 bytes.
Global variables use 2364 bytes (7%) of dynamic memory, leaving 30404 bytes for local variables. Maximum is 32768 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
Uploading using selected port: /dev/ttyACM0
/home/reza/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3/bossac -i -d --port=ttyACM0 -U true -i -e -w -v /tmp/arduino_build_248152/Blink.ino.bin -R 
No device found on ttyACM0
Set binary mode
An error occurred while uploading the sketch
Send auto-baud
Set binary mode

The port appears to have been correctly per the following command:

$ ls /dev/ttyACM*
/dev/ttyACM0

I am not at all knowledgeable about this error (and, of course, hardware errors in general). The board has worked in this environment previously. I have pressed the reset button on the board a few times since the error occurred but to no avail. I don’t have another MKR1000 board to test but testing other boards (UNO, Nano, Nano 33 BLE Sense & ESP8266) individually (by changing the board selection while the port remains the same) seems that the hardware serial port on the desktop is fine except for the MKR1000 use.

Is the MKR1000 board toast? :frowning:

Kind regards.

P.S.

I had to reinstall libraries through Board Manager. For MKR1000, I am using the library (I presume) Arduino SAMD Boards by Arduino v1.8.8.

baqwas:
I have pressed the reset button on the board a few times since the error occurred but to no avail.

It's not clear to me the exact procedure you did, so I'll provide you with some specific instructions you can try to recover your board:

The way uploads work is:

  • The Arduino IDE (or the upload tool used by the Arduino IDE) sends a signal for the microcontroller to reset.
  • The microcontroller resets.
  • The bootloader runs and waits (normally only for a short time) for an upload to start.
  • The upload tool sends the program to the microcontroller, where the bootloader writes it to flash memory.

On the boards with native USB (like the one you're using), the way the IDE signals the microcontroller to reset is by opening a serial connection at 1200 baud. There is some special code running in the background on the microcontroller that does the reset when it detects that 1200 baud connection.

In some cases, the reset code that's supposed to be on the microcontroller could be missing or not working correctly, which will mean the bootloader never runs and the upload fails with the error you're seeing. The fix is to manually reset the board.

Try this:

  • Press and release 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.

First of all, please allow me to express my gratitude and appreciation for the detailed explanation of what is happening beneath the covers and the detailed recovery steps. I've been around the block a few times and seldom have I come across someone with both types of replies to ensure that the original question is covered comprehensively. Your patience in helping newbies is commendable

Secondly, and more importantly, your steps remediated the problem at the second attempt. THANK YOU!

FWIW, I understand that it is water under the bridge now, but I did play with the board's RESET button several times but perhaps did not release it fast enough. The MKR1000 was stacked with MKR ENV, MKR GPS and MKR ETH and, as you mentioned, perhaps my amateur code didn't respect the addressable space properly. (Have to use ETH instead of WiFi but I'm using only "official" Arduino libraries). I'm from the old school (viz. Wirth) of step-wise refinement and can go back easily to the previous version of my spaghetti to debug the issue with confidence in knowing how to reset the boards thanks to you.

BareMinimum et al. from the Built-In Examples work fine now. Thanks again.

Kind regards.

You’re welcome. I’m very glad if my reply was helpful to you.

It is fairly easy to “brick” these native USB boards. People who have previously only used the boards without the native USB capability such as the Uno will be surprised by this because those boards have a dedicated chip to provide the USB interface, which makes it impossible to brick the board with your sketch (OK, there are maybe one or two exceptions).

Fortunately, it’s very easy to recover the native USB boards from this condition once you know the procedure, so it really isn’t a serious problem. Sometimes it can take a bit of work to track down exactly what part of the code is causing the problem, but in many cases this is caused by a bug that would be an issue even on a non-native USB board. It sounds like you’re using the good practices that will allow you to find the problematic code without much difficulty though.

Enjoy!
Per

1 Like