For those looking to get Nassarane's instructions working on a Windows7 64-bit environment. This is what worked for me (note I used F_CPU=96000000 to overclock):
I have been looking for an alternative environment and I seem to have this Eclipse-based method working:
Based on this post -
http://forum.pjrc.com/threads/1474-Anyone-using-Eclipse-for-development?p=6203&viewfull=1#post6203
Modified for the specific build that worked for me (on Windows7 - 64-bit)
using Teensyduino & Loader v1.15 and Arduino IDE v1.0.5
Teensy 3.0 and Eclipse installation on Windows
#1. You must first download the following elements:
- Arduino IDE -
http://www.arduino.cc/en/Main/Software
- Teensyduino -
http://www.pjrc.com/teensy/td_download.html
- Eclipse Standard, (use 32-bit version !!! as RXTX is not available for 64-bit platform) -
http://www.eclipse.org/downloads/
- Cygwin (use 32-bit version !!! for compatability with eclipse) -
http://cygwin.com/setup-x86.exe
- Java 7 JRE (x86) -
http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
#2. Installation:
- Install Java 7 JRE
- Install Cygwin
- Install the Arduino IDE, changing the target location to "C:\Arduino".
If using an archive rather than the installer then unzip to "C:\" and change uncompressed folder to be "C:\Arduino"
- Install Teensyduino
- Unzip Eclipse IDE to “C:\”
Create a desktop shortcut named "Eclipse" pointed to "C:\eclipse\eclipse.exe"
- Start Eclipse
- Help->Install New Software->Add:
Name: GNU ARM
Location:
http://gnuarmeclipse.sourceforge.net/updates
Press OK
Select "CDT GNU Cross Development Tools"
Press Next and complete the install
- Help->Install New Software->Add:
Name: RXTX
Location: RXTX -
http://rxtx.qbang.org/eclipse/
Press OK
Select "RXTX 2.1-7r4"
Press Next and complete the install
- Help->Install New Software->Add:
Name: TM Terminal
Location:
http://download.eclipse.org/tm/updates/3.5/
Press OK
Expand "TM and RSE 3.5 Main Features" and select "Target Management Terminal"
Press Next and complete the install
- (Optional) Help->Eclipse Marketplace
Find: Subclipse
Click Install on the entry named exactly: Subclipse
Confirm and complete the install
(If unable to install, temporarily disable Anti-Virus and retry the install)
#3. Eclipse Configuration:
- Set the tool chain path, click in “Windows/Preferences”.
- In the tree area in the left of “Preferences” dialog box, select “C C++/Build/Environment”.
- On “Preferences/Environment” clicks on the “select…” button.
- In the “Select variables” dialog box, enable checkbox of “Path” item, and click on the “OK” button.
- Back on the “Preferences/Environment” select the “Path” item added, and click on the “Edit…” button.
- In the “Edit variables” dialog box, add the tool chain path “C:\Arduino\hardware\tools\arm-none-eabi\bin;C:\cygwin\bin;” infront of the existing path values, and click on the “OK” button.
- In the “Preferences/Environment” click on the “OK” button.
- restart Eclipse
#4. Create the TeensyCore3 library Project:
- In Eclipse, create a project, click on menu “File/New/C++ Project”.
- In the dialog box “C++ Project”, type the Project Name : “TeensyCore3”
- Disable, “Use default location” checkbox.
- Click on the “Browse” button and select the location of your project.
- In the “Project type” area, select “ARM Cross Target Static Library/Empty Project”.
- In the “Toolchains” area, select “ARM Windows GCC (Yagarto)”.
- Click on the “Next” button.
- On the Configuration area disable the “Debug” checkbox.
- Click on the “Finish” button.
- Check the project, click on the project with right mouse button, in the popup window, click on the “Properties” item.
- In the tree area in the left of dialog box, select “C/C++ General/Paths and Symbols”
- Verify in the “Includes” tab than “Include directories” are filled with the path based added in the Windows Path (in step #2) on the Assembly, GNU C, GNU C++ languages. If the path is not correctly set, you must verify that the path has been correctly set.
- Click on the “Cancel” button to close the dialog box.
- Create a “src” folder in project, click on the project with right mouse button, click on “New/Folder” item of popup menu. Type “src” in “Folder name” field and click on the “Finish” button.
- With Windows Explorer select all files in the “C:\Arduino\hardware\teensy\cores\teensy3\” folder and copy to the “src” folder of the “TeensyCore3” project.
- In the “src” folder remove “Makefile”, “main.cpp”, “mk20dx128.c” files.
- In Eclipse, click on the project with right mouse button, click on the “Refresh” item.
- The “src” folder appears with its files and the sub folder “avr”…
#5. TeensyCore3 library project Settings:
- In Eclipse, click on the project with right mouse button, click on the “Properties” item.
- Select “C/C++ Build/Settings” in the tree area on the left.
- In the “Tool Settings” tab, verify than “Target Processor” property the Processor selected is “cortex-m4” and the “Thumb” checkbox are enabled.
- Select “ARM Yagarto Windows GCC C Compiler/Preprocessor”
in the “Defined symbols” area, add: F_CPU=96000000
in the “Defined symbols” area, add: USB_SERIAL
in the “Defined symbols” area, add: LAYOUT_US_ENGLISH
- Select “ARM Yagarto Windows GCC C Compiler/Directories”, in the “Include paths” area, add “src” folder using the “Workspace…” button.
- Same setting for “ARM Yagarto Windows GCC C++ Compiler/Preprocessor” and “ARM Yagarto Windows GCC C Compiler/Directories”, and click on “OK” button.
- To build the TeensyCore3 library, click on the project with right mouse button, click on the “Build Project” item. In the “Release” folder, the “libTeensyCore3.a” file has been generated.
#6. Create your Teensy project:
- In Eclipse, create a project, click on menu File/New/C++ Project.
- In the dialog box “C++ Project”, type the Project Name : “MyProject”.
- In the “Project type” area, select “ARM Cross Target Application/Empty Project”.
- In the “Toolchains” area, select “ARM Windows GCC (Yagarto)”.
- Click on the “Next” button.
- On the Configuration area disable the “Debug” checkbox.
- Click on the “Finish” button.
- Create a “src” folder in project, click on the project with right mouse button, click on “New/Folder” item of popup menu. Type “src” in “Folder name” field and click on the “Finish” button.
- With Windows Explorer select “main.cpp”, “mk20dx128.c” and “mk20dx128.ld” files in the “C:\Arduino\hardware\teensy\cores\teensy3\” folder and copy to the “src” folder of the “MyProject” project.
- In Eclipse, click on the project with right mouse button, click on the “Refresh” item.
- The “src” folder appears with its files.
- Modify main.cpp:
#include <WProgram.h>
extern "C" int main(void)
{
setup();
while (1) {
loop();
yield();
}
}
void setup()
{
}
void loop()
{
}
#7. MyProject project Settings:
- In Eclipse, click on the project with right mouse button, click on the “Properties” item.
- Select “C/C++ Build/Settings” in the tree area on the left.
- In the “Tool Settings” tab, verify than “Target Processor” property the Processor selected is “cortex-m4” and the “Thumb” checkbox are enabled.
- Select “ARM Yagarto Windows GCC C Compiler/Preprocessor”
in the “Defined symbols” area, add: F_CPU=96000000
in the “Defined symbols” area, add: USB_SERIAL
in the “Defined symbols” area, add: LAYOUT_US_ENGLISH
- Select “ARM Yagarto Windows GCC C Compiler/Directories”, in the “Include paths” area, add “src” folder of “TeensyCore3” using the “Workspace…” button.
- Same setting for “ARM Yagarto Windows GCC C++ Compiler/Preprocessor” and “ARM Yagarto Windows GCC C Compiler/Directories”, and click on “OK” button.
- Select “ARM Yagarto Windows GCC C++ Linker/General”, in the “Script file” field, clicks on the “Browse…” and select “mk20dx128.ld” file in the “src” folder of MyProject.
- Select “ARM Yagarto Windows GCC C++ Linker/Library”
in the “Libraries” area, add “TeensyCore3”
in “Library search path” area, add the path where the TeensyCore3 library is located, use the “Workspace…” button and select the “Release” folder of TeensyCore3 library project.
- Select “Project References”, in the “Project references for ‘MyProject’” enable the “TeensyCore3” checkbox.
- To build your project, click on the project with right mouse button, click on the “Build Project” item. In the “Release” folder, the “MyProject.hex” file has been generated.
#8. Teensy program loader settings:
- In Eclipse, on the menu “Run/External Tools/External Tools Configurations…”
- In the dialog box select on the “Program” item in the tree area, and click on the “New launch configuration” icon.
- In the “Name” field, type “Teensy 3.0”.
- In the “Main” tab, in the “Location” field, type the path : “C:/Arduino/hardware/tools/teensy_post_compile.exe”.
- In the “Working Directory” field, type the path : “C:\Arduino\hardware\tools”
- In the “Arguments” field, type : “-file=${project_name} -path=${project_loc}\Release -tools=C:/Arduino/hardware/tools”
- In the “Common” tab, enable the checkbox “External Tools”, and click on the “Apply” button.
#9. Upload program to the Teensy board:
- In Eclipse, select your project, “MyProject”.
- Click on the button “Run Teensy 3.0” of the tools bar to start loader provided by Paul
- Push the reset button of the board to upload your program.
- The Teensy LED should start blinking
#10. Connect the terminal to the Teensy board:
- To test the terminal, copy/paste the setup() and loop() functions of “Hello Word” example program in the “C:\Arduino\examples\Teensy\Tutorial3\HelloSerialMonitor\HelloSerialMonitor.pde” (overwriting the existing empty functions)
- main.cpp should then look like this:
Code:
#include <WProgram.h>
extern "C" int main(void)
{
setup();
while (1) {
loop();
yield();
}
}
void setup()
{
Serial.begin(38400);
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
Serial.println("Hello World");
delay(50);
digitalWrite(13, LOW);
delay(950);
}
- Compile and upload this program.
- To open the terminal view, click on the menu “Window/Show View/Other…”.
- In the “Show View” dialog box, in the tree area, select “Terminal/Terminal” and click on the “OK” button.
- In the Terminal view, click on the “Settings” icon to open the “Terminal Settings” dialog box.
- Type “Teensy 3.0” on the “View Title”, select “Serial” “Connection Type” select box, select the “Port”, select the “Baud Rate” to 38400 and click on the “OK” button.
- Click on the “Connect” button, the “Hello Word” message appears every second.