Hello!
I’m on Win 11 trying to follow along a certain project that uses PlatformIO but I very quickly got stuck trying to burn the fuses of my Atmega328p using the Usbtiny programmer from PlatformIO. I get the error: “Cannot open USB device: permission denied”.
I can burn the fuses without any problems using just avrdude, so there’s something with my PlatformIO settings. I’ve added this to my platformio.ini “upload_protocol = usbtiny
upload_flags = -e” and I’ve disabled Windows defender, but it still doesn’t work. I’ve tried executing the command directly from the command prompt (with administrator privileges) but it changes nothing. I would very much appreciate any help in the matter. Thanks!
The following is the full response from PlatformIO.
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/ATmega328P.html
PLATFORM: Atmel AVR (5.2.0) > ATmega328P/PA
HARDWARE: ATMEGA328P 12MHz, 2KB RAM, 32KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr-minicore @ 3.1.2
- tool-avrdude @ 1.80100.0 (8.1.0)
- toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 8 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
TARGET CONFIGURATION:
---------------------
Target = atmega328p
Clock speed = 12800000
Oscillator = external
BOD level = 2.7v
Save EEPROM = yes
Bootloader type = urboot
UART port = uart0
Clock output = no
---------------------
Selected fuses: [lfuse = 0xE2, hfuse = 0xD1, efuse = 0xFD]
Setting fuses
Warning: cannot open USB device: Permission denied
Error: cannot find USBtiny device (0x1781/0xc9f)
Error: unable to open port usb for programmer usbtiny
Avrdude done. Thank you.
*** [fuses] Error 1
============================ [FAILED] Took 1.19 seconds ============================
* The terminal process "C:\Users\klove\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'fuses', '--environment', 'ATmega328P'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.