platform.txt cloning

131 views
Skip to first unread message

Brian Cook

unread,
May 23, 2013, 1:10:23 AM5/23/13
to Arduino Developer's List

For Arduino IDE 1.5.x is it still necessary to clone the platform.txt file?

I recall some discussion of the IDE using settings from the
arduino:platform.txt file if the 3rd party file did not include the setting.

Thanks,
Brian

Angus Gratton

unread,
May 23, 2013, 1:26:07 AM5/23/13
to devel...@arduino.cc, bc...@rowdydogsoftware.com
Hi Brian,

One of the developers may have more details, but I can confirm: yes, this is possible.

There's a wiki page describing the new (very flexible, very nice) system here:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

I did run into one thing when creating a custom 1.5 board profile last week, I couldn't find a way to reference a third party upload tool (in this case avrdude in Arduino's platform.txt). I sent a pull request with a possible fix, mentioned here:
https://groups.google.com/a/arduino.cc/forum/#!topic/developers/ZDynm0VPrbk

Regards,


Angus

Brian Cook

unread,
May 23, 2013, 1:47:53 AM5/23/13
to Angus Gratton, devel...@arduino.cc
Hi Angus,

Thank you for the reply.

> One of the developers may have more details, but I can confirm: yes,
> this is possible.

In that case, I must have lost my mind!

> There's a wiki page describing the new (very flexible, very nice)
> system here:
> https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

I've been through that thing several times now and I cannot get a build
without cloning platform.txt.

Hopefully, someone can spot what I'm doing wrong...

Version 1.5.2 would not include any board entries unless I also had a
platform.txt file so I gave up on it and downloaded Nightly Build (a few
hours ago).

Under my sketchbook directory I have the vendor / architecture folder...
{sketchbookroot}\hardware\rdsx\avr\ ...that directory tree consists of...

{sketchbookroot}\hardware\rdsx\avr\boards.txt
{sketchbookroot}\hardware\rdsx\avr\cores
{sketchbookroot}\hardware\rdsx\avr\variants
{sketchbookroot}\hardware\rdsx\avr\cores\empty
{sketchbookroot}\hardware\rdsx\avr\cores\empty\Arduino.h
{sketchbookroot}\hardware\rdsx\avr\cores\empty\main.cpp
{sketchbookroot}\hardware\rdsx\avr\cores\empty\WProgram.h
{sketchbookroot}\hardware\rdsx\avr\variants\empty

boards.txt has one entry...

attiny13A.name=ATtiny13A
attiny13A.upload.using=arduino:arduinoisp
attiny13A.bootloader.tool=arduino:avrdude
attiny13A.build.mcu=attiny13
attiny13A.upload.maximum_size=1024
attiny13A.build.core=empty
attiny13A.build.variant=empty

This exact structure (moved up on level) works correctly under the 1.0.x
IDE chain.

Trying to build (verify) results in this...

processing.app.debug.RunnerException
at
processing.app.debug.Compiler.getCommandCompilerCPP(Compiler.java:554)
at processing.app.debug.Compiler.compileFiles(Compiler.java:245)
at processing.app.debug.Compiler.compileSketch(Compiler.java:592)
at processing.app.debug.Compiler.compile(Compiler.java:95)
at processing.app.Sketch.build(Sketch.java:1568)
at processing.app.Sketch.build(Sketch.java:1547)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1942)
at java.lang.Thread.run(Thread.java:619)

I've determined the exception is the result of the missing
recipe.cpp.o.pattern entry in the (non-existent) platform.txt file.

If I add a platform.txt file containing this...

name=Third Party Test
version=1.0

...the result is the same...

processing.app.debug.RunnerException
at
processing.app.debug.Compiler.getCommandCompilerCPP(Compiler.java:554)
at processing.app.debug.Compiler.compileFiles(Compiler.java:245)
at processing.app.debug.Compiler.compileSketch(Compiler.java:592)
at processing.app.debug.Compiler.compile(Compiler.java:95)
at processing.app.Sketch.build(Sketch.java:1568)
at processing.app.Sketch.build(Sketch.java:1547)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1942)
at java.lang.Thread.run(Thread.java:619)

If I copy over the platform.txt file from the Arduino IDE folder...

Binary sketch size: 78 bytes (of a 1,024 byte maximum) - 7% used

...success.

Any idea what I'm doing wrong?

Thanks,
Brian

Angus Gratton

unread,
May 23, 2013, 2:28:15 AM5/23/13
to devel...@arduino.cc, Angus Gratton, bc...@rowdydogsoftware.com
On Thursday, May 23, 2013 3:47:53 PM UTC+10, Brian Cook wrote:
Hi Angus,

Thank you for the reply.

> One of the developers may have more details, but I can confirm: yes,
> this is possible.

In that case, I must have lost my mind!

> There's a wiki page describing the new (very flexible, very nice)
> system here:
> https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

I've been through that thing several times now and I cannot get a build
without cloning platform.txt.

Hopefully, someone can spot what I'm doing wrong...

Hi Brian,

Actually I think you're right, that doesn't work.

I was reusing an Arduino core so I didn't see this. I think the only relevant code is in Compiler.java line 135 to 151, loading the platform based on the core (which in your case is custom not Arduino.) At a glance I don't see any other platform loading in that section.

Maybe Cristian can confirm. If it really is limited in the code then it looks like it would be easy to patch in that section, a straightforward way could be to add an optional "build.platform" that overrides the core choice in build.core, if set?

- Angus

Brian Cook

unread,
May 23, 2013, 3:06:05 AM5/23/13
to Angus Gratton, devel...@arduino.cc
Angus,

> Actually I think you're right, that doesn't work.

The good news is that I have not lost my mind.

> Maybe Cristian can confirm.

Cristian? Are you there?

Thanks,
Brian

Cristian Maglie

unread,
May 23, 2013, 5:01:59 AM5/23/13
to devel...@arduino.cc

In data giovedì 23 maggio 2013 09:06:05, Brian Cook ha scritto:

> Cristian? Are you there?


Hi Brian,


nice that you're trying this part of the new core support,


take a look at the last part of the documentation:


https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification


AFAIK only D.Mellis tried it for his Tiny core here:


https://github.com/damellis/attiny/tree/lib-1.5-cores


finally 1.5.2 is quite old now and doesn't fully support it, you must compile from git or get the nightly build from the download page.


C



Angus Gratton

unread,
May 23, 2013, 6:58:38 AM5/23/13
to devel...@arduino.cc

Hi Cristian,

Thanks for the pointer to a working profile.

Looks like D.Mellis is using the arduino core, not providing his/her own, same I have been - so the current master branch will pull in the Arduino platform file to match (as per the lines of code mentioned in the previous post):

attiny.build.core=arduino:arduino

If it's acceptable then I would happily add to the existing Pull Request I sent, to provide an option to override the compile-time platform while still providing a custom core, allowing something like:

attiny.build.platform=arduino
attiny.build.core=mytinycore

Would that be of any use?

- Angus

Brian Cook

unread,
May 23, 2013, 9:55:07 PM5/23/13
to Cristian Maglie, devel...@arduino.cc
Hi Cristian,

Thank you for the reply and all of your hard work!
I have.  What I want is to use the "stock" recipes from the Arduino / avr / platform.txt file but have a different set of core files.  I want that because you and the other folks who maintain those recipes have done a great job.  The recipes work very well for building AVR images.  I know I cannot do better.  At this point, my only choice is to provide and maintain a clone of the platform.txt file.


AFAIK only D.Mellis tried it for his Tiny core here:

https://github.com/damellis/attiny/tree/lib-1.5-cores


Which can take advantage of "myboard.core=arduino:arduino" entry to reference the Arduino core files.  Something that doesn't work for me.


finally 1.5.2 is quite old now and doesn't fully support it, you must compile from git or get the nightly build from the download page.


I've been using the Nightly Build.

Thanks,
Brian

Brian Cook

unread,
May 23, 2013, 9:58:42 PM5/23/13
to Angus Gratton, devel...@arduino.cc
Hi Angus,


If it's acceptable then I would happily add to the existing Pull Request I sent, to provide an option to override the compile-time platform while still providing a custom core, allowing something like:

attiny.build.platform=arduino
attiny.build.core=mytinycore

Would that be of any use?

It would be to me!

Thanks,
Brian

Reply all
Reply to author
Forward
0 new messages