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

Don't hardcode path to bootloader .hex file in platform.txt #1176

Closed
Lauszus opened this issue Dec 18, 2012 · 7 comments
Closed

Don't hardcode path to bootloader .hex file in platform.txt #1176

Lauszus opened this issue Dec 18, 2012 · 7 comments
Milestone

Comments

@Lauszus
Copy link
Contributor

Lauszus commented Dec 18, 2012

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.
Programmer bug

@damellis
Copy link
Contributor

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?

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 18, 2012

Yes exactly.
Nothing else than the error above. Here is a screenshot when verbose is turned on:
Error

In version 1.5.0 it gave a null pointer exception, but it has been fixed in 1.5.1.

@damellis
Copy link
Contributor

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.

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 24, 2012

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.

@Lauszus
Copy link
Contributor Author

Lauszus commented Sep 4, 2013

@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.

cmaglie added a commit to cmaglie/Arduino that referenced this issue Jan 5, 2014
"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
Copy link
Member

cmaglie commented Jan 5, 2014

@Lauszus
may you test with #1790 ?

@Lauszus
Copy link
Contributor Author

Lauszus commented Jan 5, 2014

@cmaglie yes that solves this issue. Thank you!

@Lauszus Lauszus closed this as completed Jan 5, 2014
Lauszus added a commit to Lauszus/Sanguino that referenced this issue Feb 20, 2014
Lauszus added a commit to TKJElectronics/Balanduino that referenced this issue Mar 2, 2014
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

3 participants