Working with Teensy 3/LC latest: Free Visual Studio 2013 Community + Visual Micro

Status
Not open for further replies.

stevech

Well-known member
Here's how I got Free MS Visual Studio 2013 Community edition + the Visual Micro plug-in for Arduinio/Teensyduino working.
Most of the below is done once.

I used Windows 7
  1. Install Arduino 1.6.1. I used c:\Arduino as the location. I have older versions in other folders like C:\Arduino_106 but these are N/A.
  2. Install Teensyduino 1.21.
    Confirm that the Arduino 1.6.1 IDE will run and compile for Teensy 3 and/or LC.
  3. Install MS Visual Visual Studio 2013 Community edition
  4. Install Visual Micro plugin for the above.
    Nothing special about the last two. Below, I'll show how I got these two to work with Arduino 1.6.1 and Teensy 1.21.
    http://www.visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx

From the Arduino 1.6.1 installation folder, e.g., C:\Arduino as above...
use a text editor such as Programmers Notepad to open
C:\arduino\hardware\teensy\avr\boards.txt
(yes, we're working on Teensy 3/LC but the path says AVR - never mind!)

in the teensy 3.0 section add this
teensy30.build.flags.ldspecs=

in the teensy 3.1 section add this
teensy31.build.flags.ldspecs=

in the teensy LC section add this
teensyLC.build.flags.ldspecs=

change to match this:
#teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=121
#uncomment this [next] line and remove the one above, for use with Visual Micro
teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=121 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH

Do the same as above for Teensy 3.0 and Teensy LC sections

Save the edited file with no name change.
Copy the edited file to your own place not in the C:\Arduino path.
Whenever you reinstall a new version of Arduino/Teensyduino, replace the boards.txt file that gets installed with the saved edited version so you don't have to repeat the edits.
======
NOTE: with the boards.txt file as above defining the CPU speed and so on, don't put the same info into the Visual Studio / Visual Micro project properties as mentioned on the visual micro website link as above.
======

Run visual studio 2013 from the start menu.
there is a Visual Micro toolbar. Leftmost is a drop-down. Choose Arduino 1.6. Right of that, choose Teensy 3.1 or LC.
TOOLS->Visual Micro->Configure IDE Locations
We've chosen Arduino 1.6 for now, so in the dialog box, enter the path to that Arduino 1.6.1 installation, such as c:\Arduino. Click OK.
The above need only be done once, or if the installation path changes due to your choice.

FILE->new->sketch name it something like zzz1
type in a simple blinky test for the LED on pin 13 or whatever for the board you're using
(or paste in some code).
BUILD->zzz1
Hopefully it compiles/links without error (except your typos).
connect Teensy via USB.
DEBUG->start without debugging

The Teensy loader should run, maybe with Windows asking permission, then download zzz1.hex and it runs. We hope.

===
Now I had to customize the toolbar menus and toolbar icons to enable the icons for build and the serial terminal window(s). You can have many serial terminals open if you are testing with multiple teensy's. The serial terminals automatically reconnect after a download. They also have smart scrolling - hard to explain, but click on text area and scrolling stops, then click on bottom and it resumes.

This done, I'm back to what I had with Atmel Visual Studio 6.2 with Visual Micro, for Teensyduino 1.06. But using Visual Studio 2013 and no ties to Atmel's tool.

I hope this helps.
Someday, Visual Micro and Teensy may eliminate the need for hand-editing boards.txt. That's really the only thing done here that's outside the default/normal installations.

Steve
 
Thanks,

I now have it building, which is nice, but if I try DEBUG->start without debugging,

I see an error message: 'Upload Using' requires a programmer. Upload cancelled.

I believe I am running his latest beta, unless a new one went in over night.

Update: needed to uncheck in the tools menu the upload using programmer menu item. Once I did that it used the teensy loader...
 
Last edited:
Good, glad to hear it's working.
Using visual studio 2013 Community (free) and Visual Micro, I had to customize the toolbar so that the build icons and the serial terminal icons appeared. Otherwise, I had to invoke the via the menu choices.
 
Just a curiosity, why use this version over the atmel ide, are the atmel toolchains that bothersum?
 
Last edited:
Thanks Steve,

One thing I have noticed though, that at least on the LC, when I compile some of my code for ILI9341 it runs a lot slower when compiled with this versus Arduino 1.61 IDE. Probably optimize flags or the like?
Have not investigated yet,

Johnny - The Atmel IDE, I believe uses Visual Studio (earlier version) as it's base. As to why to use the Visual Micro stuff for AVR versus Atmel tools, probably take your choice.
 
Sorry, dont get me wrong. I use atmel ide and visual micro as well, and i find it a much better ide than the arduino ide, but Apart from the tool chain that sometimes gets in the way, was just wondering if there was signification differences that warrant me upgrading to vs2013
 
I went with VS 2013 Community to break the ties to Atmel since I don't use the SAM, and to get a newer version. It might be considered unethical to use Atmel's tools in which they have invested, for a non-Atmel target device.

The optimizer flags are "none" - change these in the boards.txt file.
 
@stevech :)

@KurtE, Wow I'm liking this visualGDB, It's sort of the Jack of all trade type Eclipse plugin but for Visual Studio, and you have to pay. Which is not a bad thing as it pushes ownest onto the developers to actually support their product, where as eclipse plugins is more, meh, if I have time, can be bothered and not busy earning my mortgage, type support (I'm not against opensource or anything like that, but I'm a realist, unless you can get donations or support contracts, open source will never give you a living, so will always be second priority).
 
Yes, visualGDB is very good. $90 well spent. Even a hobbyist - it's a $90 tool. What does a good hand power tool cost for that hobby?
Visual Micro is free and if PJRC would just give a bit of time to help Tim, it can come back for Arduino 1.6 as good as it was/is for Arduino 1.0x and the respective versions of Teensyduino.

Way back, Paul said he'd never used more than trivially used "real" IDEs. Metaphorically, it's like driving a car without power steering and none other. People that haven't learned a real IDE or took a cursory look - think such an IDE is just a better editor. Not so.
I'm old enough to have spent years using vi and makefiles and all that rot in my Unix sys V days at work. It was and is plodding.

IAR is much better and I use it all day most days in my consulting work. But there's serious money and costs in that so the $3800 cost of IAR pays back very quickly the great IDE and super SWD debugger.
So IAR (and Keil) are very widely used by professionals for good reason.

visualGDB is a great runner-up.

The unconventional and FUBAR method Arduino uses to avoid use of #include files and .h's is an impediment. That's what VIsual Micro has going - it accomodates (er, used to) this mash-up kluge in Arduino's attempt to paint C++ a different color for the tiny few who don't program but write one page sketches.
 
Last edited:
Sigh! Spent all day trying to get VS installed. Keeps complaining about random Registry or Download failures.

My machine is so poked with so many different drivers and such its a wonder anything works.

Anyway, downloading VS using
Code:
vs_community.exe /layout d:\msdownload
which downloads the install files and makes it offline. Then onto trying to install again.
 
Here's how I got Free MS Visual Studio 2013 Community edition + the Visual Micro plug-in for Arduinio/Teensyduino working.
...
Steve

Thanks Steve. My setup is now working using your instructions.

I've been banging my head against Eclipse for long enough. It's good to have options for decent development tools.
 
Sigh! Spent all day trying to get VS installed. Keeps complaining about random Registry or Download failures.
As an admin user, I've installed Free Visual Studio 2013 Community via the msi several times, and so too predecessor versions. And Visual Micro, using the instructions verbatim.
Never had download or registry errors, etc.
Always took me about 15 minutes.
I never used the "offline" install downloads.
 
This done, I'm back to what I had with Atmel Visual Studio 6.2 with Visual Micro, for Teensyduino 1.06. But using Visual Studio 2013 and no ties to Atmel's tool.

I hope this helps.

Thank you! Yet to try it but i've not done anything on my project since i did a reinstall because visualmicro were waiting for later versions etc, and funcitonality was rep[orted to be a bit broken.

Really need to get back on the horse :)

I so missed Ateml Studio when i went back to Arduino for the Teensy-LC testing.
 
Thanks for posting this. As for custom toolbars, I have the 'Build Solution' added to the toolbar. Any idea how to get "Upload Last Sketch Build" as a toolbar icon? It might be tricky because it only shows up in the 'Project' menu if you have a valid sketch to upload.
 
Thanks for posting this. As for custom toolbars, I have the 'Build Solution' added to the toolbar. Any idea how to get "Upload Last Sketch Build" as a toolbar icon? It might be tricky because it only shows up in the 'Project' menu if you have a valid sketch to upload.
Try that Q on the visual micro forum
 
Here's how I got Free MS Visual Studio 2013 Community edition + the Visual Micro plug-in for Arduinio/Teensyduino working

Thanks for the guide, been checking that Visual Micro (VM) Teensy page for an update on and off waiting for 1.61+ support and then stumbled across your post on the VM site forum.

Have you tried with 1.63 and TD 1.22 or do we have to wait for VM to be updated for 1.63 first I presume?
 
stevech, thanks for your post, very helpful. Several thoughts, as I am new to visual micro, although I have used Visual Studio as a C/C++ programmer for many years. Have you go the
intellisense to work for this setup? I am using VS 2013 Professional, and intellisense for the .ino files does not work, although it works fine for C++ and .Net projects. Since I purchased the
debugger for Visual Micro I have been playing around with that as well. One thing I noticed is that in C++, I can set a break point to be hit in some of the dependent libraries if the debug symbols
exist. Since the libraries for Arduino/Teensy exist as .cpp and .h files, I was hoping I could also set a debug breakpoint in them if I wanted to take a look at what was going on there as well.
 
Intellisense... it just works for me with Visual Studio 2013 Community (Free) + Visual Micro. Same too when I used Atmel Studio 6.x (which is Visual Studio 2010) + Visual Micro. I didn't have to config for it to work. Must be som oddity with VS 2013 Pro (not free!). I use these tools for both Teensy ARM and various AVRs.

Visual GDB is much more MCU agnostic than Visual Micro. And has a better wizard.

Breakpoints with Visual Micro's quasi-debugger: I bought it, tried it. But I am used to a SWD/JTAG. I suggest you ask about this on the Visual Micro user forum.

It would be so beneficial to quite a few if PJRC and Visual Micro could reengage. Mr. Visual Micro put support for Teensyduino with Arduino 1.6 on his back-burner. He said it was because Teensy put the Teensy ARM variant underneath the AVR folder. Meanwhile, the other non-AVR boards in 1.6 are each in their own folder. Even the mega1284p is a variant outside of the mainstream Arduino- because Arduino does not SELL a board with that non-core micro, but others do. To with, the Arduino brand AVR mega2560.

So it might not be so hard to get this going again - but Visual Micro's Tim and Paul need to connect.
Meanwhile, as I posted in #1 above, the simple edits for Teensy to work with Arduino 1.6, minus the Teensy-specific new submenus, can be used.
 
Last edited:
but Visual Micro's Tim and Paul need to connect.

Tim and I do occasionally exchange private emails. I really do not believe any issues are due to a lack of communication or cooperation.

I'm pretty sure Tim faces a similar situation as I do, where limited time has to be prioritized among a miles-long list of bug fixes, small improvements, and even progress towards major new features, on top of the day-to-day challenges of operating a small business. Well, maybe Tim's long TO-DO list is measured in kilometers?

Even more changes are coming soon in Arduino 1.6.4, including a preference setting for optimization level. With 1.6.4, I might get rid of the optimize choices in the Tools > CPU Speed and instead go with Arduino's new approach. Maybe. I haven't really tested it yet, but I am following Arduino's developments so I'm aware of these changes.

Tim will very likely need to adapt to this too, since it will affect all Arduino products. If you guys to communicate with Tim, perhaps mention this message. I think it will make a lot more sense for us to converge towards where Arduino is going with 1.6.4, rather than asking him to adopt Teensy-specific stuff that's likely to be change in 1.6.4.
 
To stevech and Paul:

Given the choice of Visual Micro and Visual GDB, which one would you prefer and why? I need to make a switch to something much more powerful than the trusty Arduino
IDE because of issues beyond it's capabilities. So what IDE do you guys use for difficult debug issues on the Teensy/Arduino platforms? I don't mind shelling out a few bucks
if it will pay back in abilities. A nice debugger that could step into some of the Arduino/Teensy library .cpp files would be a real bonus.
 
I'd use VIsual Micro with Visual Studio 2013 Community. Both are free.
VisualGDB is a better choice for complex projects that use hardware-based debugging (SWD/JTAG).
I use IAR/EWARM for professional work due to its great debugger, esp. with today's $20 SWD interfaces. But EWARM is too costly for hobby/student work, unless you can live with the free version limited to 32KB of object code- which is practical only for small ARM projects.
 
Paul... Have you discussed with Tim, if you care to say, his stated reason for not continuing support for Teensy at these 1.6 versions - as he seemed to say that putting the ARM structure subordinate to the AVR directory tree, unlike all other non-AVRs, causes his structural concept to no longer easily adapt for Teensy 3? That was his angst, as I read it. Perhaps you can work this out with him? I think Teensy 3 is the only non-AVR target that mixes AVR and ARM in the same directory sub-tree. And that may lead to Tim saying it's too hard to accommodate as a special effort for Teensy 3, unlike the pre-1.6 for Teensy 3.

But for those here reading... Visual Micro + VS 2013/Community does work for Teensy 3 and 1.6, if you manually edit the boards.txt file and so on as shown in post #1 here.
 
Last edited:
Steve, I hope you can understand my reluctance to speak for Tim, or to comment on technical matters related to Visual Micro.

I can tell you the board.txt and platform.txt files for Teensy do work with Arduino 1.6.0 to 1.6.3. Arduino's new system provides a very powerful configurable build process. I have made somewhat creative use of it, for some very good reasons that are motivated by my desire to provide the best possible end-user experience on Arduino. I have no intention of making sacrifices on people's experience with the Arduino IDE, especially with regard to the many libraries designed for AVR chips which do indeed work perfectly on Teensy LC & 3.1.

But perhaps I can do better on the comments in boards.txt? Here's a new copy with some extra stuff in the comments. How does this look? Will it help?
 

Attachments

  • boards.txt
    26.4 KB · Views: 208
Steve, I hope you can understand my reluctance to speak for Tim, or to comment on technical matters related to Visual Micro.

I can tell you the board.txt and platform.txt files for Teensy do work with Arduino 1.6.0 to 1.6.3. Arduino's new system provides a very powerful configurable build process. I have made somewhat creative use of it, for some very good reasons that are motivated by my desire to provide the best possible end-user experience on Arduino. I have no intention of making sacrifices on people's experience with the Arduino IDE, especially with regard to the many libraries designed for AVR chips which do indeed work perfectly on Teensy LC & 3.1.

But perhaps I can do better on the comments in boards.txt? Here's a new copy with some extra stuff in the comments. How does this look? Will it help?

Indeed, though the intent here was for PJRC to reach out Visual Micro/Tim and offer help to some extent. PJRC benefits. Visual Micro/Tim doesn't, since it's freeware. He optionally gets some pittance for the quasi-debugger sales. But Tim's work is gratis. PJRC benefits from getting this great IDE to work properly with T3. I know you abhor MS Windows, but facts of life are the market share it has retained, and the huge user base of VS.
 
Status
Not open for further replies.
Back
Top