Arduino 33 IOT does not respond

Hello everyone, I have a big problem: After I want to load my code on the Arduino, the Arduino does not respond anymore. Windows no longer recognises it and lists it as an unrecognised device, I can no longer select a port in the Arduino IDE, the reset function does nothing. Is there a way to make it accessible again? - I had already bought a second Arduino with the same problem, so I can rule out a hardware defect. Code with which the error occurred:

#include <TinyGPS++.h>
#include <TinyGPSPlus.h>
#include <RTClib.h>
#include <Adafruit_NeoPixel.h>

#ifdef AVR
#include <avr/power.h>
#endif

#define NUMPIXELS 19

Adafruit_NeoPixel pixels(NUMPIXELS, 3, NEO_GRB + NEO_KHZ800);
RTC_DS3231 rtc;
TinyGPSPlus gps;

void setup() {
#if defined(AVR_ATtiny85) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif

Serial.begin(9600);
Serial1.begin(9600);
pixels.begin();
pixels.clear();
}

void loop() {
DateTime now = rtc.now();

Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();

for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(0, 1, 0));
pixels.show();
}

delay(500);
}

Hi @grueneinsel. The tricky thing about the boards with native USB capability like your Nano 33 IoT is the USB code that creates the CDC serial port is running on the same microcontroller as your sketch. This means your sketch code can break the USB code, or stop it from running. When that happens, it no longer presents a port.

This can be unexpected to those who previously mainly worked with the boards like Uno and Mega with a dedicated USB chip that can never be affected by the sketch code.

The missing port makes it so you can't upload normally any more. However, the situation is really not so bad because there is an independent program called the bootloader in a separate section of memory from your sketch, and that program has its own USB CDC code. So even if the sketch is completely broken, you only need to activate the bootloader and you will get a port back and be able to upload.

Fortunately, there is an easy way to activate the bootloader and recover from this situation:

  1. 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 reset causes the bootloader to run until the board is reset normally, powered off, or an upload is done.
  2. Select the port of your board from the Tools > Port menu in the Arduino IDE.
    The port number may be different when the bootloader is running so don't assume you already have the correct port selected.
  3. 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 use the reset button technique.

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.

2 Likes

You appear to have messed up the bootloader. Try double tapping the reset button fast and check the status of the onboard "L" LED. If the onboard LED fade in and out slowly (pulsating), upload an example sketch (Blink LED) from the IDE to the board.

After this, unplug it and then plug it back to your PC and make sure that you select the board and the port it is connected to before uploading a sketch.

1 Like

Thank you :smiley: This has solved my problem

Thank you :smiley:

You are welcome. I'm glad the problem is solved now. Enjoy!

With a messed up bootloader, that is not likely to work :wink:

See @in0's reply for the details.

1 Like

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