Anyone using Eclipse for development?

Status
Not open for further replies.
eclipseArduinoIDE

Hi Jantje,

I managed to download the V3 zip files. I extracted the files using 7-zip and when I try to open the eclipseArduinoIDE application in the extracted folder, i keep getting the bash and .sh in the same folder error. Is there a solution to this problem or do I have to download a different version?

Many thanks
Ryno
 
Good day Jantje,

Sorry to bother you again, but I would like to make sure that I can program in C on the teensy and not in the Arduino language. I am aware that the "Arduino language" is very similar to C as it is derived from it.
I just have to make sure that the language I programme the board in is C, as I am prohibited from using the Arduino IDE or language for my project.

Kind regards,
Timtodie
 
as I am prohibited from using the Arduino IDE or language for my project.

Why? Is this a school project? ...that's ok - just trying to understand *why* you can't use Arduino...

The "Arduino language" is really just C++ with a slight pre-processing step to automatically add includes and function declarations. If you take away that very small preprocessing step, it is just C++.
 
Good day PaulStoffregen

Yes, this is for a University project under electronic engineering. The Teensy 3.5 is the perfect platform for the robot that I have to build. One of the Exit Level Outcomes is that we are not allowed to use any hobbyist tools as it is an engineering project and the Arduino platform falls under that criterion.

Will the Eclipse Arduino plugin allow me to program the Teensy with C without the pre-processing steps automatically being done by this eclipse plugin?

Does the Arduino Eclipse plugin include a debugging tool as well?

Kind regards
Timtodie
 
Why? Is this a school project? ...that's ok - just trying to understand *why* you can't use Arduino...

The "Arduino language" is really just C++ with a slight pre-processing step to automatically add includes and function declarations. If you take away that very small preprocessing step, it is just C++.

I would say :
A "arduino sketch" (contained in one or more ino files) is C++ with a slight pre-processing step to automatically add includes and function declarations.
The "Arduino language" is really just a C++ library (called "core" in arduino land) that implements a API and includes a main() calling setup() and loop(). The main implementation makes that a "arduino sketch" needs to implement setup() and loop(). The API allows you to use methods like digitalWrite on any supported hardware.
A "Arduino Library" is really just a C++ library.
Note that I use C++ here as a collection of C, C++ and assembly files except for the ino file that needs to be c++.
 
Can I, as the programmer, use only C to program the Teensy 3.5 board with the IDE as well as step through my code in debug mode?
 
Can I, as the programmer, use only C to program the Teensy 3.5 board with the IDE as well as step through my code in debug mode?

I'm not sure you can do it.
I'm pretty sure Sloeber is not the best way to do this.
As you are training to become an engineer: a tip from a engineer: managers ask questions engineers rtfm. It seems to me you have not yet made up your mind what you want to be.
 
Setting Up Eclipse for Teensy

Motivation
I know there are those of us who prefer to program using C and without the Arduino IDE. Personally I come from using Keil (which appears unable to compile using GNU GCC, arm-none-eabi-gcc, and GNU G++, arm-none-eabi-g++ at the same time). The most complete directions I found were from this thread which is a bit dated, and now missing some details.

We wish to do the following:
Program in C/C++ modules
Use existing Arduino libraries, e.g. FastLED
Use convenient IDE features
Optionally use drivers provided by NXP

Downloads/Installation
Arduino and Teensiduino (https://www.pjrc.com/teensy/td_download.html)
Eclipse IDE for C/C++ Developers (http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/oxygenr)
GNU ARM Eclipse Plugin (http://gnuarmeclipse.github.io/plugins/install/)
Alternatively, Sloeber should include both the Eclipse IDE and GNU ARM plugin (http://eclipse.baeyens.it/stable.php?OS=Windows)
GNU MCU Eclipse Windows Build Tools - for make on Windows (https://github.com/gnu-mcu-eclipse/windows-build-tools/releases)
Optionally, GNU ARM Embedded Tools - This is already included as a part of Teensiduino. For the case that you have no interest in using Arduino libraries. (https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)

Create a new project
Create a new project in Eclipse, File->New->C++ Project
Choose a project name and location
Under Project type select “Executable/Empty Project”
Under Toolchains select “Cross ARM GCC”
Click Next->Next and select “GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc) for Toolchain name:”. The Toolchain path should be “C:\Program Files (x86)\Arduino\hardware\tools\arm\bin” if you used the default Arduino install directory.

Configurations
Right click the Project->Properties
Under C/C++ Build->Environment, select PATH and click Edit. Add “C:\Program Files (x86)\Arduino\hardware\tools\arm\bin” if it's not already there. Use semicolon as delimiter between previous path
Under C/C++ Build->Tool Path
Build tools folder: C:\Program Files (x86)\GNU MCU Eclipse\Build Tools\2.9-20170629-1013\bin\bin
Toolchain folder: C:\Program Files (x86)\Arduino\hardware\tools\arm\bin

Adding the teensy3 core and libraries
Add the Teensy Core to the project using a linked folder:
Right click on the project->New->Folder
Click Advanced->Link to alternate location (Linked Folder), and browse to C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3
Repeat this for the Libraries you wish to use, e.g FastLEDs C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED
Remove teensy3/main.cpp from the build process.
Right click main.cpp->Resource Configurations->Exclude from Build
Similarly exclude the “examples” directory of any libraries from the Build

Add your project files
Add a “main.cpp” file to the Project in a directory relative to the project that suits your preferences.
Right click the Project->New->Source Files
Or create the file in a chosen directory and link it as before.

Configure Include paths
Right click on the Project->Properties->C/C++ General->Path and Symbols
Under the Includes tab, select GNU C
Add, browse to “C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include”
Add, Workspace, ProjectName->teensy3.
Repeat and add all directories used in your project. (At least all the directories containing .h files)
Repeat for GNU C++

Match Arduino IDE build settings
These settings can be viewed in Arduino IDE by turning on verbose. In Arduino, File->Preferences->Show verbose output during: compilation

Right click on the Project->Properties->C/C++ General->Path and Symbols, click the Symbols Tab, click GNU C, add the following
__MK64FX512__ (for Teensy 3.5)
ARDUINO=10803
F_CPU=48000000 (or one of the other speeds supported)
LAYOUT_US_ENGLISH
TEENSYDUINO=137
USB_SERIAL
Repeat for GNU C++
Switch to C/C++ Build->Settings
Under the Tool Settings Tab, verify the follow is set from the previous steps
Cross ARM GNU C Compiler->Includes
Cross ARM GNU C++ Compiler->Includes
Cross ARM GNU C Compiler->Preprocessor
Cross ARM GNU C++ Compiler->Preprocessor
Under the Tool Settings Tab, select Target Processor, select the following
ARM family: cortex-m4
Instruction set: Thumb (-mthumb)
Under the Tool Settings Tab, select Cross ARM GNU C++ Linker->General,
Add the .ld script file corresponding to the Teensy you are using. E.g mk64fx512/ld for Teensy 3.5
Check Remove unused sections
Select Cross ARM GNU C++ Linker->Miscellaneous
Add the Linker flag --defsym=__rtc_localtime=1499566176
Check Use newlib-nano


Now the project should build as it does in the Arduino IDE!
 
You know what would be cool?
If someone made a Visual Studio Code plug-in to drive the Teensyduino toolchain.
There's an Arduino one, but that doesn't recognize the Teensy board support, and I'd rather have a Teensy-specific one.

In the end, it's "just" GCC with the support library/files and the user's project source. It "should" be "easy..."
 
You know what would be cool?
If someone made a Visual Studio Code plug-in to drive the Teensyduino toolchain.
There's an Arduino one, but that doesn't recognize the Teensy board support, and I'd rather have a Teensy-specific one.

In the end, it's "just" GCC with the support library/files and the user's project source. It "should" be "easy..."
That is what sloeber does for eclipse.
 
Status
Not open for further replies.
Back
Top