Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 2 [3]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Add new board- teensy? (Read 70998 times)
Experimentalist
Junior Member
**
Offline


Posts: 29
Location: UK
Joined: Oct 6th, 2012
Re: Add new board- teensy?
Reply #40 - Jan 8th, 2013 at 8:44pm
Print Post  
Tim

Great news, just got the Teensyduino stuff and currently uninstalling Visual Micro previous version, anything special I need to do when trying this?

Ex.
  
Back to top
 
IP Logged
 
Experimentalist
Junior Member
**
Offline


Posts: 29
Location: UK
Joined: Oct 6th, 2012
Re: Add new board- teensy?
Reply #41 - Jan 8th, 2013 at 8:52pm
Print Post  
FYI

(Not sure of what this means as yet but thought I would post it for comment)

Just got this message on first startup after removing old Visual Micro and installing "ArduinoForVisualStudio_1301_07.msi":

---------------------------
Visual Micro
---------------------------
OpenProject: Unable to ensure project sketch files: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index
---------------------------
OK   
---------------------------

Then got this when building:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at processing.app.SketchEditor.get_SelectedBoard()
   at processing.app.SketchEditor.getBoardPreferences()
   at processing.app.SketchBuilder.get_BuildFolder()
   at processing.app.SketchBuilder.get_BuildPath()
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Project oProject, Boolean IsDebugStartCommand)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.OnBeforeCommandEvent(String sGuid, Int32 ID, Object CustomIn, Object CustomOut, Boolean& CancelDefault)
« Last Edit: Jan 8th, 2013 at 8:54pm by Experimentalist »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #42 - Jan 8th, 2013 at 9:01pm
Print Post  
I think it's a harmless message. Can you see all the boards okay? Intellisense working if you type "Serial."?

If you close and re-open the same sketch do you see the error again?

Thanks

FYI: This is what "ensuring the sketch files" means.

When you open a sketch project vm attempts to ensure that the vs project matches the sketch on disk. You might have added new .ino files using the arduino ide to an existing vs sketch, in which case, vs needs to show the new files in the project view and also to ensure that it's intellisense knowledge of libraries etc is up to date. 

The latter check is performed when ino files are saved, board selection is changed and at other times during usage.

So the particular function that failed at startup is relatively unimportant but I'll look into exactly why it happens. 
  
Back to top
IP Logged
 
Experimentalist
Junior Member
**
Offline


Posts: 29
Location: UK
Joined: Oct 6th, 2012
Re: Add new board- teensy?
Reply #43 - Jan 8th, 2013 at 9:25pm
Print Post  
Same error:

---------------------------
Visual Micro
---------------------------
OpenProject: Unable to ensure project sketch files: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index
---------------------------
OK   
---------------------------

on save, close and reopen. Boards drop down showing Teensy 2.0 what ever I click does not seem to change. Do I need to edit any files/ settings in the IDE to point to the new Teensyduino 1.0.3 Beta 10 folder or boards file?
  
Back to top
 
IP Logged
 
Experimentalist
Junior Member
**
Offline


Posts: 29
Location: UK
Joined: Oct 6th, 2012
Re: Add new board- teensy?
Reply #44 - Jan 8th, 2013 at 9:31pm
Print Post  
Okay found an incorrect path for the "Arduino Application" in the setup of Visual Micro under Visual Studio options and things are starting to come to life. Error gone now when saved and re-opened, Teensy 3.0 board available, will play more and report back.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #45 - Jan 8th, 2013 at 10:48pm
Print Post  
Great. I've been doing some teensy debug testing this eve. It seems ok for trace (read-only) but no good for update of variables during debug.

Interestingly enough if I select std arduino boards, such as Uno, when using teensyduino I get the same problem.

If I replace the teensyduino/hardware/arduino folder with the one from arduino 1.0.3 thje std arduino boards work correctly.

So Teensyduino 1.0.3 is not really arduino 1.0.3. Paul at pjrc seems to do have altered the search read function or something. This is what the debugger uses for variable update/modification.

If I can work out the actual difference I can make an optional debugger setting to handle it.

  
Back to top
IP Logged
 
Experimentalist
Junior Member
**
Offline


Posts: 29
Location: UK
Joined: Oct 6th, 2012
Re: Add new board- teensy?
Reply #46 - Jan 10th, 2013 at 7:16am
Print Post  
Tim

I am sure if you ask Paul he will give you the details, he is very proactive in the support of his hardware. I am looking forward to testing the debugger with the Teensy products. I will drop Paul a line via email with a link to this post.

Going to do some more work on my project in a minute so will see the current state of play with my VM in VS setup.

Ex.
  
Back to top
 
IP Logged
 
Experimentalist
Junior Member
**
Offline


Posts: 29
Location: UK
Joined: Oct 6th, 2012
Re: Add new board- teensy?
Reply #47 - Jan 10th, 2013 at 1:48pm
Print Post  
Hi Tim

Just tried compile with Teensy 3.0 project and was surprised to see the Teensy Loader launch !

I can confirm that both F6, compile only and F5, compile and upload, worked fine.

This is great as I now no longer need the Arduino IDE open at all.

Great work 

Ex.
  
Back to top
 
IP Logged
 
Paul Stoffregen
Newbies
*
Offline


Posts: 1
Joined: Jan 10th, 2013
Re: Add new board- teensy?
Reply #48 - Jan 10th, 2013 at 2:50pm
Print Post  
Hi everyone!  Paul here... the guy who designed Teensy.

Tim and I have been communicating about the technical details.  Just wanted to let you know we're talking and I'm trying to answer all his questions.
  
Back to top
 
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Add new board- teensy?
Reply #49 - Jan 10th, 2013 at 3:43pm
Print Post  
Thanks Paul, this is great news. Some of us have been waiting for a long time for VM to host the Teensy stuff. I for one have been holding back until today. I just ordered my first two Teensy's because it looks like Tim has the problems sorted or in hand. I am very excited about this marriage.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #50 - Aug 18th, 2013 at 11:13pm
Print Post  
A few points about Teensy and the latest version of Visual Micro (1308.18)

1) Atmel Studio

At the request of Atmel Corp. the Atmel Studio plugin does not support non-atmel hardware however it seems reasonable that because Paul at pjrc contributes so much to the Arduino Ide an exception can reasonable made for Teensy. This means that both Teensy 2 and Teensy 3 are supported in Atmel Studio.

2) 

Support for Teensy and Arduino in the same Visual Studio or Atmel Ide

The new release provides a the facility to extend any version of Arduino (or oem Ide) using similar design to the 1.5 boards and platform txt system. 



3)

Arduino 1.0, 1.5.2 and 1.5.3 + library structures can be mixed and matched with any Arduino version (subject to compatible cores)
  
Back to top
IP Logged
 
Caswal Parker
Newbies
*
Offline


Posts: 2
Joined: Aug 21st, 2013
Re: Add new board- teensy?
Reply #51 - Aug 21st, 2013 at 1:51pm
Print Post  
I just come across Visual Micro and it looks amazing. I mainly use teensy' as I like the form factor and price point Smiley

I'm not an AVR/Micro programmer by trade, I'm a games programmer, so being able to use Visual Studio is a huge boon.

So I downloaded the above 1308.18 and it took a bit of messing with to compile. Following the defines here (http://visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx) threw me a little. As the underscores for F_CPU and LAYOUT_US_ENGLISH are not there and I didn't notice. I guessed that serial should be USB_SERIAL or USBSERIAL but I can't find any #ifdef etc macros that use in any source files in the hardware\teensy directories.

Starting simple I am trying to get the Blink example to compile:

Code
Select All
/* LED Blink, Teensyduino Tutorial #1
   http://www.pjrc.com/teensy/tutorial.html

   This example code is in the public domain.
*/

const int ledPin = 6;   // Teensy has LED on 11, Teensy++ on 6
const int ledPin2 = 6;   // Teensy has LED on 11, Teensy++ on 6

// the setup() method runs once, when the sketch starts

void setup() {
  // initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);
}

// the loop() methor runs over and over again,
// as long as the board has power

void loop() {
  digitalWrite(ledPin, HIGH);   // set the LED on
  digitalWrite(ledPin2, HIGH);   // set the LED on
  delay(1000);                  // wait for a second
  digitalWrite(ledPin, LOW);    // set the LED off
  digitalWrite(ledPin2, LOW);   // set the LED on 
  delay(1000);                  // wait for a second
}
 



But I appear to be getting the following linker error:

Code
Select All
Compiling 'Blink' for 'Teensy++ 2.0'
core.a(pins_teensy.c.o)* : : In function `_init_Teensyduino_internal_':
pins_teensy.c : undefined reference to `usb_init'
Error creating .elf
 



I'm not sure as to what happens in the magical black box behind the scenes. I'm using arduino ide 1.0.5 with teensyduino installed on top. It builds just fine using the arduino ide.

The other thing I noticed, it seemed to select the arduino configuration I had, even though the Teensy configuration was selected.

Edit:

Horrid temp fix, commenting out usb_init(), and my search for any use of USB_SERIAL was accidently limited to a sub folder of the hardware directory when I didn't realise. So that's why I couldn't find any.

Edit2: Ok, for some reason now all is compiling with usb_init uncommented. Hmmph
« Last Edit: Aug 21st, 2013 at 2:04pm by Caswal Parker »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #52 - Aug 21st, 2013 at 3:22pm
Print Post  
Hi there,

We have not tested Teensy with the new system in 1308.18. In theory it should just work but prob best tested off line.

I suggest using 1305.21 if the following does not work..

The Teensy defines can be found in the boards.txt of the respective arduinoide/hardware folders

I believe there is a difference between the underscores of the defines between teensy 2.0 and teensy 3.0

Can you confirm exactly which project defines you are setting so I can test over the next day or so

Thanks


  
Back to top
IP Logged
 
Lefteris
Newbies
*
Offline


Posts: 3
Joined: Aug 21st, 2013
Re: Add new board- teensy?
Reply #53 - Aug 21st, 2013 at 3:46pm
Print Post  
Hello,

I am sorry for jumping into the thread but I also have problems with getting teensy to work (I am using Teensy++ 2.0). More specifically, I have downloaded the latest beta of vm (1308.18) and configured the application paths (for teensy since there is no other TeensyIDE, I have used the same as the Arduino IDE). 

My problem is that I do not know where to define the F_CPU, LOCALE_US_ENGLISH and USB_SERIAL. When I define them in the Project->Project Options->Toolchain->AVR-GCC and AVR_G++ they seem to get ignored.
« Last Edit: Aug 21st, 2013 at 4:01pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #54 - Aug 21st, 2013 at 3:52pm
Print Post  
Please create new threads when you can. It is easier for answers and also avoids previous users who have a working solution from getting notifications.

But anyway here is the solution

This wiki page might be useful is shows the defines http://www.visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx

The projects properties are available by clicking the project in the solution explorer and then clicking View>Properties Window (F4 in VS and CTRL+ENTER in Atmel). It can be confusing because both VS and Atmel have various properties windows. The one you are looking at is the wrong window, the right one is a tool window not a dialog window.

All of the Visual Micro project options are in the same place, so not only should be be able to set the project properties as per the wiki link above you should also be able to switch on debugging

This article explains how to open the properties window
« Last Edit: Aug 21st, 2013 at 4:03pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Lefteris
Newbies
*
Offline


Posts: 3
Joined: Aug 21st, 2013
Re: Add new board- teensy?
Reply #55 - Aug 21st, 2013 at 4:09pm
Print Post  
Sorry for hijacking the thread, I was mislead by the similarity on the issue. 

Thank you for your help and clarification. It now works as expected.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #56 - Aug 21st, 2013 at 4:11pm
Print Post  
No problem, I understand it isn't easy to determine if a problem is new or not. Thanks very much for the update.
  
Back to top
IP Logged
 
Caswal Parker
Newbies
*
Offline


Posts: 2
Joined: Aug 21st, 2013
Re: Add new board- teensy?
Reply #57 - Aug 22nd, 2013 at 2:22am
Print Post  
For the Teensy++ 2.0 I have to define the following in Defines - Configuration:

F_CPU=16000000L;USB_SERIAL;LAYOUT_US_ENGLISH

Not getting much luck from the serial monitor, but I havn't looked too much into it as yet.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add new board- teensy?
Reply #58 - Aug 22nd, 2013 at 7:26am
Print Post  
Thanks I will update the constants in the docs.

The serial monitor works fine, needs a println() in the code to force a flush to screen. 

If you are using the debugger and serial in your code at a different speed to 115200 then you will need to set the debugger to use the new speed.

Good to hear it is working
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 
Send TopicPrint