PlatformIO Community

VSCode ATTINY85 micronucleus

Aloha Folks,

I am trying to program an ATTINY85 board using VSCode and PlatformIO.

I have the Digistump drivers installed and I am able to successfully program the board using the Arduino IDE.

When trying to program the board using VSCode and PlatformIO, I immediately received the following error when uploading:

avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

I was able to solve this error by watching this video which basically states that you need to add the following line to the platformio.ini file:

upload_protocol = micronucleus

I then ran into another error:

Tool Manager: Installing platformio/tool-micronucleus @ ~1.200.0
Error: Could not find the package with 'platformio/tool-micronucleus @ ~1.200.0' requirements for your system 'windows_amd64'

With a little searching I was able to find a fix by adding the following line to the platformio.ini file:

platform_packages = platformio/tool-micronucleus@^1.250.210222

With that issue resolved, I now get the following error: Unrecognized option: -c
This is where I am stuck as I am unable to find any remedy for this error. Any insight would be helpful, thank you.

The Following is the verbose upload output:

 *  Executing task in folder ATTINY IR: C:\Users\MakotoNinja\.platformio\penv\Scripts\platformio.exe run --verbose --target upload --environment attiny85 

Processing attiny85 (platform_packages: platformio/tool-micronucleus@^1.250.210222; platform: atmelavr; board: attiny85; framework: arduino; monitor_speed: 115200; upload_protocol: micronucleus)
PLATFORM: Atmel AVR (3.0.0) > Generic ATtiny85
HARDWARE: ATTINY85 8MHz, 512B RAM, 8KB Flash  
DEBUG: Current (simavr) On-board (simavr)     
 - framework-arduino-avr-attiny @ 1.3.2       
 - tool-micronucleus @ 1.250.210222 (2.50)    
 - toolchain-atmelavr @ 1.50400.190710 (5.4.0)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...     
Dependency Graph
|-- attiny85_ir_send-master (License: Unknown, Path: C:\Users\**********\Documents\PlatformIO\Projects\ATTINY IR\lib\attiny85_ir_send-master)
Building in release mode
MethodWrapper(["checkprogsize"], [".pio\build\attiny85\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  15.4% (used 79 bytes from 512 bytes)
Flash: [==        ]  15.6% (used 1276 bytes from 8192 bytes)
.pio\build\attiny85\firmware.elf  :

section                    size      addr

.text                      1260         0

.data                        16   8388704

.bss                         63   8388720

.comment                     48         0

.note.gnu.avr.deviceinfo     60         0

.debug_info                1056         0

.debug_abbrev              1000         0

.debug_line                  26         0

.debug_str                  361         0

Total                      3890
<lambda>(["upload"], [".pio\build\attiny85\firmware.hex"])
AVAILABLE: micronucleus
CURRENT: upload_protocol = micronucleus
micronucleus -c micronucleus --timeout 60 .pio\build\attiny85\firmware.hex
Unrecognized option: -c
*** [upload] Error 1

This is outdated, latest is 4.0.0. You can e.g. use the CLI and pio pkg update -g -p atmelavr to update. Then you shouldn’t need the platform_packages either.

This worked, thank you so much!