MKR WiFi 1010 Upload error "No device found on COM5" (Oplá IoT Kit)

Hi,
i've just bought an Oplá IoT Kit and wanted to start with uploading a sketch on the included MKR WiFi 1010.
But I got this Error: No device found on COM5.
(With and without plugging it into the IoT Carrier)
I've just read a post about double clicking RST button and then uploading a sketch.
First, this worked fine, but by trying to upload another sketch, I got the same error.
After a few tries, I noticed that I can only upload a sketch in bootloader mode.
This is bad, because with this error, it cannot connect to the IoT cloud.
Can somebody help?

Here are some details:

  • I'm using Windows 11 (64-Bit)
  • Arduino IDE 1.8.19 (From Windows Store)
  • The CHRG led of my MKR Wifi 1010 flashes when plugging in, then you can hear the Windows "device pulgged in" sound. Sometimes, the LED stays on with no flashing and you cannot hear the sound.
  • I'm using COM5 because in device manager, it says "Arduino MKR WiFi 1010"
  • Device manager also says, the device requests more installations. What does this mean?
  • In the port selection (COM5), no board name is shown. When the MKR is in bootloader mode, you can see the name. The bootloader port is COM6.

The tricky thing about the boards with native USB functionality like your board is that 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 that have 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 recover from this situation, which is the double reset technique you have already learned.

Since the problem with the port persists, it is likely that it is caused by something in your sketch code. You can verify this by uploading a simple sketch like File > Examples > 01.Basics > BareMinimum.

If the port works as expected with a simple known good sketch such as BareMinimum, then you know the problem is with your other sketch and you can start working on finding the error. If you would like help with that, you can post the sketch here.

Hi,
I've tried to upload the BareMinimum while running the bootloader and it worked.
Then, I tried to upload the BareMinimum again and I got the same error.
Is this caused by the chip firmware or by the IDE?

After uploading the BareMinimum sketch, while the board is not in bootloader mode, do you see any ports labeled as "Arduino MKR WiFi 1010" in the Tools > Port menu of the Arduino IDE?

No, there was no board label visible.

Do you have Tools > Board > Arduino SAMD (32-bits ARM Cortex-M0+) Boards > Arduino MKR WiFi 1010 selected in the Arduino IDE?

Yes, it's selected.

Are you using the latest version of the "Arduino SAMD (32-bits ARM Cortex-M0+) Boards" platform? You can check the version by opening Boards Manager in the Arduino IDE (Tools > Board > Boards Manager). The latest version is 1.8.12

No, I'm using version 1.8.11.
Should I update it?

I think it is worth a try at least.

So, I think I've solved the problem.
I changed the COM port in the device manager from COM5 to COM24.
Now, it is discovered by the IDE and sketch uploading works without the bootloader!
But when I try to connect it to IoT cloud, it fails.
I took a look on the arduino create agent debug console and the device manager.
Now, I know the new problem: When the IoT Cloud uploades a sketch, the MKR gets back into bootloader mode, which has an other port, so the IoT cloud cannot discover it on COM24 anymore.
Why is this happening?