[SOLVED] "No device found on ttyACM0": Upload fails every time in Ubuntu 20.04 LTS to Nano 33 BLE Sense

Hi, I am completely new to Arduino.

I am trying to upload sketches to my Arduino Nano 33 BLE Sense, but the process is failing every time.

OS: Ubuntu 20.04.2 LTS 64bit
Arduino IDE: 1.8.5
Arduino Agent: 1.2.3-b696989

I have tried using both the web editor and tried uploading from the IDE. It failed every time.

  • I tried to upload the micro_speech example from the Arduino_TensorFlowLite library.
  • Then I tried the magic wand example from Harvard_TinyMLx library.
  • Then I finally tried the Blink example that comes with the IDE.

Nothing worked.

The error message shown every time contains-

No device found on ttyACM0

I have done the usual setup. I can see the board connected in the web IDE, the port information is correct.

When connected, lsusb shows the device as-

Bus 001 Device 033: ID 2341:805a Arduino SA Nano 33 BLE

So my OS sees it alright.

And the web IDE shows the connecting message. So the agent sees that as well.

Here is a topic from 8 years ago that says-

[..] so after spending hours surfing and testing, the solution was incredibly simple. when i plug in the due, the baud rate is set at 115200 automatically. all i have to do is set the baud rate to 1200 before every upload and all uploads are successful from the ide!

And suggests that the baud rate of the port should be changed, like so-

stty -F /dev/ttyACM0 speed 1200 cs8 -cstopb -parenb

And the OP said that it worked.

But the user was using a different board (Mega) and a different OS (Debian 1.0.3 - 2012.12.10).

Should I do the same? Is trying that out safe?

This is the error message that I see when the yellow light on the board is blinking discretely (the board is in normal mode):

Full Error Message (IDE)
Sketch uses 83392 bytes (8%) of program storage space. Maximum is 983040 bytes.
Global variables use 43920 bytes (16%) of dynamic memory, leaving 218224 bytes for local variables. Maximum is 262144 bytes.
processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2055)
	at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
	at jssc.SerialPort.openPort(SerialPort.java:170)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more

And here's the error message that I see when the yellow light is phasing in and out smoothly (programming mode):

Full Error Message (IDE)
Sketch uses 83392 bytes (8%) of program storage space. Maximum is 983040 bytes.
Global variables use 43920 bytes (16%) of dynamic memory, leaving 218224 bytes for local variables. Maximum is 262144 bytes.
processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2055)
	at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
	at jssc.SerialPort.openPort(SerialPort.java:170)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more

And here's the output of the web IDE (board on programming mode)-

Full Error Message (Arduino Cloud)
/home/builder/opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware /home/builder/opt/arduino-builder/hardware -hardware /home/builder/.arduino15/packages -tools /home/builder/opt/arduino-builder/tools -tools /home/builder/.arduino15/packages -built-in-libraries /home/builder/opt/libraries/latest -logger humantags -fqbn arduino:mbed_nano:nano33ble -build-cache /tmp -build-path /tmp/343472908/build -verbose -prefs runtime.tools.arm-none-eabi-gcc.path=/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs runtime.tools.bossac.path=/home/builder/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2 -prefs runtime.tools.dfu-util.path=/home/builder/.arduino15/packages/arduino/tools/dfu-util/0.10.0-arduino1 -prefs runtime.tools.openocd.path=/home/builder/.arduino15/packages/arduino/tools/openocd/0.11.0-arduino2 -prefs runtime.tools.rp2040tools.path=/home/builder/.arduino15/packages/arduino/tools/rp2040tools/1.0.2 -prefs runtime.tools.nrf5x-cl-tools.path=/home/builder/.arduino15/packages/arduino/tools/nrf5x-cl-tools/9.3.1 -prefs runtime.tools.i586-poky-linux-uclibc.path=/home/builder/.arduino15/packages/Intel/tools/i586-poky-linux-uclibc/1.6.2+1.0 -prefs runtime.tools.sketchUploader.path=/home/builder/.arduino15/packages/Intel/tools/sketchUploader/1.6.2+1.0 -prefs runtime.tools.esptool_py.path=/home/builder/.arduino15/packages/esp32/tools/esptool_py/3.0.0 -prefs runtime.tools.CMSIS.path=/home/builder/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs runtime.tools.serial-discovery.path=/home/builder/.arduino15/packages/builtin/tools/serial-discovery/1.2.1 -prefs runtime.tools.arc-elf32.path=/home/builder/.arduino15/packages/Intel/tools/arc-elf32/1.6.9+1.0.1 -prefs runtime.tools.core2-32-poky-linux.path=/home/builder/.arduino15/packages/Intel/tools/core2-32-poky-linux/1.6.2+1.0 -prefs runtime.tools.avr-gcc.path=/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7 -prefs runtime.tools.x86-linux-gcc.path=/home/builder/.arduino15/packages/arduino/tools/x86-linux-gcc/7.2.0 -prefs runtime.tools.avrdude.path=/home/builder/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8 -prefs runtime.tools.esptool.path=/home/builder/.arduino15/packages/esp8266/tools/esptool/2.5.0-3-20ed2b9 -prefs runtime.tools.arduino101load.path=/home/builder/.arduino15/packages/Intel/tools/arduino101load/2.0.1 -prefs runtime.tools.xtensa-esp32-elf-gcc.path=/home/builder/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0 -prefs runtime.tools.CMSIS-Atmel.path=/home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs runtime.tools.ctags.path=/home/builder/.arduino15/packages/builtin/tools/ctags/5.8-arduino11 -prefs runtime.tools.mkspiffs.path=/home/builder/.arduino15/packages/esp8266/tools/mkspiffs/2.5.0-3-20ed2b9 -prefs runtime.tools.linuxuploader.path=/home/builder/.arduino15/packages/arduino/tools/linuxuploader/1.5.1 -prefs runtime.tools.arm-linux-gcc.path=/home/builder/.arduino15/packages/arduino/tools/arm-linux-gcc/4.9.3 -prefs runtime.tools.flashpack.path=/home/builder/.arduino15/packages/Intel/tools/flashpack/2.0.0 -prefs runtime.tools.xtensa-lx106-elf-gcc.path=/home/builder/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9 -prefs runtime.tools.arduinoOTA.path=/home/builder/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -libraries /tmp/343472908/custom -libraries /tmp/343472908/pinned /tmp/343472908/sketch_jun22a

Sketch uses 83352 bytes (8%) of program storage space. Maximum is 983040 bytes.

Global variables use 43920 bytes (16%) of dynamic memory, leaving 218224 bytes for local variables. Maximum is 262144 bytes.

Upload started

Programming with: Serial

Restarting in bootloader mode

Flashing with command:/home/ritobrata/.arduino-create/arduino/bossac/1.9.1-arduino2/bossac -d --port=ttyACM0 -U -i -e -w /tmp/arduino-create-agent426166998/sketch_jun22a.bin -R

No device found on ttyACM0

I have two questions at this point-

  1. Is this a simple permission problem where I need to run the agent and the IDE with root access to be able to use the port?
  2. Should I change baud rate as advised in that post?

What should I do? Any advice is appreciated.

Turns out it was a simple permission problem. I just ran the Arduino IDE as root, and the problem went away.

I successfully ran the Blink demo.

Instead of double click opening or running using ./arduino, I ran using-

sudo ./arduino

And that solved this problem.

I am yet to run the TinyML demos but hope that they will run successfully. If not I can always add another topic.

There is an installation script that comes with the "Arduino Mbed OS Nano Boards" platform of the Nano 33 BLE Sense. It is located here:

~/.arduino15/packages/arduino/hardware/mbed_nano/2.2.0/post_install.sh

If you run that script then it should configure the port so that you can use it without being superuser. The script actually runs when you install the boards platform, but the script itself must be ran as superuser, so it will not make the necessary changes if you install the boards platform without first starting the Arduino IDE with sudo, as you did.

There is no folder called arduino15 in my $HOME directory.

I have tried searching anything from Arduino, like so-

ls -a | grep arduino

It returns only one folder- .arduino-create. I believe this is the folder for the agent that works with the cloud IDE.

These are the contents of the .arduino-create/arduino folder-

bossac fwupdater rp2040tools

I am also unable to locate the said script elsewhere. Do you know what is happening and what should I do next?

Edit: Mentioning @pert

I have the same problem:

$ sudo /home/cdupont/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3/bossac -p /dev/ttyACM0 -R -e -w -v -b /home/cdupont/zephyrproject/zephyr/build/zephyr/zephyr.bin
No device found on /dev/ttyACM0

The yellow light is blinking smoothly in and out. I've set up the port to 1200 baud rate:

$ stty -F /dev/ttyACM0 speed 1200 cs8 -cstopb -parenb
1200

However, I always obtain the same message: "No device found on /dev/ttyACM0".

OK, I solved the problem. I found a more recent version of bossac on my system:

/home/cdupont/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2/bossac

With this version, it worked.

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