before i went to this option to asking for help here, i looked in every post i found but nothing helps me out.
i´ll use the arduino framework to develop code for a bare atmega328p in platformio. the code is compiling without any errors. if i press upload, pio recognize my stk500 programmer and also the right upload port. everthing looks fine until here but then i get the common stk500 out of sync error ten times.
cuz the firmware hex was build via platformio i went to avr studio 4, enter avr programming mode, choose my chip and load the firmware without any problems.
i dont want to burn any bootloader, cuz its not needed (i dont use any usb flashing mode). the code is working well with 8mhz internal rc oscilator selected (option fuses set by avr studio 4) and without burning a bootloader - flashed by avr studio and nonchanged setup. i did not code in avr studio but pio … i just used avr studio 4 to flash the pio builded hex file
so i cant figure out why platformio isnt able to interact with my stk500 to flash the chip.
Since you’re using a programmer, try using the Upload with Programmer option, not the Upload option (which works with a bootloader).
How have you configured your platformio.ini? Something somewhat similar to the following I hope (which the correct fuses and serial port, obviously! )?
i expected this would be the solution cuz i thought it logically the same but wasnt able to configure out. but it doesn´t solve the problem. the “not in sync” message appear again.
wonderful … i got it to work.
i put the programmer on a usb hub cuz i ran out of ports in the actual setup. also i changed ATmega328 to ATmega328p
my platformio file looks like this now:
if i just use upload on the bar it will try to upload to the target. its also writing to but i get a verification error. not so in upoload to programmer mode. would be nice if there would be a bar icon to choose for uploading to target or programmer.
No, that would be the regular ‘Upload’ button, according to the tooltip that comes up when you move over the icon. That upload option relies on your AVR device having a bootloader so it can be programmed via serial. I was referring to
You can see what each of the status bar icons does by moving the mouse over them, and waiting for the tooltip to pop up after about a second, or in the documentation.
meanwhile i recognized that iam abl.e to just use the upload button but i need to build the project again after i made some changes. i didnt recognized that until today cuz using nano via CH340 or bluepill via SWD programmer.
upload gave som verification errors while program rebuild before uploading. yehaa … finally we got it thank you