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

please consider to add upload.mcu #327

Open
diniig opened this issue Dec 29, 2023 · 2 comments
Open

please consider to add upload.mcu #327

diniig opened this issue Dec 29, 2023 · 2 comments

Comments

@diniig
Copy link

diniig commented Dec 29, 2023

Please consider to add upload.mcu
like existing build.mcu
in case upload.mcu is absent then pio would use build.mcu
https://github.com/platformio/platform-atmelavr/blob/d9d2738bcb1c632e2f5e3c57318e6ae8281ee960/builder/main.py#L207C20-L207C20

it needs to support Amperka boards

they compile code as build.mcu=atmega328p
but upload as upload.mcu=tmega328pb

see https://github.com/amperka/amperka-boards/blob/master/platform.txt#L11C8-L11C8

@MCUdude
Copy link
Contributor

MCUdude commented Jan 11, 2024

If you're uploading to an ATmega328PB, why not compile for it as well? PlatformIO supports the ATmega328PB.

And if you just have to upload to a different target than what you have compiled for, you can always use a custom upload command:

From the MiniCore PlatformIO README:

; Run the following command to upload with this environment
; pio run -e Upload_ISP -t upload
[env:Upload_ISP]
; Custom upload procedure
upload_protocol = custom
; Avrdude upload flags
upload_flags =
  -C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
  -patmega328pb
  -PUSB
  -cusbasp
; Avrdude upload command
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

@diniig
Copy link
Author

diniig commented Jan 11, 2024

why not compile for it as well

not everything compile well :( - yes, this looks as issue to amperka but i thought about agility of platform io.
I would not write the full upload command, just set MCU in board file.
upload_command - I use this currently.

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