When I upload a new bootloader
with
[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
upload_protocol = usbasp
monitor_port = COM5
upload_flags = -Pusb]
and then Upload with Programmer
I can’t use the COM Port anymore
then I have to upload a Bootloader with the Arduino IDE
then I can Program with the Arduino IDE but still
PloatformIO does not program the chip with the Com Port
[env:nanoatmega328]
board = nanoatmega328
platform = atmelavr
framework = arduino
; each flag in a new line
upload_flags =
-Pusb
upload_port = COM5
upload_protocol = usbasp
board_bootloader.file = /Bootloader/optiboot_atmega328.hex
board_bootloader.lfuse = 0xFF
board_bootloader.hfuse = 0xDE
board_bootloader.efuse = 0xFD
board_bootloader.lock_bits = 0x0F
board_bootloader.unlock_bits = 0x3F
butPlatforIO is only uploading the Program not the bootloader
and it does not care about this board_bootloader.file = /Bootloader/optiboot_atmega328.hex
Ipush the “Upload using Programing” Button
Thanks maxgerhard took me a while because the right python path was not set.
Now the bootloader is written but I get
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x38
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x38
avrdude done. Thank you.
One of two places - the Boards Explorer (in your web browser, or via Boards in PIO Home), or via the docs - trawling the list, or searching. You’ll find two Arduino Nano ATmega328, so when one doesn’t work, you try the other, and it works!