Unable to upload Sketch to Arduino Nano RP2040 Connect

Hello, I just tested my pretty new Arduino Nano RP2040 Connect for the first time and am unable to upload sketches to it.

From what I observe, what happens seems to be the following:

  • I put the Arduino into the programmable mode by clicking the reset button once and the attached LEDs start flickering as expected
  • I click on the "Upload Sketch" button and the compilation (of some pretty empty program) succeeds
  • Automatically, just before the upload starts, the Arduino (or at least the connection to it?) gets reset
  • However, after the aforementioned reset, the Arduino boots in non-programmable mode again (signalized by only the greed LED constantly being switched on) and as a consequence the upload of the sketch fails

Does anyone know how to fix the above course of events?

  • For instance, is there a way (e.g. using the reset pin in some way) to make the Arduino boot in programmable mode after the automatic reset described above?

  • Alternatively, I read across the internet already that another option might be overwriting, thereby emptying, the Arduino's current bootloader. However, I don't know how reasonable that advice would be here since I don't understand underlying issue enough yet.

Last but not least, I'd be curious as well to find out about why the issue described above is happening at all in the first place and (if applicable) how to prevent it from happening in the future again.

Kind regards and thanks in advance!

Have you verified the IDE: TOOLS >> PORT >> (your port) and TOOLS >> BOARD >> (your board)? Also, copy/paste the IDE errors you are observing?

I'm afraid the error message isn't very helpful here given its generality:

...
/home/<...>/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-size -A /tmp/arduino_build_664146/sketch_jun19a.ino.elf
Sketch uses 78762 bytes (0%) of program storage space. Maximum is 16777216 bytes.
Global variables use 43444 bytes (16%) of dynamic memory, leaving 226892 bytes for local variables. Maximum is 270336 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
/home/daniel/.arduino15/packages/arduino/tools/rp2040tools/1.0.2/rp2040load -v -D /tmp/arduino_build_664146/sketch_jun19a.ino.elf 
rp2040load 1.0.1 - compiled with go1.15.8
.....................
An error occurred while uploading the sketch

And that's in verbose mode already when uploading a sketch as simplistic as the pretty empty one:

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

However, what's more interesting is the aspect about selecting the port, indeed!

Of course, I made sure that the port is set correctly when starting the upload. However, what I observe is that the Arduino's port becomes unavailable directly after the automatic reset I described in my previous message. Only when I click the reset button on the Arduino manually again, the Arduino's port becomes available/accessible again via the Arduino IDE (together with the Arduino itself going back into blinking mode with respect to its LEDs). And another thing is that I get a notification on my desktop that some mass storage device has been detected after the aforementioned auto-reset. Thus, when the Arduino is automatically reset during the onset of the upload (after compilation of a sketch), it seems to boot into a mode where the IDE isn't able any longer to upload data to it, while its mass storage becomes available in turn.

Does your hardware manager show the hardware inserted and then not inserted when these failures occur? Some (not many) people have found bad USB cables.

[edit]
And did you see this...

[/edit]

Thanks for your answer. However, the problem I was facing was rather tied to my Linux OS as it seems. I found this YouTube Tutorial, where exactly the problem I was facing is documented. The answer suggested in the video actually worked for me.

The solution boiled down to executing some post-install script on my Linux (Ubuntu 20.04) machine. For me, the script was located at .arduino15/packages/arduino/hardware/mbed_nano/3.1.1/post_install.sh (starting in the home directory) and could directly be executed using sudo:
sudo .arduino15/packages/arduino/hardware/mbed_nano/3.1.1/post_install.sh.
Disclaimer: Before trying to execute the above command, please make sure the script is located at the same path for you as well. Expecially, the version 3.1.1 stated in the above path might vary for other users depending on the version of mbed_nano they've installed.

That was a good find! And fix. I run Linux (32 bit and 64 bit). A post months ago had the definitive installation. I have not had any similar problems.

This also helped me to successfully upload code to my Arduino rp2040 Connect under Ubuntu 22.04 in VMware virtual machine! Thanks.