Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Windows Device Manager shows error: "This device cannot start. (Code 10)" #99

Closed
ccarmatic opened this issue Aug 11, 2023 · 2 comments
Closed
Labels
conclusion: invalid Issue/PR not valid type: imperfection Perceived defect in any part of project

Comments

@ccarmatic
Copy link

ccarmatic commented Aug 11, 2023

I am using Windows 11 and an Arduino Zero

this is my code, the version of MIDIUSB is 1.0.5

#include <Arduino.h>
#include "MIDIUSB.h"

unsigned long prevtime = 0;
unsigned long time = 0;
int prevvalue = 0;

void controlChange(byte channel, byte control, byte value)
{
  midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};
  MidiUSB.sendMIDI(event);
  // MidiUSB.flush();
}

void setup()
{
  prevvalue = analogRead(A0) / 8;
}

void loop()
{
  digitalWrite(LED_BUILTIN, LOW);
  time = millis() - prevtime;
  if (time > 50)
  {
    digitalWrite(LED_BUILTIN, HIGH);
    uint8_t value = analogRead(A0) / 8;
    if (abs(value - prevvalue) > 5)
    {
      prevvalue = value;
      controlChange(1, 1, value);
      MidiUSB.flush();
    }
    
    prevtime = millis();
  }
}

I flash the code to the Zero using its debug USB port and I can verify that it is working because the builtin LED flashes correctly and the transmit LED lights up when I turn the trimpot connected to A0

But when I connect the Zero with the native port (which MIDIUSB uses), I see this in Windows Device Manager:
image

This device cannot start. (Code 10)

A device which does not exist was specified.

an entry with the Arduino Zero name at COM7 which 'does not exist' to Windows, and a 'USB Serial Device' at COM6

The Arduino Zero is not being detected as a MIDI device , but Arduino IDE can access COM6 to upload sketches and open the serial monitor on the native USB port

If I upload any other sketch , which does not contain MIDIUSB, everything is normal in Windows, in Arduino IDE, and on the Arduino Zero.
This leads me to believe that the fault lies in MIDIUSB

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Aug 11, 2023
@per1234 per1234 changed the title Arduino Zero MIDIUSB problem Windows Device Manager shows error: "This device cannot start. (Code 10)" Aug 11, 2023
@per1234
Copy link
Contributor

per1234 commented Aug 11, 2023

@ccarmatic's post about the problem on Arduino Forum:

https://forum.arduino.cc/t/arduino-zero-midiusb-problem/1157189

Related:

@ccarmatic
Copy link
Author

Hello, I have tried the uninstall and reinstall drivers method without success - until I closed the Arduino IDE and did it again - the IDE was preventing Windows from deleting the necessary drivers

@per1234 per1234 added the conclusion: invalid Issue/PR not valid label Aug 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
conclusion: invalid Issue/PR not valid type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants