USB access denied

Hi everyone, previously when I plugged in my mbed into my laptop it worked fine. But after a few times of using it, the sentence “usbConnect error: Failed to execute ‘open’ on ‘USBDevice’: Access denied.” appeared on the screen. I’ve tried plugging it into another laptop and it works just fine. I’ve also tried to check in the device manager section but there wasn’t any problems shown there. Does anyone here know what the issue may be?

Hello,

usually is good share more context

  • your board and info about your debugger
  • System on PC
  • from where this error come from (what app)

check what a driver is used on both laptops - same or not

BR, Jan

I am experiencing a similar issue. My setup is as follows,

Operating System : Windows 10 / Ubuntu 20.04 (I am using a dual booted PC and am experiencing this issue independent of which OS I am on)

Device : mbed NXP LPC1768

IDE : Keil Studio Cloud

When I attempt to build and run my program I am prompted with the error “usbConnect error: Failed to execute ‘open’ on ‘USBDevice’: Access denied.” The flashing process then hangs indefinitely. Any help or potential directions to trouble shoot would be much appreciated.

Edit : Given Keil Studio Cloud is a browser based IDE I should state the problem persists independent of browser, I have tried using google chrome as well as Edge

Hello,

that makes more sense. Keil Studio Cloud uses the webUSB API and this must be supported by the hardware.
Please be so kind and take a look to this - New beta firmware for LPC1768 - Keil Studio - Arm Mbed OS support forum

BR, Jan

1 Like

Hello, I have the same problem,
I have Windows 11
Device: mbed FRDM-K64F

IDE: Keil Studio Cloud
When I try to compile and run my program, I get the error “USB connection error: Could not execute ‘open’ on ‘USB Device’: Access is denied.”
Previously, I did not have this problem.
Greetings

A possible cause of this is if you have another program open that is claiming the USB device (e.g. like a desktop IDE). Could you check whether this is the case please?

1 Like

Same problem here

How do I check if some other program is claiming the USB device?
As it worked once when I updated the firmware to work on webUsb but when I installed mbed studio and mbed cli, it was showing the error. So I uninstalled both of them, but still showing the same problem.

On Windows just open the Windows command line (CMD) and type

MODE

then you will see a list of all active not used COM ports. When your COM number is not in that list then it is used by some app.

Alternatively you can use directly the specific COM port number. Let’s say your board is on COM13 so we type to CMD following command.

MODE COM13

You will see setting of your COM port if is free but in opposite situation you will see this sentence Device COM13 is not currently available.

mode | Microsoft Learn

BR, Jan

It might be a laptop-specific issue. Check USB drivers or security settings on the problematic laptop causing the access denial.