Hi
I am trying to get “Burn Bootloader” working so I no longer have to keep using Arduino IDE to do this step.
I am using Arduino as ISP to successfully program my ATMega328p, but the issue comes when I try to burn the bootloader from platformio. When I try click the button I get this error avrdude error: cannot open port -b19200: The system cannot find the file specified.
I am guessing its an issue with forming the command, but I have not worked out a way to see what command platformio is generating to see where the error is. Does anything know whats going on here or if this is a bug with platformio itself?
You reference $UPLOAD_PORT but don’t set upload_port = COM... in your platformio.ini. So this flag will be empty and avrdude will see an invocation of avrdude [..] -P -b19200, thus taking -b19200 as the port.
To my knowledge that should not matter as it picks it up automatically hence why upload works fine. But even after manually I get this error
avrdude error: cannot open port \\.\COM[4]: The system cannot find the file specified.
avrdude error: unable to open programmer stk500v1 on port COM[4]
avrdude done. Thank you.
*** [bootloader] Error 1
But again, COM4 is there as after this error I clicked on upload and it worked perfectly without touching the config further.
You cannot use COM[x], you need to use COMx. After specifying it without the brackets it worked perfectly fine. Still seems odd that I need to include it, it should be able to pick up up automatically like it does when you click upload or upload and monitor.