Closed rebebba closed 7 months ago
The problem is -P usb
in the avrdude command. Can you please share your entire platformio.ini, so I can try to reproduce the issue?
Hello! Yes, of coarse. Please see below:
[env]
platform = atmelmegaavr
framework = arduino
board = ATmega4809
; Clock frequency in [Hz]
board_build.f_cpu = 4000000L
; Oscillator type (internal or external)
board_hardware.oscillator = internal
; Arduino pinout variant
board_build.variant = 40pin-standard
; Monitor port is auto detected. Override here
;monitor_port =
monitor_speed = 9600
monitor_dtr = 0
; Run the following command to upload with this environment
; pio run -t upload
[env:Upload_UPDI]
; Upload protocol for UPDI upload
upload_protocol = serialupdi
; COM1 or COM3
upload_port = COM3
upload_speed = 115200
upload_flags =
-xrtsdtr=high
; Run the following command to upload with this environment
; pio run -e Upload_UART -t upload
[env:Upload_UART]
; Upload protocol for serial uploads (using Optiboot)
upload_protocol = arduino
; COM1 or COM3
upload_port = COM3
upload_flags =
; run the following command to set fuses
; pio run -e fuses_bootloader -t fuses
; run the following command to set fuses + burn bootloader
; pio run -e fuses_bootloader -t bootloader -F -v
[env:fuses_bootloader]
; Inherit upload settings from the Upload_UPDI environment
extends = env:Upload_UPDI
; Hardware settings
board_hardware.bod = 2.6v
board_hardware.eesave = yes
board_hardware.uart = uart0
board_hardware.rstpin = reset
Sorry for the late reply. I've been quite busy the recent days, and haven't had time to look at this issue until now. I can reproduce your issue, and it's clearly a bug in the PlatformIO system.
I'm the one who designed the fuses/bootloader logic in the MegaCoreX PlatformIO, so I'll look into it and provide a PR that hopefully can fix this issue. Stay tuned!
I found the root cause! See PR here: https://github.com/platformio/platform-atmelmegaavr/pull/67
Thank you!
We are trying to burn a bootloader to a custom ATMega4809 board over serialUPDI. We are following the .ini template provided, with adjustments to fit our board specifications
Running code
pio run -e fuses_bootloader -t bootloader -v
Produces the error
We have the same issue trying to burn a bootloader to the ATMega4808 board. We have no problem uploading to the board if a bootloader is already burned (done in Arduino IDE). Any idea what we may be doing wrong? Thanks in advance!