MKR1000 "unknown USB Device"

Hi,

I've problem that USB serial cannot detected on device manager. The message is "USB\DEVICE_DESCRIPTOR_FAILURE". Did everyone here experience the same problem when connecting MKR device for the first time. Please assist. Thank you.

This is happened after upload configuration to MKR with ethernet shield

Sketch uses 47880 bytes (18%) of program storage space. Maximum is 262144 bytes.
Global variables use 3524 bytes (10%) of dynamic memory, leaving 29244 bytes for local variables. Maximum is 32768 bytes.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.848 seconds

Write 47880 bytes to flash (749 pages)

[== ] 8% (64/749 pages)
[===== ] 17% (128/749 pages)
[======= ] 25% (192/749 pages)
[========== ] 34% (256/749 pages)
[============ ] 42% (320/749 pages)
[=============== ] 51% (384/749 pages)
[================= ] 59% (448/749 pages)
[==================== ] 68% (512/749 pages)
[======================= ] 76% (576/749 pages)
[========================= ] 85% (640/749 pages)
[============================ ] 93% (704/749 pages)
[==============================] 100% (749/749 pages)
done in 0.400 seconds

Verify 47880 bytes of flash with checksum.
Verify successful
done in 0.046 seconds
CPU reset.

I've just found the solutions, just press reset button twice quickly.

1 Like

another question, is that normal when we upload the code then suddently the serial communication disconnected and the connected? Please assists.

Hi @atataxol.

I'm not sure I understood correctly what you mean by this. Please provide a more detailed description of what you mean by this in a reply on this forum thread to help us to understand it.

When I uploaded the code, suddenly arduino's connection on COM10 suddenly disconnected (status on the bottom right of Arduino IDE) and then connected again. Is that a normal condition on MKR WIFI 1000? Because I didn't have that situation when I compiled mega.

Thanks for the clarification. This is normal.

The reason is that, on the MKR WiFi 1000 board, the primary ATSAMD21G18 microcontroller is acting as the USB interface with the computer. So the USB CDC serial port of the board is actually produced by the sketch program. When the upload process starts, the microcontroller stops running the previously loaded sketch program which was producing the serial port and switches to a program named a "bootloader" that receives the data from the computer and writes it to the flash memory on the microcontroller. This causes the serial port to change. After the upload is finished, the bootloader program exits and the newly loaded sketch program starts running. Arduino IDE then connects to the serial port produced by the sketch program once again.

The situation is different with the Mega 2560 board. The primary ATmega2560 microcontroller on that board doesn't have a USB capability, so a dedicated USB interface chip (the ATmega16U2 on the official and clone boards, usually CH340 on the cheap derivative boards) was added to the Mega board. This means that the switch from the sketch program to the bootloader program that occurs during the upload process does not cause any change in the serial port produced by the Mega, since the serial port is produced by a separate chip that is not affected by the program on the ATmega2560.

Hi. Thank you for your detailed explanation. It really helped me understand the uploading process.

and sometimes this happened when uploading. Is there any specific driver for the USB port?

Do you see a port for the board under Arduino IDE's Tools > Port menu when that happens?

Yes, but Arduino IDE automatically installs it when you use Boards Manager to install the "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" platform that adds support to Arduino IDE for the MKR 1000 WiFi board.

The driver installation does require administrative permissions, so it is possible to skip the driver installation if the user declines the Windows User Account Control (UAC) dialog that requests the permissions.

However, if you are seeing a port sometimes then I think the driver must be installed already (I'm actually a bit doubtful that the driver is even required with modern Windows versions since I think the system drivers are sufficient) and the problem of the IDE occasionally being in this "not connected" state is not related to drivers.

Hi,

I'd still had this message "Unknown USB Device (Device Descriptor Request Failed)" when I was uploading the config and then disconnect. Must do push reset button twice quickly. Any solution. Thank you.

The tricky thing about the boards with native USB capability like the MKR WiFi 1000 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.

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.

When you do the double reset technique, the sketch program stops running and a bootloader program runs instead. So this means that any problems with the USB functionality caused by the sketch code will no longer occur when it is in that bootloader state produced by the double reset.

You can test my hypothesis that the problem is caused by something in your sketch code by performing this experiment:

  1. Select File > Examples > 01.Basics > BareMinimum from the Arduino IDE menus.
  2. The "BareMinimum" example sketch will open in a new Arduino IDE window.
    This sketch was chosen arbitrarily as a "known good" program that we know for certain won't cause any interference with the board's USB functionality.
  3. Press and release the reset button on your board quickly twice.
    The "L" LED should now start pulsing. If it doesn't, you might have gotten the timing of the double reset wrong. Repeat the procedure until you see the LED go into the pulsing state.
    The double reset activates the bootloader. It will run until the board is reset normally, powered off, or an upload is done.
  4. Select the port of your board from the Tools > Port menu in Arduino IDE.
  5. Start an upload in Arduino IDE as usual.
  6. Wait for the upload to finish successfully.

Now check to see whether the USB problem occurs while the board is running that "BareMinimum" sketch program.

If the problem does not occur while the board is running the "BareMinimum" program, but does occur while running your real sketch program, you will know that the problem is caused by something in your real sketch's code. You can then focus your attention on finding the specific problem in your sketch.

If the problem still occurs while running the "BareMinimum" program, then you can eliminate the code of your real sketch code as a potential cause of the problem.