Author Topic: Pro Mico (32u4 with bootloader) "Access is denied."  (Read 1157 times)

0 Members and 1 Guest are viewing this topic.

Offline Tangent_TrackerTopic starter

  • Regular Contributor
  • *
  • Posts: 65
Pro Mico (32u4 with bootloader) "Access is denied."
« on: March 07, 2026, 08:37:48 am »
Hey folks, Arduino IDE (238), press upload, press the button twice, the port for "Sparkfun Pro Micro" changes from com3 to com4 as expected, then I get the error:



Code: [Select]
Error: cannot open port \\.\COM4: Access is denied.


Error: unable to open port COM4 for programmer avr109
Failed uploading: uploading error: exit status 1
Now on my works machine, I have no problems. I have also successfully programmed on this machine but for some reason things are being stubborn!

Tried changing assigned com ports. I ahve show hidden devices in device manager. Any ideas?
« Last Edit: March 07, 2026, 11:07:18 am by Tangent_Tracker »
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3810
  • Country: au
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #1 on: March 07, 2026, 01:47:02 pm »
I recently got back to Arduino programming after a very long break. What I found was some boards in particular, like the clone Pro Mini boards, were a bit dodgy with the USB programming. Sometimes it would work. Sometimes I would get the errors. It seems like the newer the bootloader on the boards, the more likely they were to program reliably via the USB. I just happen to have a lot of very old boards so I did have a lot of problems.

What I discovered always works for the Atmega boards is using the cheap USBasp AVR programmers. These do use some ports on the board for programming, but they usually can be used as ports in the project as well - you just have to be mindful when selecting ports that they can be reused for programming. The USBasp programmers also let you upgrade the bootloaders on the Arduino boards. (Tools>Burn Bootloader). You cannot upgrade the bootloader from the board's usb port. Upgrading the bootloader might solve your issues.

In Arduino, to use the USBasp programmer for normal programming, you have to select it in Tools>Programmer and then program by using Sketch>Upload Using Programmer (or Ctrl-Shft-U). No selecting of ports required. Initially seems more work but I think any Atmega processor project I do now will have the header for the USBasp.
« Last Edit: March 07, 2026, 02:01:31 pm by amspire »
 

Offline Tangent_TrackerTopic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #2 on: March 07, 2026, 03:33:50 pm »
Ah, this could make sense, although I have previously programmed boards that are showing as comm not available, so the bootloader hasn't changed since then.

I have a PICKIT 4 so could try that, but maybe I should just get a USBasp as they cost very little...
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3810
  • Country: au
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #3 on: March 07, 2026, 03:42:04 pm »
I doubt you can use the PICkits for AVR boards. Just spend a few dollars on the USBasp. It bypasses the bootloader for programming, and also all the quirks of the various USB to serial implementations so it is the most reliable way the program the chips. Also it does not need the TX and RX pins on the micro, so they become available for other purposes if you want. Just get the USBasp that can be set to 5V or 3V3. Some come without the links to change voltage.
« Last Edit: March 07, 2026, 03:43:51 pm by amspire »
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 3856
  • Country: gb
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #4 on: March 07, 2026, 05:25:17 pm »
Apparently the PICKIT4 supports ATMega32U4.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8349
  • Country: fi
    • My home page and email address
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #5 on: March 07, 2026, 09:41:52 pm »
Note that because the native USB interface on ATmega32u4 is USB 1.1, some USB 3.x host ports don't like them.  The solution is to put an unpowered USB 2.0 hub in between.  (The technical explanation is dull and occasionally contested; let's just say that this is a semi-common issue with USB 1.1 and especially earlier USB 3.x host port hardware implementations, and is not an OS driver issue at all.)

About eight years ago, I switched to using a cable-type USB hub (not a splitter nor a charging one; a real hub), with one upstream/host male USB 2.0 A connector, and four downstream/device connectors: two USB A female, one USB micro-A male, and one USB micro-B.  It was very cheap, about 8 EUR/USD or thereabouts, and is just as easy to use as a plain USB cable.  Currently, I can find similar 4-way USB 2.0 hubs online easily, except they all tend to have female USB A downstream/device connectors, so you need to add a cable with USB-A male to whatever USB connector is on your Pro Micro or clone.  (I like the clones.)

The key is to use an USB 2.0 hub, not a splitter or USB 3.x hub.  (The difference between splitters and hubs is that a splitter is purely mechanical, and if you plug it into your computer without anything plugged in, it will not be visible in your USB management, say lsusb in Linux.  A hub will be visible, even when nothing else is connected to the hub.)
 

Offline Tangent_TrackerTopic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #6 on: March 07, 2026, 10:38:39 pm »
Thanks NA, well that sort of gives me a bit more of a lead. Trouble is, the front USB ports which I use, are 2.1... I just tried on the keyboard port on rear which I know is not v3 as well, and can confirm no difference. I could I suppose look for a cheap 2.1 hub, in fact, I might have one somewhere...

Will try and get back!

It is looking like the external programmer is the way to go...
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 8832
  • Country: ca
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #7 on: March 08, 2026, 02:36:36 am »
mmm not sure   but i had some problems with some, the bootloader was different and had different timings between the reset and hooking up to the pc, i returned them


as  for com port  ....  try com name arbiter tool in admin mode,,  it will clear unused ports ....      unless  some process do hook  com port names, say a crashed process but not closed in windows task(s)
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8349
  • Country: fi
    • My home page and email address
Re: Pro Mico (32u4 with bootloader) "Access is denied."
« Reply #8 on: March 08, 2026, 07:55:04 am »
Note that technically, there is no "Arduino Pro Micro".  The original board is SparkFun Pro Micro, with the hardware (schematic and layout) licensed under CC BY-SA 4.0, making it open source.  The license does require attribution, which is why I bring this up wrt. clones; as long as they use the same schematics/gerbers with genuine components, they're just as good as the original.  Costs nothing to abide by the license!

(If you do your own modified variant, and give or sell it to others, you do need to abide by the same license and provide the schematics and gerbers too.  Nowadays there are cheaper, faster, better ICs to use for new designs, though.)

Pro Micro and clones typically use the Arduino Leonardo "Caterina" bootloader (usb 2341:8036), and are programmed as Arduino Leonardo from e.g. Arduino environment.  (Pin numbers et cetera are as shown at SparkFun hookup guide.)

The bootloader is Caterina (as on Arduino Leonardo).  Adafruit has added some variations for their boards here, so one can compare the two, too.

With the Caterina/Arduino Leonardo bootloader, you should not need to use an external programmer, even if the current firmware does not expose a COM port at all.  You only need to connect the RST and GND pins together, after which it stays in programmable mode for 8 seconds; you need to start the firmware upload within those 8 seconds.  If firmware upload doesn't start within 8 seconds, it will start the user code instead, like on power-on.

The only case where you need an external programmer is if you want to update the bootloader (via SPI, SCK=15, MOSI=16, MISO=14; or via JTAG if enabled, A0=TDI, A1=TDO, A2=TMS, A3=TCK).  Normal application code won't accidentally overwrite any flash, because it requires very deliberate steps and tight timing to do.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->