Third-party hardware folders shouldn't need their own platform.txt file. #1157

Closed
damellis opened this Issue Dec 8, 2012 · 7 comments

Projects

None yet

2 participants

@damellis
Member
damellis commented Dec 8, 2012

If you're providing a third-party boards.txt file (to be added to the sketchbook hardware folder), you shouldn't need to provide a platfom.txt file. Instead, the IDE should use the platform.txt file from the package containing the core used by the board.

For example, if I have: attiny45.build.core=arduino:arduino in a boards.txt file, the IDE should use the platform.txt file in the "arduino" folder.

Otherwise, we're going to have a bunch of identical copies of the platform.txt files floating around, which will be a problem if we ever have to make any changes to them.

@cmaglie cmaglie was assigned Dec 8, 2012
@cmaglie
Member
cmaglie commented Mar 4, 2013

@damellis
May you check if the branch ide-1.5-cores solves this issue?
There are some other changes in custom menu format, for example:

menu.cpu.attiny.attiny45=ATtiny45

must be changed in:

attiny.menu.cpu.attiny45=ATtiny45

in other words the 3rd "element" must be moved to be the first.

C

@cmaglie
Member
cmaglie commented Mar 4, 2013

Oops, I mean the branch lib-1.5-cores:

https://github.com/arduino/Arduino/tree/lib-1.5-cores

C

@damellis
Member
damellis commented Mar 4, 2013

I'm getting a null pointer exception:

 [exec] [JavaAppLauncher] Requested [1.5*], launching in [1.6] instead.
 [exec] [LaunchRunner Error] processing.app.Base.main(String[]) threw an exception:
 [exec] java.lang.NullPointerException
 [exec]     at processing.app.debug.TargetBoard.<init>(TargetBoard.java:41)
 [exec]     at processing.app.debug.TargetPlatform.<init>(TargetPlatform.java:91)
 [exec]     at processing.app.debug.TargetPackage.<init>(TargetPackage.java:50)
 [exec]     at processing.app.Base.loadHardware(Base.java:1686)
 [exec]     at processing.app.Base.<init>(Base.java:291)
 [exec]     at processing.app.Base.main(Base.java:206)
 [exec]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [exec]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 [exec]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 [exec]     at java.lang.reflect.Method.invoke(Method.java:597)
 [exec]     at apple.launcher.LaunchRunner.run(LaunchRunner.java:116)
 [exec]     at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
 [exec]     at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
 [exec] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
 [exec]     at processing.app.Base.handleQuit(Base.java:949)
 [exec]     at processing.app.macosx.ThinkDifferent.handleQuit(ThinkDifferent.java:122)
 [exec]     at com.apple.eawt._AppEventLegacyHandler$7.dispatchEvent(_AppEventLegacyHandler.java:146)
 [exec]     at com.apple.eawt._AppEventLegacyHandler.sendEventToEachListenerUntilHandled(_AppEventLegacyHandler.java:168)
 [exec]     at com.apple.eawt._AppEventLegacyHandler.handleQuitRequestWith(_AppEventLegacyHandler.java:144)
 [exec]     at com.apple.eawt._AppEventHandler$_QuitDispatcher.performUsing(_AppEventHandler.java:387)
 [exec]     at com.apple.eawt._AppEventHandler$_QuitDispatcher.performUsing(_AppEventHandler.java:380)
 [exec]     at com.apple.eawt._AppEventHandler$_AppEventDispatcher$1.run(_AppEventHandler.java:489)
 [exec]     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
 [exec]     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
 [exec]     at java.awt.EventQueue.access$400(EventQueue.java:82)
 [exec]     at java.awt.EventQueue$2.run(EventQueue.java:669)
 [exec]     at java.awt.EventQueue$2.run(EventQueue.java:667)
 [exec]     at java.security.AccessController.doPrivileged(Native Method)
 [exec]     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
 [exec]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:678)
 [exec]     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
 [exec]     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
 [exec]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
 [exec]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
 [exec]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
 [exec]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

I'm guessing this has something to do with the changes to the boards.txt format, etc. It's not obvious which sketchbook folder is being used, though. I see the Arduino15 folder being created in ~/Library, but the preferences.txt file there doesn't have a key/value for the sketchbook location. I'll keep digging.

@damellis
Member
damellis commented Mar 4, 2013

Looks like the problem is that the TargetBoard code (line 40 and 41) assumes that the "build.core" preference is in the top-level preferences for a board, not the menu-specific ones. That is, "attiny.build.core=arduino:arduino" works but "attiny.menu.cpu.attiny45.build.core=arduino:arduino" doesn't. I'm not sure if you'd really need different cores for the sub-boards but it would probably be good to support them. I made this issue 1304: #1304

@damellis
Member
damellis commented Mar 4, 2013

I got programming to work for the ATtiny (https://github.com/damellis/attiny/commits/lib-1.5-cores) but not yet bootloader burning. I need to test selective overriding of the platform.txt keys (so that "burn bootloader" writes fuses but not a .hex file), if it's supported.

@cmaglie
Member
cmaglie commented Mar 5, 2013

You should be able to override single platforms.txt values.

@cmaglie
Member
cmaglie commented Sep 14, 2013

@damellis
I've looked at your attiny boards (in lib-1.5-cores branch), the following definition is missing:

attiny.upload.tool=arduino:avrdude

after adding it, it seems to work fine.

@cmaglie cmaglie closed this Sep 19, 2013
@samw3 samw3 pushed a commit to samw3/attiny13 that referenced this issue Jun 30, 2015
@damellis damellis First pass at 1.5.x support (untested).
This involved:
* moving the files to an avr/ sub-directory
* adding a copy of the platform.txt file from the Arduino 1.5.x repository (note that this shouldn't be necessary: arduino/Arduino#1157)
d66e2a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment