platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
136 stars 104 forks source link

can't upload code to "leonardo" #266

Open AMoktar opened 2 years ago

AMoktar commented 2 years ago

while uploading via arduino ide works fine with the same leonardo device , I'm getting this error with PlatformIO

Linking .pio\build\leonardo\firmware.elf
Checking size .pio\build\leonardo\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  20.8% (used 533 bytes from 2560 bytes)
Flash: [===       ]  28.2% (used 8084 bytes from 28672 bytes)
Building .pio\build\leonardo\firmware.hex
Configuring upload protocol...
AVAILABLE: avr109
CURRENT: upload_protocol = avr109
Looking for upload port...
Use manually specified: COM10
Forcing reset using 1200bps open/close on port COM10
Waiting for the new upload port...
Uploading .pio\build\leonardo\firmware.hex
avrdude: ser_open(): can't open device "\\.\COM9": The system cannot find the file specified.

avrdude done.  Thank you.

*** [upload] Error 1
======================================================================================= [FAILED] Took 19.93 seconds =======================================================================================
The terminal process "C:\Users\AMoktar\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--environment', 'leonardo'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

platform.ini

[env:leonardo]
platform = atmelavr
board = leonardo
framework = arduino