Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avrdude not available as a valid upload tool for AVR based teensys #111

Open
MCUdude opened this issue Dec 13, 2023 · 3 comments
Open

Avrdude not available as a valid upload tool for AVR based teensys #111

MCUdude opened this issue Dec 13, 2023 · 3 comments

Comments

@MCUdude
Copy link

MCUdude commented Dec 13, 2023

@valeros / @ivankravets Avrdude now supports the AVR Teensy bootloader using -c teensy. Even though you may prefer to use the "official" teensy upload tool for PlatformIO, it would still be very useful to have Avrdude available as well.

In my case, I have a custom board that uses the same chip as the Teensy++ 2.0, but I'll have to use Avrdude externally to upload the code using an ISP programmer.

Bottomline: Please add Avrdude (7.2) as an available upload tool 🙂

[env]
platform = teensy
board = teensy2pp
framework = arduino

; Environment for ISP upload
[env:MYBOARD_ISP]
upload_protocol = custom
upload_flags =
  -C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
  -p$BOARD_MCU
  -PUSB
  -cusbasp
  -B0.5
upload_command = avrdude $UPLOAD_FLAGS -Ulfuse:w:0x9f:m -Uhfuse:w:0xdf:m -Uefuse:w:0xF3:m -Uflash:w:$SOURCE:i
Building .pio\build\MYBOARD_ISP\firmware.hex
Configuring upload protocol...
AVAILABLE: custom, teensy-cli, teensy-gui
CURRENT: upload_protocol = custom
Uploading .pio\build\MYBOARD_ISP\firmware.hex
'avrdude' is not recognized as an internal or external command,
operable program or batch file.
*** [upload] Error 1
@MCUdude MCUdude changed the title Avrdude not available as a valid upload tool Avrdude not available as a valid upload tool for AVR based teensys Dec 13, 2023
@MCUdude
Copy link
Author

MCUdude commented May 6, 2024

@valeros any plans to look into this?

@valeros
Copy link
Member

valeros commented May 6, 2024

Hi @MCUdude, sorry for the late reply. Isn't platform_packages option applicable here? I believe this way you can force PlatformIO to download the package according to your version requirements then just update your custom upload command to include the full path to the Avrdude package, something like this:

[env:...]
...
platform_packages = 
  tool-avrdude @ ~1.70200.0

upload_protocol = custom
upload_flags =
  -C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
  -p$BOARD_MCU
  -PUSB
  -cusbasp
  -B0.5
  
upload_command = $PROJECT_PACKAGES_DIR/tool-avrdude/avrdude $UPLOAD_FLAGS -Ulfuse:w:0x9f:m -Uhfuse:w:0xdf:m -Uefuse:w:0xF3:m -Uflash:w:$SOURCE:i

@MCUdude
Copy link
Author

MCUdude commented May 6, 2024

That did actually work, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants