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
Don't hardcode path to bootloader .hex file in platform.txt #1176
Comments
It sounds like the real issue here is that the built-in programmers don't work with third-party hardware folders / boards. Can you provide more detail on what happens when you try them? |
It looks like the problem is due to the tools.avrdude.bootloader.pattern variable in the platform.txt file, whose value is: "{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.ide.path}/hardware/arduino/avr/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m The path to the bootloader.file is hardcoded, even though the bootloader hex could be in the third-party hardware folder. There probably needs to be a variable for the folder of the current package / platform, so the bootloader hex file path can be given relative to that. |
Yes there should just be two variables, one that would be either "{runtime.ide.path}" or "{sketchbook.path}" and a variable that would be either "arduino" or the name of the third-party hardware folder - for instance "sanguino" in my case. |
@cmaglie I just wanted to let you know that the problem with the need to having a programmers.txt file in a hardware add-on is now no longer necessary, so that part of this issue is now fixed. The only thing missing is the part about hardcoding the bootloader location in platform.txt. For instance I have to have this line: https://github.com/TKJElectronics/Balanduino/blob/0ff44b2ae9a4287ea4643ef863b9afaa4b016064/Firmware/hardware/Balanduino/avr/platform.txt#L87 in my Balanduino hardware addon. If this was fixed I wouldn't have to have a platform.txt file in the hardware add-on and could rely entirely on the one bundled with Arduino, making my life easier. |
"runtime.hardware.path" now contains the path to the hardware folder of the currently selected board and "runtime.platform.path" the path to the specific platform. This should fix arduino#1176 and arduino#1761.
@cmaglie yes that solves this issue. Thank you! |
As you can see on the image below all the different programmers are included when using a third-party hardware add-on.
This would be no problem if you could actually upload using the programmers, but as you can see on the image provided it looks like it ignores the following line in my platform.txt file: https://github.com/Lauszus/sanguino/blob/master/avr/platform.txt#L87.
Note that I can successfully upload the bootloader using the "other" programmer section.
Either you should allow the hardware add-on to use the global programmers.txt file like you can use the Arduino core in boards.txt, as described here: http://code.google.com/p/arduino/wiki/Platforms1 or you should not include them if a third-party board is selected.
The text was updated successfully, but these errors were encountered: