Upload Error1 failure

Hallo Community,

I am trying to upload my code to AT mega32u4 same IC as arduino leonardo. The PCB is detected on COM 6 and working normally on arduino IDE. The board is detected also on Platformio (auto-detected as well Manuall detection through platformio.ini) but can`t upload the code. As error I got Error 1 upload. I tried already through other ports and unfortunately its not working.
here is the Error code:

Error Translation :
avrdude: ser_open(): can’t open device “\.\COM9”: The specified File can not be found. avrdude done. Thank you. *** [upload] Error 1
Ps : the PCB is working on other laptops…
I ll be thankfull for any help.


Per Uploading to any ATMega 32u4 based board is still broken · Issue #196 · platformio/platform-atmelavr · GitHub a “Verbose Upload” might work, maybe because it introduces some delay that is just enough so that the COM port is stable?

Thank you Max for the answer.
Could you please explain more about the verbose Upload, I cant activate the mode through the terminal.

Via terminal it’s pio run -v -t upload. See pio run --help for help and the documentation.

so, I ve been trying the last days other solutions but still no sucess. I uploaded a code to an arduino Uno through platformio and it was running correctly. the same code, cant be uploaded to an arduino leonardo, and the same error is shown as above. can the problem be with the leonardo libraries in the platform ? otherwise have no other explanations to the issue :(.

through the verbose Upload, I got this error report :


the specified file can not be found. as the previous failure.
as well I checked the configuration file with a second Laptop, on which the upload is working, and its the same version of file.

Hm well it seems to a problem then with how PlatformIO does the upload. Either some delay option is missing, or the port is wrongly calculated… for example, it says it has found COM10, then it does a force-reset to get the board into bootloader mode… and then attempts to upload at COM11? Does it excpect that it will always be the next higher COM number? But is that always the case? Can intermittent resets of the USB device happen? etc…

Maybe that’s something for @valeros to look into. I’ve updated Uploading to any ATMega 32u4 based board is still broken · Issue #196 · platformio/platform-atmelavr · GitHub with a link to this topic.

PS: It would be interesting to see if this is also a problem under Linux with its different USB device handling (maybe). Are you able to either dual-boot into a Linux installation or use something like https://www.virtualbox.org/wiki/Downloads to create Linux virtual machine (e.g. Xubuntu) with USB device forwarding?

thank you max for your effort and help. the error is as you described right. I guess its trying to upload everytime to the next higher COM.

I tried as well with the virtual box and it seems to be more complicated… the platformio ide failed to install on linux. python is updated and everything should work normally… I m getting a little bit desperated :(!! .
by the way its runnig normally on other windows, und IOS systems.

Hm… can you please open a new topic about your installation problem with PIO in your Linux VM while stating the exact error message and distribution you’ve installed?

I decided to take the simpler way for now, cause its a little bit urgent…
I got a new Laptop to work on it.
I have note: all the devices from which I can upload my code have an SSD hard disk, which is faster than the HDD (from my PC). could it be a cause that my PC take a long time trying to send a request or reciving an answer to/from the board ?