teensy 3 boards.txt and teensyxx.build.flags.ldspecs=--specs=nano.specs

Status
Not open for further replies.

stevech

Well-known member
Boards.txt that I have from installing Teensyduino 1.21 have this
teensyxx.build.flags.ldspecs=--specs=nano.specs

for some Teensy boards and nothing for ldspecs for others. The lack of a definition for .build.flags.ldspecs causes a build error in Visual Micro.
I edited in teensy__.build.flags.ldspecs=
where __ is for 3.1 and LC to cure the build error.

Question: What should ldspecs be?

Question: Now I can build, but VS/VM no longer launches the teensy downloader. I'm researching how to reinstate that. Anyone know?
 
Question: What should ldspecs be?

When optimizing for performance, nothing. Defaulting to the normal newlib usually results in much better performance for most functons. However, printf appears to be somewhat slower.

When optimizing for code size, it should be "nano.specs", to use the newlib-nano library.

Teensyduino 1.21 makes the Tools > CPU Speed menu offer more choices, so you can have different CPU clock rates and code optimized for either speed or size.
 
Thanks ... I wasn't clear: the boards.txt file I have from installing teensyduino 1.21 had no .ldspecs for T3.1 or LC. This caused the compiler error.
So what I should have asked is: shouldn't a line with .ldspecs exist for each kind of Teensy? When no line is in boards.txt, then this: {build.flags.ldspecs} goes to the gcc command line and causes the error.

EDIT: Here's the build output with the above occuring. Cure is to add a definition in boards.txt
"c:\arduino/hardware/tools/arm/bin/arm-none-eabi-gcc" -Os -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=402645 "-Tc:\arduino\hardware\teensy\avr\cores\teensy3/mkl26z64.ld" {build.flags.ldspecs} -mthumb -mcpu=cortex-m0plus -o "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\zzz\teensyLC/zzz.elf" "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\zzz\teensyLC\zzz.cpp.o" "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\zzz\teensyLC/core.a" "-LC:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\zzz\teensyLC" -larm_cortexM0l_math -lm
arm-none-eabi-gcc*:error: {build.flags.ldspecs}: No such file or directory

New topic
Question: Now I can build, but VS/VM no longer launches the teensy downloader. I'm researching how to reinstate that. Anyone know?
 
Last edited:
the boards.txt file I have from installing teensyduino 1.21 had no .ldspecs for T3.1 or LC.

Really Steve?

I'm looking at boards.txt and I see .ldspecs for Teensy 3.1:


teensy31.menu.speed.96opt.build.fcpu=96000000
teensy31.menu.speed.96opt.build.flags.optimize=-O
teensy31.menu.speed.96opt.build.flags.ldspecs=
teensy31.menu.speed.72opt.build.fcpu=72000000
teensy31.menu.speed.72opt.build.flags.optimize=-O
teensy31.menu.speed.72opt.build.flags.ldspecs=
teensy31.menu.speed.48opt.build.fcpu=48000000
teensy31.menu.speed.48opt.build.flags.optimize=-O
teensy31.menu.speed.48opt.build.flags.ldspecs=
teensy31.menu.speed.24opt.build.fcpu=48000000
teensy31.menu.speed.24opt.build.flags.optimize=-O
teensy31.menu.speed.24opt.build.flags.ldspecs=
teensy31.menu.speed.96.build.fcpu=96000000
teensy31.menu.speed.96.build.flags.optimize=-Os
teensy31.menu.speed.96.build.flags.ldspecs=--specs=nano.specs
teensy31.menu.speed.72.build.fcpu=72000000
teensy31.menu.speed.72.build.flags.optimize=-Os
teensy31.menu.speed.72.build.flags.ldspecs=--specs=nano.specs
teensy31.menu.speed.48.build.fcpu=48000000
teensy31.menu.speed.48.build.flags.optimize=-Os
teensy31.menu.speed.48.build.flags.ldspecs=--specs=nano.specs
teensy31.menu.speed.24.build.fcpu=24000000
teensy31.menu.speed.24.build.flags.optimize=-Os
teensy31.menu.speed.24.build.flags.ldspecs=--specs=nano.specs


Maybe you're looking at a different boards.txt?

Maybe your eyes can't see the lines which Visual Micro doesn't properly parse?
 
I'm pretty sure you're next going to argue lines shouldn't have zero-length data.

Well, that's perfectly legal syntax. This works perfectly in Arduino, causing the substitution info the appropriate field in platform.txt.
 
I see now. VM is not using the lines like
teensy31.menu.speed.24opt.build.flags.ldspecs=

These don't appear in the VM menus.

So I add this
teensyLC.build.flags.ldspecs=

and the build succeeds with VM. For T3.1 and for LC.

For now, I don't care about speeds other than the standard/default ones so the above is fine.

But, now the automatic launch of the T3 loader no longer works.
I can run the loader and tell it where the .hex is. PITA because of the odd pathname Arduino uses. But this will have to do for now.

Here's a quote from Tim on the VM forum re Teensyduino 1.21. It's not encouraging. Perhaps there is a simple solution for VM?

Due to the fact that all Arduino 1.6.1 Teensy definitions are listed as AVR we will not be able to support it for a while. The above provides initial untested support for Teensy 121 with Arduino 1.0.x. Please follow the new releases section of the forum for future notifications about Teensy.
 
Tim can't possibly expect Arduino to be the only entity that will use the architecture "avr". That may have been convenient in his code, but it's totally unrealistic.

Even for non-AVR chips, the fact that nearly all libraries using the new metadata format will specify "avr" and maybe "sam" as their compatible architectures creates an extremely strong disincentive for any 3rd party like PJRC to name their architecture subdirectory anything other than "avr". This issue was discussed on the Arduino developers mailing list about a year ago. They decided to relax the consequences of not matching architecture names, but decided to keep the feature in the metadata.

I'm not going to make a change that would cause all Teensy users on Arduino to get incompatible library messages and probably experience more troubles as Arduino makes more use of the architecture metadata. I doubt anyone else will either, if any of the other non-AVR boards ever publish packages for Arduino 1.6.x.
 
It is odd that the 32 bit ARM teensy boards file is in the path subordinate to the 8 bit AVR.
I wonder if there are other ARM board supporters that have dealt with this. I think MapleLeaf is kaput. Presumably one can build with Arduino 1.6.1 for an Arduino/Atmel ZERO PRO target (of no interest to me).

Teensy 3/LC is THE Arduino-alike with ARM.

Well such as it is, I'm able to use VS/VM to build for the T3/LC target. With a trivial change to the boards.txt file. Forgo the new menus with speed options.
 
Last edited:
Status
Not open for further replies.
Back
Top