# Unable to upload Sketch to Arduino Nano RP2040 Connect

**URL:** <https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331>\
**Category:** IDE 1.x\
**Created:** [June 19, 2022, 12:42am UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331 "2022-06-19T00:42:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![explorer95](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@explorer95](https://forum.arduino.cc/u/explorer95)\
**Post date:** [June 19, 2022, 12:42am UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/1 "2022-06-19T00:42:28Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [June 19, 2022, 7:25pm UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/2 "2022-06-19T19:25:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![explorer95](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@explorer95](https://forum.arduino.cc/u/explorer95)\
**Post date:** [June 19, 2022, 10:26pm UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/3 "2022-06-19T22:26:05Z")

</div>

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

```cpp
...
/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:

```cpp
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.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [June 20, 2022, 12:00am UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/4 "2022-06-20T00:00:20Z")

</div>

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...

> **[Nano RP2040 Connect not being detected on USB port](https://support.arduino.cc/hc/en-us/articles/4404168794514-Nano-RP2040-Connect-not-being-detected-on-USB-port)**
>
> If the Nano RP2040 Connect is not recognized when connected to your computer, or fails to power up after a firmware or sketch upload, the steps outlined below can be taken to solve the issue.
> 
> Make...

[/edit]

---

<div class="post-metadata">

**Author:** ![explorer95](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@explorer95](https://forum.arduino.cc/u/explorer95)\
**Post date:** [June 25, 2022, 9:42pm UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/5 "2022-06-25T21:42:04Z")

</div>

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](https://www.youtube.com/watch?v=x7ZxZrP7f7c), 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.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [June 26, 2022, 5:28am UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/6 "2022-06-26T05:28:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![robertkovax](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@robertkovax](https://forum.arduino.cc/u/robertkovax)\
**Post date:** [November 28, 2022, 11:04am UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/7 "2022-11-28T11:04:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 27, 2023, 11:04am UTC](https://forum.arduino.cc/t/unable-to-upload-sketch-to-arduino-nano-rp2040-connect/1004331/8 "2023-05-27T11:04:53Z")

</div>

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