Arduino Nano RP2040 Connect doesn't upload correctly

I've just bought a Nano RP2040 connect but I can't upload my code.

At first the Code seems to be uploading fine IDE says upload complete in the end. However my Arduino isnt recognized by the Arduino IDE after uploading => I can't use Serial monitor. The onboard LED also flashes with 4 long pulsed and 5 short ones repeating. I can only get the Arduino to be recognized by factory resetting it using the mass storage mode and copying the .uf2 file from the Arduino documentation into it.

After some Troubleshooting i was able to upload the blink sketch to it succesfully. I was even able to modify the blink sketch to tell me in Serial monitor when the led is on and when not.

However if i try to upload the sketch ive written it just doesnt work.

I've disconnected everything from the arduino to rule out any mistakes there.

I'm using Windows 11
I've tried using IDE 2.0.0-rc6 and IDE 1.8.16 with the same results.
I've tried multiple USB Cables and USB Ports

Here's my Code: It worked wthout any problems on a normal arduino Nano.

const float temprangemin = 218.15;    //Temperature Range of thermistor in Kelvin
const float temprangemax = 398.15;

const int NrOfSensors = 6;    //Define Number of Sensors connected to the Analog Pins of the Arduino

const int TempUnit = 2;   //Choose which Unit the Temperature will be printed in, 1 for Kelvin, 2 for Celcius, 3 for Fahrenheit

const int ErrorLedPin = 13;

float temp[NrOfSensors + 1][3];

bool Error[NrOfSensors];
bool IsError = 0;

void setup(){

  Serial.begin(115200);

}

void loop(){

  IsError = 0;
  
  for(int i = 0;i <= NrOfSensors - 1;i++){    //Read Temps from all sensors and prints them
    ReadTemp(i);
    Serial.print("Temp");
    Serial.print(i + 1);
    Serial.print(": ");
    Serial.print(temp[i][TempUnit]);
    Serial.print("°C Error: ");
    Serial.println(Error[i]);

    if(Error[i] == 1) {
      IsError = 1;
    }
  }

  if(IsError == 1) {
    digitalWrite(ErrorLedPin, HIGH);
  }
  else {
    digitalWrite(ErrorLedPin, LOW);
  }
  
  Serial.println(" ");
  delay(500);
  
}

void ReadTemp(int Pin) {
  
  int tempReading = analogRead(Pin);
  double tempK = log(10000.0 * ((1024.0 / tempReading - 1)));
  tempK = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * tempK * tempK )) * tempK );       //  Temp Kelvin
  float tempC = tempK - 273.15;            // Convert Kelvin to Celcius
  float tempF = (tempC * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit

  if(tempK > temprangemin && tempK < temprangemax) {
    temp[Pin][1] = tempK;
    temp[Pin][2] = tempC;
    temp[Pin][3] = tempF;    
    Error[Pin] = 0;
  }
  else {
    temp[Pin][1] = 0;
    temp[Pin][2] = 0;
    temp[Pin][3] = 0;    
    Error[Pin] = 1;
  }
  
}

Any help is appreciated.

Please provide a detailed explanation of what you mean by this, including:

  • What did you do?
  • What were the results you expected from doing that?
  • What were the results you observed that did not match your expectations?
    • Make sure to include the full and exact text of any error or warning message you might have encountered.

First step I would take is to upload the Blink without delay example.

Hey thanks for your suggestion!
The Blink without delay example works without any problems.

However if I try to upload my Code then it uploads like normal. But the Arduino isn't recognized by my PC anymore.

Here's the Output Code when uploading:

Using board 'nanorp2040connect' from platform in folder: C:\Users\Felix\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.1
Using core 'arduino' from platform in folder: C:\Users\Felix\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.1
Verwendete Bibliotheken erkennen...
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/defines.txt" "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/cxxflags.txt" -DARDUINO_ARCH_RP2040 -mcpu=cortex-m0plus -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED_NANO -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino/api/deprecated-avr-comp" "-iprefixC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino" "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/includes.txt" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\sketch\\Code_Thermistor.ino.cpp" -o nul
Generating function prototypes...
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/defines.txt" "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/cxxflags.txt" -DARDUINO_ARCH_RP2040 -mcpu=cortex-m0plus -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED_NANO -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino/api/deprecated-avr-comp" "-iprefixC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino" "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/includes.txt" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\sketch\\Code_Thermistor.ino.cpp" -o "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/defines.txt" "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/cxxflags.txt" -DARDUINO_ARCH_RP2040 -MMD -mcpu=cortex-m0plus -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED_NANO -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=0 "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino/api/deprecated-avr-comp" "-iprefixC:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\cores\\arduino" "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/includes.txt" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\sketch\\Code_Thermistor.ino.cpp" -o "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\sketch\\Code_Thermistor.ino.cpp.o"
Bibliotheken werden kompiliert...
Compiling core...
Zuvor kompilierte Datei wird verwendet: C:\Users\Felix\AppData\Local\Temp\arduino-sketch-3443D04F54DED88F406C803D1D637902\core\double_tap_usb_boot.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\Felix\AppData\Local\Temp\arduino-sketch-3443D04F54DED88F406C803D1D637902\core\nina_pins.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\Felix\AppData\Local\Temp\arduino-sketch-3443D04F54DED88F406C803D1D637902\core\variant.cpp.o
Using precompiled core: C:\Users\Felix\AppData\Local\Temp\arduino-core-cache\core_arduino_mbed_nano_nanorp2040connect_37febed2fbf2765ed681ad4808c0c482.a
Linking everything together...
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -E -P -x c "C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/linker_script.ld" -o "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/linker_script.ld"
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" "-LC:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902" -Wl,--gc-sections -w -Wl,--as-needed "@C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/ldflags.txt" "-TC:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/linker_script.ld" "-Wl,-Map,C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.map" --specs=nosys.specs -o "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.elf" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\sketch\\Code_Thermistor.ino.cpp.o" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\core\\double_tap_usb_boot.cpp.o" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\core\\nina_pins.cpp.o" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902\\core\\variant.cpp.o" -Wl,--whole-archive "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/..\\arduino-core-cache\\core_arduino_mbed_nano_nanorp2040connect_37febed2fbf2765ed681ad4808c0c482.a" "C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_nano\\3.0.1\\variants\\NANO_RP2040_CONNECT/libs/libmbed.a" -Wl,--no-whole-archive -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.elf" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.bin"
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.elf" "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.hex"
"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\imgtool\\1.8.0-arduino/imgtool" exit


"C:\\Users\\Felix\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-size" -A "C:\\Users\\Felix\\AppData\\Local\\Temp\\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.elf"
Der Sketch verwendet 82322 Bytes (0%) des Programmspeicherplatzes. Das Maximum sind 16777216 Bytes.
Globale Variablen verwenden 43608 Bytes (16%) des dynamischen Speichers, 226728 Bytes für lokale Variablen verbleiben. Das Maximum sind 270336 Bytes.

--------------------------
Compilation complete.
Performing 1200-bps touch reset on serial port COM4
"C:\Users\Felix\AppData\Local\Arduino15\packages\arduino\tools\rp2040tools\1.0.2/rp2040load" -v -D "C:\Users\Felix\AppData\Local\Temp\arduino-sketch-3443D04F54DED88F406C803D1D637902/Code_Thermistor.ino.elf"
rp2040load 1.0.1 - compiled with go1.15.8
.Loading into Flash: [                              ]  0%
Loading into Flash: [=                             ]  4%
Loading into Flash: [==                            ]  8%
Loading into Flash: [===                           ]  13%
Loading into Flash: [=====                         ]  17%
Loading into Flash: [======                        ]  22%
Loading into Flash: [=======                       ]  26%
Loading into Flash: [=========                     ]  30%
Loading into Flash: [==========                    ]  35%
Loading into Flash: [===========                   ]  39%
Loading into Flash: [=============                 ]  44%
Loading into Flash: [==============                ]  48%
Loading into Flash: [===============               ]  52%
Loading into Flash: [=================             ]  57%
Loading into Flash: [==================            ]  61%
Loading into Flash: [===================           ]  66%
Loading into Flash: [=====================         ]  70%
Loading into Flash: [======================        ]  74%
Loading into Flash: [=======================       ]  79%
Loading into Flash: [========================      ]  83%
Loading into Flash: [==========================    ]  88%
Loading into Flash: [===========================   ]  92%
Loading into Flash: [============================  ]  96%
Loading into Flash: [==============================]  100%



--------------------------
upload complete.

Apart from that I havent recieved any Error Messages.

Next I would comment out all the signal calculations and print out the raw analog input signal.

Better yet, run the example Analog input sketch to be sure the basics work.

Take a look at https://support.arduino.cc/hc/en-us/articles/4404168794514-Nano-RP2040-Connect-not-being-detected-on-USB-port. Make sure your sketch is properly written to avoid uploading one that will mess up your board's bootloader.

I just found the problem in my Code.

Orignially i wrote the Code for an Arduino Nano, which has a 10 Bit ADC.
The Arduino Nano RP2040 Connect however has a 12 Bit ADC.

The program tried to calculate the natural log of a negative number, which is undefined.
This seems to have crashed the Arduino without any Errors.

Thanks for your help!

Hi, i am having the exact same issue. How did you change the ADC? Im pretty new to Arduino. Thank you

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