Skip to content

AVR uno Burn bootloader uses variable with name protocol that is not defined in boards.txt nor platform.txt #1368

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

Open
jantje opened this issue Jul 26, 2021 · 3 comments
Assignees
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@jantje
Copy link

jantje commented Jul 26, 2021

I'm not sure wether this is a problem in the avr platform, a documentation issue, a misunderstanding on my part or something else.
So please bear with me.

I tried to implement the burn bootloader functionality as described in:
https://arduino.github.io/arduino-cli/latest/platform-specification/#burn-bootloader

The documentation described this as a 2 step activity and I fail to reproduce the Arduino IDE created erase command for the avr uno board for platform version 1.8.3

The platform.txt file on my system contains the following erase pattern

tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m

As you can see, this command contains {protocol}. The same can be found in the github repository here
https://github.com/arduino/ArduinoCore-avr/blob/master/platform.txt#L117

However I do not find where protocol is defined.
When I run the burn bootloader command in the arduino IDE I see protocol resolves to stk500v2. There are several references to stk500v2 in platform.txt boards.txt and programmers.txt but none that I can confidently map.

Can you please advice how to resolve protocol properly?
Thanks

@jantje
Copy link
Author

jantje commented Jul 26, 2021

Looking at this a bit further in the command line I see the same problem with program.extra_params
It looks as if the info comes from the programmers.txt for the key avrisp.

avrisp.name=AVR ISP
avrisp.communication=serial
avrisp.protocol=stk500v1
avrisp.program.protocol=stk500v1
avrisp.program.tool=avrdude
avrisp.program.extra_params=-P{serial.port}

@jantje
Copy link
Author

jantje commented Aug 5, 2021

I found the missing link.
Apparently the programmer selected in the gui is used for "uploading using programmer" but also for "burn bootloader"

@jantje
Copy link
Author

jantje commented Aug 5, 2021

Reading the platform.txt section I would propose to add the dependency of platform.txt to the burn bootloader section.
The upload using external programmer already makes the dependency clear.

@per1234 per1234 self-assigned this Mar 7, 2022
@per1234 per1234 added topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project labels Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants