Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Pages: 1 
Send Topic Print
Teensy 3 Low Cost (LC) (Read 22762 times)
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Teensy 3 Low Cost (LC)
Mar 9th, 2015 at 3:16am
 
As mentioned here recently --
Using Arduino 1.06 (not 1.6), Teensyduino libraries at beta7, I can compile and run using the (bleah) Arduino IDE.

But in Atmel Studio 6.2 w/Visual Micro, there's an error when compiling - complaint by asm that a command line argument is invalid.

The LC's core is a different but same family MCU; slower clock, smaller memory, not as many on-chip peripherals. GCC with AS 6.2 does compile for it correctly, using Arduino 1.06.  Arduino 1.6 is future TBD.

What's needed and can I help, get VM to do as AS 6.2 with VM can do, for the Teensy LC? Or better, VS 2013/Community.
Back to top
« Last Edit: Mar 9th, 2015 at 3:16am by stevech »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #1 - Mar 9th, 2015 at 1:54pm
 
Thanks,

Yes the Teensy LC is compiling okay for me using the latest Visual Micro releases and Teensy/Arduino 1.6

To test you would set the compiler defines for Visual Micro using the project properties.

So please email your sketch or a sketch that fails to info [at] visualmicro.com.

Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #2 - Mar 9th, 2015 at 4:25pm
 
you used Arduino 1.6?
I am trying to use 1.06 because Teensy and Arduino 1.6 is still in early beta.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #3 - Mar 9th, 2015 at 4:39pm
 
Yes Arduino 1.6

You will see that the Teensy option in Visual Studio has been renamed to Teensy 1.0. This is so that non-beta Teensy users get a consistent build using Visual Micro.

In the latest Teensy beta the build process has become compatible with Arduino 1.6 with a few minor Visual Micro tweaks that were published in the last release.

So for the teensy beta install Arduino 1.6, then apply the TeensyDuno beta upgrade and in Visual Micro select the Arduino 1.6 application. This is the only combination for beta Teensy that is supported in Visual Micro.

Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #4 - Mar 9th, 2015 at 4:51pm
 
OK, thanks.
Prior to Arduino 1.6, I put 2 or 3 board-specific settings in the boards.txt file, and not in the project properties - because this avoiding have to setup custom properties for each project.

I did add those same properties to the boards.txt file for Teensy 3.1 and LC but got the error for an invalid asm command line.

Could you please tell us what property settings are required for T3.1? And if possible, the beta Teensy LC which uses a different MCU and clock speed.

Perhaps easiest is to post or send a simple blinky or some such working VS/VM project for these two MCUs with the properties set, rather than using the boards.txt approach.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #5 - Mar 9th, 2015 at 10:21pm
 
Hi,

The new teensy config works slightly differently when it comes to the -defines but I looked at it again and you can put slightly different ones in boards.txt. Example for the LC which supports 24 or 48 mhz (see boards.txt for all options)

Code:
teensyLC.build.usbtype=USB_SERIAL
teensyLC.build.fcpu=48000000
teensyLC.build.keylayout=US_ENGLISH 



Thanks
Back to top
« Last Edit: Mar 9th, 2015 at 10:36pm by Visual Micro »  
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #6 - Mar 9th, 2015 at 10:27pm
 
F_CPU is 24MHz? It's 48MHz. There's a PLL but I though F_CPU was always the result of clocks and dividers yielding the CPU clock.

Back to top
 
 
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #7 - Mar 9th, 2015 at 10:38pm
 
OK thanks. I see the change.
Back to top
 
 
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #8 - Mar 10th, 2015 at 5:37am
 
Almost... but... here's what I've done, in time order

  • Install Arduino 1.6 replacing older 1.06
  • Install Teensyduino beta (latest)
  • Install latest Visual Micro
  • Run Arduino 1.6. Teensy 3.x and Teensy LC are in the tools list. Built and ran blinky for the LC.
  • Run AS 6.2.  The VM toolbar has Teensy 1.0 but no boards.
    No other Teensy choices. Arduino/AVR boards are there.

The instruction, earlier in this thread confuses me:
Quote:
for the teensy beta install Arduino 1.6, then apply the TeensyDuno beta upgrade and in Visual Micro select the Arduino 1.6 application.

Does the highlighted part, above, mean choose Arduino 1.6 from the VM toolbar where I do find Teensy 1.0, Arduino 1.0+ and 1.05+ but no Arduino 1.6?

Or is all this assuming I'm using VS 2013-Community and not AS 6.2?
Run VS 2013 community and I get the same VM menu choices as listed above.

I appreciate you patience with me.

Back to top
« Last Edit: Mar 10th, 2015 at 5:44am by stevech »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #9 - Mar 10th, 2015 at 2:39pm
 
It would have been less confusing for you to leave the older arduino install and additional install Arduino 1.6 using the zip and not the windows installer.

With Arduino 1.6 in Visual Micro you need to remove the teensy 1.0 option by clearing the path and set the path for the Arduino 1.6 application.

In Visual Micro you will now only have Arduino 1.6 showing on the tool bar

Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #10 - Mar 10th, 2015 at 9:39pm
 
thanks. I used the msi installer rather than the zip simply because I didn't know the zip should have been used.

So now... using VS 2013 and VM I tried a hello world build for Teens 3.1 then Teensy LC. Both fail, for different reasons:

Compiling 'Teensy_helloWorld' for 'Teensy LC'

Build folder: file:///C:/Users/steve/AppData/Local/V.Micro/Arduino/Builds/Teensy_helloWorld/te
ensyLC
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines:
Architecture Tools: c:\arduino/
Sketchbook: file:///C:/Users/steve/Documents/Arduino
Core Include Paths
Include Path 'c:\arduino\hardware\teensy\avr\cores\teensy3'
"c:\arduino/hardware/tools/arm/bin/arm-none-eabi-g++" -c {build.flags.optimize} -g -Wall -ffunction-sections -fdata-sections -MMD -nostdlib -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m0plus -D__MKL26Z64__ -DTEENSYDUINO=121 -DARDUINO=160 -DF_CPU={build.fcpu} -DARDUINO_ARCH_AVR -D{build.usbtype} -DLAYOUT_{build.keylayout} -I"c:\arduino\hardware\teensy\avr\cores\teensy3" "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\Teensy_helloWorld\teensyLC\
Teensy_helloWorld.cpp" -o "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\Teensy_helloWorld\teensyLC\
Teensy_helloWorld.cpp.o"
arm-none-eabi-g++*:error: {build.flags.optimize}: No such file or directory

Error compiling



and for Teensy 3.1 something is wrong with the properties
Build folder: file:///C:/Users/steve/AppData/Local/V.Micro/Arduino/Builds/Teensy_helloWorld/te
ensy31
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines:
Architecture Tools: c:\arduino/
Sketchbook: file:///C:/Users/steve/Documents/Arduino
Core Include Paths
Include Path 'c:\arduino\hardware\teensy\avr\cores\teensy3'
"c:\arduino/hardware/tools/arm/bin/arm-none-eabi-g++" -c -Os -g -Wall -ffunction-sections -fdata-sections -MMD -nostdlib -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m4 -D__MK20DX256__ -DTEENSYDUINO=121 -DARDUINO=160 -DF_CPU={build.fcpu} -DARDUINO_ARCH_AVR -D{build.usbtype} -DLAYOUT_{build.keylayout} -I"c:\arduino\hardware\teensy\avr\cores\teensy3" "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\Teensy_helloWorld\teensy31\
Teensy_helloWorld.cpp" -o "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\Teensy_helloWorld\teensy31\
Teensy_helloWorld.cpp.o"
:macro names must be identifiers
:ISO C99 requires whitespace after the macro name [enabled by default]
:token "{" is not valid in preprocessor expressions


Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #11 - Mar 10th, 2015 at 9:40pm
 
Zip did not have to be used but the windows installer uninstalls the older version which can be annoying
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #12 - Mar 10th, 2015 at 9:43pm
 
Can you first try with the project properties so that you replicate the testing here

F_CPU=48000000;USB_SERIAL_HID;LAYOUT_US_ENGLISH

Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #13 - Mar 10th, 2015 at 11:25pm
 
here's my latest attempt. This error is something missing in compiler optimization options flags obtained from the IDE by some unknown means:

Sketchbook: file:///C:/Users/steve/Documents/Arduino
Core Include Paths
Include Path 'c:\arduino\hardware\teensy\avr\cores\teensy3'
"c:\arduino/hardware/tools/arm/bin/arm-none-eabi-g++" -c {build.flags.optimize} -g -Wall -ffunction-sections -fdata-sections -MMD -nostdlib -fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti -mthumb -mcpu=cortex-m0plus -D__MKL26Z64__ -DTEENSYDUINO=121 -DARDUINO=160 -DF_CPU={build.fcpu} -DARDUINO_ARCH_AVR -D{build.usbtype} -DLAYOUT_{build.keylayout} -I"c:\arduino\hardware\teensy\avr\cores\teensy3" "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\Teensy_helloWorld\teensyLC\
Teensy_helloWorld.cpp" -o "C:\Users\steve\AppData\Local\V.Micro\Arduino\Builds\Teensy_helloWorld\teensyLC\
Teensy_helloWorld.cpp.o" -DF_CPU=48000000
-DUSB_SERIAL_HID -DLAYOUT_US_ENGLISH
arm-none-eabi-g++*:error: {build.flags.optimize}:
No such file or directory
Error compiling
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #14 - Mar 10th, 2015 at 11:56pm
 
Well Paul at pjrc does say it is beta Smiley

I just installed the latest version, my teensy was from last week.

In the latest version paul has added {build.flags.optimize}. You can see that in platform.txt

In the boards.txt he has added "build.flags.optimize=-Os" for all boards apart from Teensy LC which has the setting per speed 24/48

You can simply add the following to boards.txt

Code:
teensyLC.build.flags.optimize=-Os 






Back to top
« Last Edit: Mar 10th, 2015 at 11:57pm by Visual Micro »  
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #15 - Mar 10th, 2015 at 11:58pm
 
And today Arduino released version 1.6.1.
Paul has a new Teensyduino beta to match.
Back to top
 
 
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #16 - Mar 10th, 2015 at 11:59pm
 
Not your decision, but compiler optimization choice should be a project property, NOT a board property.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #17 - Mar 11th, 2015 at 12:02am
 
Point releases will usually work okay and I just used Paul latest beta release of today.

I don't think there is anything in 1.6.1 that will affect us.

The only item for discussion would be this but it's a discussion that has been had and changed so many times it probably doesn't affect us anymore

Quote:
Improved library name matching @PaulStoffregen. Avoids conflicts with libraries that bundle files equally named
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #18 - Mar 11th, 2015 at 12:04am
 
Quote:
Not your decision, but compiler optimization choice should be a project property, NOT a board property


Agreed, in Visual Micro it will be project or configuration, in the same way that defines are at the moment.

When using a "debug" configuration you might want a different optimization level.

Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #19 - Mar 11th, 2015 at 12:40am
 
In the most recent teensyduino beta, I this line is wrong

teensyLC.build.flags.c=

I'll tell Paul.
Maybe Arduino's  IDE doesn't care?
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #20 - Mar 11th, 2015 at 12:49am
 
Its also correct empty because it is an official option
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #21 - Mar 11th, 2015 at 2:39am
 
hmmm. The compiler error propagates to the GCC command line the curly braces and contents if the item has no value assigned. That of course causes compiler errors.

I see the "recipes" scheme in Arduno 1.6.
Back to top
 
 
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #22 - Mar 11th, 2015 at 4:24am
 
I'm exasperated.
I now have Arduino 1.6.1 and Teensyduino (installed secondly).
Arduino IDE works as it should.
The boards.txt file differs a lot. I boards.txt as per the comments in that file to enable defines there rather than as VS/VM project properties.

When I run VS/VM, it does not display the same list of boards as does the Arduino IDE. Example: there are board choices for different CPU speeds. F_CPU definition method changed.

I cannot see where VS/VM is getting the old boards.txt file. The VM installation for Teensy page says
Quote:
These standard Teensy defines can be found in the boards.txt file which can be found under the [TeensyDuino IDE folder]
/Hardware/Teensy/
. See the tags "build.definen typo" and "build.f_cpu"


But the boards.txt file is on a different path:
C:\arduino\hardware\teensy\avr\boards.txt

Note the oddity of "avr" in the path as Teensy 3's aren't AVRs. But that's how it is. And the Arduino IDE works.

Sigh.
Back to top
« Last Edit: Mar 11th, 2015 at 4:24am by stevech »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #23 - Mar 11th, 2015 at 1:25pm
 
Hi

Look thanks for all the info. As you see teensy is changing at the moment day by day.

You do have full control over what you want to see and use in Visual Micro and also the compile process but only if you understand how the boards.txt and platform.txt work.

Otherwise I am sorry but you will have to wait for a couple of weeks while Teensy stabilizes and I get a quite few moments to implement the changes.

Thanks
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #24 - Mar 11th, 2015 at 2:42pm
 
Spoken with Paul. He is going to try to stabalise the Teensy beta next week. After that we can look at how best to implement all his clever new new options.

Thanks
Back to top
« Last Edit: Mar 11th, 2015 at 2:43pm by Visual Micro »  
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #25 - Mar 11th, 2015 at 4:10pm
 
OK thanks.
Back to top
 
 
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #26 - Mar 12th, 2015 at 2:58am
 
Tim
Have you heard that anyone has gotten Teensy 3.1 to work with VS/VM and the teensydunio beta that uses Arduino 1.6. or 1.6.1?

If not, I suppose to get VS/VM working again for Teensy 3.1 I must uninstall Arduino 1.6.1 and revert to teensuduino prior to the  beta. And use Teensy 3.1 since the LC wouldn't have support for that older version.

Hopefully the issues will be solved soon, simple they are- the GCC command line is getting {several.values} passed through without string replacement. It's very likely a simple correction but I don't know the internals of all this.


Back to top
« Last Edit: Mar 12th, 2015 at 3:01am by stevech »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #27 - Mar 12th, 2015 at 8:26pm
 
Hi Stevetec

You don't need to uninstall.

You can run with both versions. Use the zip files on arduino.cc to make two directories. for example c:\arduino-105 and c:\arduino-600.

Then run the teensyduino beta installer onto c:\arduino-600

Then run the teensyduino release installer onto c:\arduino-105

In Visual Micro configure "Teensy 1.0" with path c:\arduino-105 and "Arduino 1.6" with path c:\arduino-600

Then you can use the "list of applications" on the tool bar to easily switch any project between Teensy release and Teensy beta

As concerns Teensy 3x working with the beta. It was working in last weeks beta but it might fail with this weeks beta especially if you don't set the boards.txt menu selections to match what is defined in platform.txt. So will look again when paul gives me the nod.

Hope this makes sense.

Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #28 - Mar 16th, 2015 at 4:46am
 

Tim
When and only when your workload permits, and now that Teensyduino 1.21 is out of beta, we can revisit what needs changing to allow use of VM.

Regards
Steve
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #29 - Mar 16th, 2015 at 5:21am
 
Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #30 - Mar 21st, 2015 at 4:54am
 
a barely audible whimper says
VM on Teensyduino 1.21 for Arduino 1.6.1
close but no cigar so far.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10617
United Kingdom
Re: Teensy 3 Low Cost (LC)
Reply #31 - Mar 21st, 2015 at 11:21pm
 
Hi,

Please see current status in our release notes and also see the Teensy page for configuration instructions

http://www.visualmicro.com/page/Visual-Micro-Product-Version-History-Fixes-and-A...
http://www.visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx

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.

Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #32 - Mar 22nd, 2015 at 12:11am
 
OK.
With one small change to the boards.txt file for Teensyduino 1.21 + Arduino 1.6.1 I was able to build error free.

All I need now is to get VM to call the Teensy loader when I choose download without debug.
Back to top
 
 
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Teensy 3 Low Cost (LC)
Reply #33 - Apr 1st, 2015 at 5:22pm
 
Visual Micro is now correctly invoking the Teensy 3/LC downloader.
Back to top
 
 
IP Logged
 
Pages: 1 
Send Topic Print