Anyone using Eclipse for development?

Status
Not open for further replies.
V 2.2 of the plugin has arrived.
We now have a scope like functionality.
Coooool
Best regards
Jantje
 
Thankyou Nassarane for your guide for your post http://forum.pjrc.com/threads/1474-A...ull=1#post6203.
Absolutely excellent for getting going.
Edit: I did like the sound of the Arduino Eclipse Plugin by Jantje integrated with Eclipse Juno and requiring Arduino IDE 1.5.2 - but as I've already got Eclipse Kepler SR1, I thought I should try and keep the number of permutations low as possible by sticking with IDE Teensy 1.18 using Arduino 1.0.5

I've got a few issues come up, I'm wondering if anybody with some deep ARM compiler knowledge can point me at something to look at.

I've got the Teensy31 board (very nice) and on a Win8 portable and got it downloading OK with the standard Arduino 1.0 toolchain
I have Eclipse Kepler SR1 from another project using the MK20 (and Eclipse code editor is so nice...) thought I'd follow your instructions for a TeensyCore3 library and myProject(called remMonPrj).
I've removed the other projects references in PATH and made sure it strictly references the PJRC toos in c:/program files/arduino/hardware/tools/arm-none-eabi/bin

I've got the the Teensy31 so making modifications for the processor memory using mk20dx256

Basically its worked for the compiling - with a number of issues resolved due to Kepler variations - but now stumped on a linker error.

It looks like some arm related undefined references to _kill_r and _getpid_r

make all
'Building target: remMonPrj.elf'
'Invoking: Cross ARM C++ Linker'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mthumb-interwork -DF_CPU=48000000 -D__MK20DX256__ -DUSB_SERIAL -DLAYOUT_US_ENGLISH -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g -T ../src/mk20dx256.ld -Xlinker --gc-sections -L"C:\Users\neilh77\n\c\w\teensy3core\Release" -Wl,-Map,"remMonPrj.map" -o "remMonPrj.elf" ./src/main.o ./src/mk20dx128.o -lTeensyCore3
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: section .ARM.extab loaded at [00003080,000030af] overlaps section .data loaded at [00003080,0000362b]
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text+0x14): undefined reference to `_kill'
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text+0x28): undefined reference to `_getpid'
collect2.exe: error: ld returned 1 exit status

I've tried adding in libraries gcc and gcov from "C:\Program Files\Arduino\hardware\tools\arm-none-eabi\lib\gcc\arm-none-eabi\4.7.2\thumb2"

if I add in stubs in mk20dx128.c - it solves the thumb2 issue but not the .ARM.extab
int _kill(int pid, int sig) {
/*errno = EINVAL; */
return (-1);
}

int _getpid() { return 1;}

Another wrinkle just in case it has some bearing,
The Eclipse Kepler New "C++ Project" had extra linker flags filled in with --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lc -lm -lrdimon -Wl,--end-group
which couldn't be found - and its something to do with startup so I've removed it on the assumption that it was handled by the teensy3 startup mk20dx128.c

So .. just in case I've repeated the above linker output with the Verbose flag turned on (C/C++ Build - settings - Tool Settings - C++ Linker - Miscellaneous )
I don't think it adds much extra value
12:33:49 **** Incremental Build of configuration Release for project remMonPrj ****
make all
'Building target: remMonPrj.elf'
'Invoking: Cross ARM C++ Linker'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mthumb-interwork -DF_CPU=48000000 -D__MK20DX256__ -DUSB_SERIAL -DLAYOUT_US_ENGLISH -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g -T ../src/mk20dx256.ld -Xlinker --gc-sections -L"C:\Users\neilh77\n\c\w\teensy3core\Release" -Wl,-Map,"remMonPrj.map" -v -o "remMonPrj.elf" ./src/main.o ./src/mk20dx128.o -lTeensyCore3
Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/4.7.2/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /home/paul/arm/workdir/gcc-4.7-2012.09/configure --prefix=/usr/local --target=arm-none-eabi --build=x86_64-unknown-linux-gnu --host=i586-mingw32msvc --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --disable-shared --enable-lto --with-newlib --with-pkgversion='PJRC Build of GNU Toolchain from CodeSourcery' --with-bugurl=http://forum.pjrc.com/ --disable-nls --with-headers=yes --with-sysroot=/usr/local/arm-none-eabi --with-build-sysroot=/home/paul/arm/arm-none-eabi/arm-none-eabi --with-gmp=/home/paul/arm/staticlib --with-mpfr=/home/paul/arm/staticlib --with-mpc=/home/paul/arm/staticlib --with-ppl=/home/paul/arm/staticlib --with-host-libstdcxx='-lstdc++ -lsupc++ -lm' --with-cloog=/home/paul/arm/staticlib --with-libelf=/home/paul/arm/staticlib --disable-libgomp --disable-libitm --enable-poison-system-directories --with-build-time-tools=/home/paul/arm/arm-none-eabi/arm-none-eabi/bin
Thread model: single
gcc version 4.7.2 (PJRC Build of GNU Toolchain from CodeSourcery)
COMPILER_PATH=c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/4.7.2/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../libexec/gcc/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/thumb2/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../arm-none-eabi/lib/thumb2/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/;c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-mthumb-interwork' '-D' 'F_CPU=48000000' '-D' '__MK20DX256__' '-D' 'USB_SERIAL' '-D' 'LAYOUT_US_ENGLISH' '-Os' '-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections' '-Wall' '-g' '-T' '../src/mk20dx256.ld' '-LC:\Users\neilh77\n\c\w\teensy3core\Release' '-v' '-o' 'remMonPrj.elf'
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/4.7.2/collect2.exe --sysroot=c:\program files\arduino\hardware\tools\arm-none-eabi\bin\../arm-none-eabi -X -o remMonPrj.elf c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/thumb2/crti.o c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/thumb2/crtbegin.o -LC:\Users\neilh77\n\c\w\teensy3core\Release -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/thumb2 -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2 -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../arm-none-eabi/lib/thumb2 -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2 -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib -Lc:/program files/arduino/hardware/tools/arm-none-eabi/bin/../arm-none-eabi/lib --gc-sections -Map remMonPrj.map ./src/main.o ./src/mk20dx128.o -lTeensyCore3 -lstdc++ -lm --start-group -lgcc -lc --end-group c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/thumb2/crtend.o c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/thumb2/crtn.o -T ../src/mk20dx256.ld
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: section .ARM.extab loaded at [00003080,000030af] overlaps section .data loaded at [00003080,0000362b]
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text+0x14): undefined reference to `_kill'
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text+0x28): undefined reference to `_getpid'
collect2.exe: error: ld returned 1 exit status
make: *** [remMonPrj.elf] Error 1
 
Last edited:
You could make your life much easier by installing the Arduino Eclipse plugin. Installation instructions are on one of my blogs at trippylighting.com following the obvious menu entries.

Edit: who is Nassarane ?
 
Last edited:
Hello Headroom - I just added some info to my previous post.
I've just read up on your blog - http://trippylighting.com/teensy-ar...ino-eclipse-ide-and-plugin-v2-2-installation/ - thankyou for putting up the detail instructions.
(I had only seen the earlier Arduino Eclipse details)

The Arduino Eclipse plugin sounds interesting, however Eclipse standard has so many levels that I wanted the simplest and most standard for a simple stable development environment (Kepler SR1?), which seems to me to be Teensy31/Arduino1.0.5.
So I haven't figure out exactly what an Eclipse Arduino Plugin in does on top of the other CDT plugins, and how stable the whole tool chain is. Sorry don't see any details one way or the other.
Maybe I'll tryit on an Ubuntu machine with a fresh install as per your instructions.

So now I have a build Teensy31/mk20dx256.ld with some overlapping memory - so trying to increment the tools forward, learn to toddle, and then actually do some Teensy31/MK20 programming.

Cheers
Neil
 
Well here is some info on "getting lost in the weeds" and I can figure out where I've gone wrong. Any insights much appreciated.

Looking at the mk20dx256.ld these are two sections cmds that seem like they should be directing into different memory regions


.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} > FLASH
_etext = .;

.usbstuff ...: { } > RAM

.data : AT (_etext) {
. = ALIGN(4);
_sdata = .;
*(.data*)
. = ALIGN(4);
_edata = .;
} > RAM

and the ld says they are overlapping. Which just doesn't seem to be what the commands are telling it to do.
ld.exe: section .ARM.extab loaded at [00003080,000030af] overlaps section .data loaded at [00003080,0000362b]

So in Eclipse Kepler I created a new workspace for core/Teensy3 with a new C++ Project and hello world C++, and copied in cores/Teensy3 and built it again.
Now got a similar error, but different values and this funny mangled "HarwareSerial5" of which there is no such thing
ld.exe: section .ARM.extab.text._ZN14HardwareSerial5writeEh loaded at [00012324,0001232f] overlaps section .data loaded at [00012324,0001295b]
Interesting eh, like a hole in the head. I guess somehow I think I've taken a wrong turning somewhere and can't figure out where.
 
The Arduino Eclipse plugin works with Kepler, not just with Juno. Also in case you don't want to mess with your current installation there is an Arduino Eclipse IDE , which bundles Kepler and the Plugin so no separate download and installation are necessary.

Here is the LINK to those installation instructions.

It should not take more than 10-15 minutes to install including the download.

I am not denying that there is a great learning experience in what you are doing, but I personally prefer to get on with my projects.
 
Hi Headroom - thanks for link.
Yes I would rather get on with my project - its just making a guess as to what the best methods are and where the trip wires are :).
I do appreciate the help and suggestions :), however I'm cautious as to where Teensy31 is on the issue of using Arduino 1.5.2 - howevever if the end result is upgrading the gcc then that is what I've done going from Teensy3 1.18 with gcc 4.7 to gcc 4.8.3 (2013q4) (BTW a friend using 4.8.3 had some issues with symbols/JTAG )

I'm thankful to report that I've got a working build - for whatever reason and I'm trying a number of options - when I switched gcc to 2013q4 and it worked.
All I did was change on path to the 2013q4 compiler and it linked OK.
Still haven't tried testing it so thats the next stage.
In case its useful for anybody I include some traces I took.
cheers

21:17:01 **** Incremental Build of configuration Release for project remMon **** WORKED
make all
'Building file: ../src/usb_inst.cpp'
'Invoking: Cross ARM C++ Compiler'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D__MK20DX256__ -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Users\neilh77\n\c\w3\remMon\src" -MMD -MP -MF"src/usb_inst.d" -MT"src/usb_inst.d" -c -o "src/usb_inst.o" "../src/usb_inst.cpp"
In file included from ../src/Print.h:38:0,
from ../src/Stream.h:24,
from ../src/HardwareSerial.h:143,
from ../src/WProgram.h:16,
from ../src/usb_inst.cpp:31:
../src/WString.h: In constructor 'String::String(double, unsigned char)':
../src/WString.h:67:72: warning: delegating constructors only available with -std=c++11 or -std=gnu++11 [enabled by default]
String(double num, unsigned char digits=2) : String((float)num, digits) {}
^
'Finished building: ../src/usb_inst.cpp'

'Building file: ../src/yield.c'
'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D__MK20DX256__ -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Users\neilh77\n\c\w3\remMon\src" -MMD -MP -MF"src/yield.d" -MT"src/yield.d" -c -o "src/yield.o" "../src/yield.c"
'Finished building: ../src/yield.c'
'Building target: remMon.elf'
'Invoking: Cross ARM C++ Linker'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T ../src/mk20dx256.ld -Xlinker --gc-sections -Wl,-Map,"remMon.map" -v -o "remMon.elf" ./src/HardwareSerial1.o ./src/HardwareSerial2.o ./src/HardwareSerial3.o ./src/IPAddress.o ./src/IntervalTimer.o ./src/Print.o ./src/Stream.o ./src/Tone.o ./src/WMath.o ./src/WString.o ./src/analog.o ./src/avr_emulation.o ./src/eeprom.o ./src/keylayouts.o ./src/main.o ./src/math_helper.o ./src/mk20dx128.o ./src/new.o ./src/nonstd.o ./src/pins_teensy.o ./src/serial1.o ./src/serial2.o ./src/serial3.o ./src/touch.o ./src/usb_desc.o ./src/usb_dev.o ./src/usb_flightsim.o ./src/usb_inst.o ./src/usb_joystick.o ./src/usb_keyboard.o ./src/usb_mem.o ./src/usb_midi.o ./src/usb_mouse.o ./src/usb_rawhid.o ./src/usb_seremu.o ./src/usb_serial.o ./src/yield.o
Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=c:/program\ files/gnu\ tools\ arm\ embedded/4.8\ 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-8-build/src/gcc/configure --build=i686-linux-gnu --host=i586-mingw32 --target=arm-none-eabi --prefix=/home/build/work/GCC-4-8-build/install-mingw --libexecdir=/home/build/work/GCC-4-8-build/install-mingw/lib --infodir=/home/build/work/GCC-4-8-build/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-8-build/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-8-build/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-8-build/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-8-build/install-mingw/arm-none-eabi --with-libiconv-prefix=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-gmp=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-mpfr=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-mpc=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-isl=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-cloog=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-libelf=/home/build/work/GCC-4-8-build/build-mingw/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r
Thread model: single
gcc version 4.8.3 20131129 (release) [ARM/embedded-4_8-branch revision 205641] (GNU Tools for ARM Embedded Processors)
COMPILER_PATH=c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../arm-none-eabi/lib/armv7e-m/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/;c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m4' '-mthumb' '-O0' '-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections' '-Wall' '-g3'
'-T' '../src/mk20dx256.ld' '-v'

'-o' 'remMon.elf'
c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/collect2.exe --sysroot=c:\program files\gnu tools arm embedded\4.8 2013q4\bin\../arm-none-eabi -X -o remMon.elf c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m/crti.o c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m/crtbegin.o c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/crt0.o -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../arm-none-eabi/lib/armv7e-m -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3 -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib -Lc:/program files/gnu tools arm embedded/4.8 2013q4/bin/../arm-none-eabi/lib --gc-sections -Map remMon.map ./src/HardwareSerial1.o ./src/HardwareSerial2.o ./src/HardwareSerial3.o ./src/IPAddress.o ./src/IntervalTimer.o ./src/Print.o ./src/Stream.o ./src/Tone.o ./src/WMath.o ./src/WString.o ./src/analog.o ./src/avr_emulation.o ./src/eeprom.o ./src/keylayouts.o ./src/main.o ./src/math_helper.o ./src/mk20dx128.o ./src/new.o ./src/nonstd.o ./src/pins_teensy.o ./src/serial1.o ./src/serial2.o ./src/serial3.o ./src/touch.o ./src/usb_desc.o ./src/usb_dev.o ./src/usb_flightsim.o ./src/usb_inst.o ./src/usb_joystick.o ./src/usb_keyboard.o ./src/usb_mem.o ./src/usb_midi.o ./src/usb_mouse.o ./src/usb_rawhid.o ./src/usb_seremu.o ./src/usb_serial.o ./src/yield.o -lstdc++ -lm --start-group -lgcc -lg -lc --end-group c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m/crtend.o c:/program files/gnu tools arm embedded/4.8 2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m/crtn.o -T ../src/mk20dx256.ld
'Finished building target: remMon.elf'
' '
'Invoking: Cross ARM GNU Create Flash Image'
arm-none-eabi-objcopy -O ihex "remMon.elf" "remMon.hex"
'Finished building: remMon.hex'
' '
'Invoking: Cross ARM GNU Print Size'
arm-none-eabi-size --format=berkeley "remMon.elf"
text data bss dec hex filename
76632 2356 4052 83040 14460 remMon.elf
'Finished building: remMon.siz'


21:03:45 **** Incremental Build of configuration Release for project remMon **** FAILED
make all
'Building file: ../src/usb_inst.cpp'
'Invoking: Cross ARM C++ Compiler'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D__MK20DX256__ -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Users\neilh77\n\c\w3\remMon\src" -MMD -MP -MF"src/usb_inst.d" -MT"src/usb_inst.d" -c -o "src/usb_inst.o" "../src/usb_inst.cpp"
In file included from ../src/Print.h:38:0,
from ../src/Stream.h:24,
from ../src/HardwareSerial.h:143,
from ../src/WProgram.h:16,
from ../src/usb_inst.cpp:31:
../src/WString.h: In constructor 'String::String(double, unsigned char)':
../src/WString.h:67:72: warning: delegating constructors only available with -std=c++11 or -std=gnu++11 [enabled by default]
'Finished building: ../src/usb_inst.cpp'
' '
'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D__MK20DX256__ -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Users\neilh77\n\c\w3\remMon\src" -MMD -MP -MF"src/yield.d" -MT"src/yield.d" -c -o "src/yield.o" "../src/yield.c"
'Finished building: ../src/yield.c'
' '
'Building target: remMon.elf'
'Invoking: Cross ARM C++ Linker'
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T ../src/mk20dx256.ld -Xlinker --gc-sections -Wl,-Map,"remMon.map" -o "remMon.elf" ./src/HardwareSerial1.o ./src/HardwareSerial2.o ./src/HardwareSerial3.o ./src/IPAddress.o ./src/IntervalTimer.o ./src/Print.o ./src/Stream.o ./src/Tone.o ./src/WMath.o ./src/WString.o ./src/analog.o ./src/avr_emulation.o ./src/eeprom.o ./src/keylayouts.o ./src/main.o ./src/math_helper.o ./src/mk20dx128.o ./src/new.o ./src/nonstd.o ./src/pins_teensy.o ./src/serial1.o ./src/serial2.o ./src/serial3.o ./src/touch.o ./src/usb_desc.o ./src/usb_dev.o ./src/usb_flightsim.o ./src/usb_inst.o ./src/usb_joystick.o ./src/usb_keyboard.o ./src/usb_mem.o ./src/usb_midi.o ./src/usb_mouse.o ./src/usb_rawhid.o ./src/usb_seremu.o ./src/usb_serial.o ./src/yield.o
c:/program files/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: section .ARM.extab.text._ZN14HardwareSerial5beginEm loaded at [00014284,0001428f] overlaps section .data loaded at [00014284,000148bf]
collect2.exe: error: ld returned 1 exit status
make: *** [remMon.elf] Error 1
 
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D__MK20DX256__ -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Users\neilh77\n\c\w3\remMon\src" -MMD -MP -MF"src/usb_inst.d" -MT"src/usb_inst.d" -c -o "src/usb_inst.o" "../src/usb_inst.cpp"

Some of your options seem a bit dubious. Unless you have some kind of DIY JTAG setup the -O0 and -g3 seem odd (they make sense in the case of hardware debug, but otherwise -g3 puts in debug symbols you can't use, and code size would be better with -Os).

As a comparison these are the options I usually compile with:
-D__MK20DX256__ -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DARDUINO=105 -Os -ffunction-sections -fdata-sections -Wall -std=gnu++0x -Wa,-adhlns="$@.lst" -fno-exceptions -fno-rtti -c -fmessage-length=0 -mcpu=cortex-m4 -mthumb

For the linker I have this:
-T"X:\someInstallPath\arduino-1.0.5\hardware\teensy\cores\teensy3\mk20dx256.ld" -Xlinker --gc-sections -Wl,-Map,test_code.map -mcpu=cortex-m4 -mthumb

It's been a while since I checked but IIRC my code sizes are almost identical to the Arduino build.

I'm also using Eclipse with only the ARM plugin (not Arduino). I started with Nassarane's setup near the top of this thread, but changed around some things (made it simpler IMO). I didn't like having to separate compile the core each time the teensyduino install was updated. With the project setup I have now I can just drop in a new Teensyduino and projects will recompile against it w/o changes (although the base Arduino is 1.0.5, not 1.5.x). If there is interest I could writeup the project setup, just let me know. Otherwise I suppose the plugin is a good alternative.
 
hi nox - that would be great to hear what you found to work.
The compile options was just trying out some variations based on another project with the gcc 4.8.3 . It turns out the gcc 4.7 wasn't accepting -Og.
(While mentioning -Og symbolics, a friend said that the Seeger JTAG was having issues with debug symbol extraction on gcc 4.8.3 on an MK25 )
Cheers
 
I'm using Sublime Text 2: http://www.sublimetext.com/ and Stino 1.2: https://github.com/Robot-Will/Stino

You can easyly set a new build system if you prefer to work with AVR Libc.

stino.jpg
 
Last edited:
Ok, I'll try to outline the steps I used. This is all written after the fact, so it may be missing a bit or two. One thing I try to do with this setup is make it so my primary project file (project.cpp) can be renamed to a .ino and will compile in Arduino. This takes a bit of work on the library setup, but if this is not a concern of yours then modify the procedure to whatever suits your setup.

For the install I'm using Juno, but Kepler should be similar. Note that Juno should use the 0.5.4 ARM plugin. I tried newer versions of the plugin but they did not work well (they are probably for Kepler, so use whatever is appropriate). Downloads and install is largely the same as above, but Eclipse setup is different.

Downloads:

Install procedure:
  1. Unzip Arduino: C:\<somepath>\arduino-1.0.5
  2. Install Teensyduino over base Arduino install
  3. Install Eclipse: C:\<somepath>\eclipse
  4. Install GNU ARM Eclipse plugin:
    • Start Eclipse, click on menu Help->Install New Software...
    • At top of dialog, click Add...
    • In the dialog box, click on “Archive…” button
    • Select the plugin file: org.eclipse.cdt.cross.arm.gnu_0.5.4.201202210114. zip

Project Creation:
This might seem a bit long, but it's really not too bad. This is where I do things differently than above. First off is PATH setup. There are two ways to go about this, either add the tool path to the main Windows path or add it inside Eclipse. I do it inside Eclipse for portability reasons. Here is how to do it both ways:

  • Windows:
    Open the following: Start->Control Panel->System->Advanced system settings->Advanced Tab->Environment Variables...
    Edit the PATH variable and add to the end: C:\<somepath>\arduino-1.0.5\hardware\tools\arm-none-eabi\bin
  • Eclipse:
    From the menu go to: Window->Preferences->C/C++->Build->Environment
    Add to the end of PATH: C:\<somepath>\arduino-1.0.5\hardware\tools\arm-none-eabi\bin
    (note: use semicolon as delimiter between previous path)

Next will be creating a new project. Usually once I get it working I use the first one as a template and simply copy it to generate new ones, instead of redoing all this.
  • In Eclipse, create a project, click on menu File->New->C++ Project
  • Enter a project name: NewProject
  • Optional - I always uncheck the "Use default location" and browse to my project directory
    (Note!!: if you do browse to a directory, make sure to add a new directory with your project name, otherwise it will dump all the new stuff right in the base directory)
  • In the "Project type" area, select "ARM Cross Target Application/Empty Project"
  • In the "Toolchains" area, select "ARM Windows GCC (Yagarto)".
  • Click Next
  • Uncheck Debug
  • Click Finish
Now a key step, instead of building Teensyduino into a static core library, we will simply link the Teensyduino folder into our project. Do this as follows:
  • In the left-hand "Project Explorer" pane, right-click on the project name, click on New->Folder item of popup menu.
  • Click "Advanced" button
  • Select "Link to alternate location (Linked Folder)", and browse to C:\<somepath>\arduino-1.0.5\hardware\teensy\cores\teensy3
Next comes the libraries setup. I'll admit I don't have a great solution here. The problem stems from wanting to be able to build identical .cpp/.ino files in both Arduino and Eclipse. Arduino as everyone knows has it's own unique way of handling libraries, in Eclipse it is a bit more manual. I'm not sure if the Arduino plugin assists with this.

So the basic idea is the same as above, link to any library folders that will be used. However I don't recommend linking to the main Arduino libraries folder as during compile time it will try to compile all the libraries (and all the examples). What I usually do is link to my sketchbook/libraries folder, to which I copy any libraries I'm working with (this also allows Arduino compiles to work). This has a side benefit, in that when I make edits to the libraries, both Arduino and Eclipse see the edits. So in my system it would be done something like this:

  • In the left-hand "Project Explorer" pane, right-click on the project name, click on New->Folder item of popup menu.
  • Click "Advanced" button
  • Select "Link to alternate location (Linked Folder)", and browse to C:\<sketchbookLocation>\libraries
    (note: sketchbookLocation is the path you see when in Arduino you do File->Preferences)

  • Now for any library that has examples, it needs to be excluded from the build. This is done as follows:
  • In the left-hand "Project Explorer" pane, expand "libraries", then expand the library containing the examples.
  • Right-click the "examples" folder and click "Resource Configurations->Exclude from Build..."
  • Check the "Release" checkbox and click OK. It will not compile anything in that folder during the build. You should see a slash through the folder icon, like this:
    screenshot.288.jpg
Now to create a source folder:
  • In the left-hand "Project Explorer" pane, right-click on the project name, click on New->Folder item of popup menu.
  • Type "src" in the "Folder name", and click Finish.
Now to create the sketch. You have options here, but if I were trying to make a program that can be distributed, then I would stick to Arduino conventions (cpp file with no header file, and setup() and loop() functions). An example:
  • To create a new .cpp file: Right-click on the "src" directory, click on New->File item of popup menu.
  • Enter "newproject.cpp"
  • Double-click the "newproject.cpp" file and it will open in an editor.
  • Just for testing it at the end, enter the simple blink sketch:
    Code:
    #include "Arduino.h"
    void setup() {                
      pinMode(13, OUTPUT);     
    }
    void loop() {
      digitalWrite(13, HIGH);
      delay(1000);
      digitalWrite(13, LOW);
      delay(1000);
    }

Project Settings:
Now the files should all be ready. The next step is to configure the project settings:
  • Click on the project with right mouse button, select Properties->C/C++ Build->Settings
  • In the "Tool Settings" tab, verify "Target Processor" is "cortex-m4" and the "Thumb" checkbox are enabled.
  • Select "ARM Yagarto Windows GCC C Compiler", in "Preprocessor", in the "Defined symbols" area, add the following items:
    • __MK20DX256__ (use __MK20DX128__ for Teensy 3.0)
    • F_CPU=96000000
    • USB_SERIAL
    • LAYOUT_US_ENGLISH
    • ARDUINO=105
  • In "Optimization":
    • Set "Optimize Size (-Os)"
    • Check "Function sections (-ffunction-sections)"
    • Check "Data sections (-fdata-sections)"
  • Repeat the above for "ARM Yagarto Windows GCC C++ Compiler" section.
  • In the "ARM Yagarto Windows GCC C++ Compiler" section, in "Miscellaneous":
    • Set "ISO 2009 C++ with GNU Extensions (-std=gnu++0x)"
    • Check "Do not use exceptions (-fno-exceptions)"
    • Check "Do not use RTTI (-fno-rtti)"
  • Select "ARM Yagarto Windows GCC C++ Linker", in "General", in the "Script file" field, browse to
    "C:\<somepath>\arduino-1.0.5\hardware\teensy\cores\teensy3\mk20dx256.ld" file. (use mk20dx128.ld for Teensy 3.0)
  • Check "Remove unused sections (-Xlinker --gc-sections)"
  • Click OK/Apply to make it all stick.
  • Next, click on the project with right mouse button, select Properties->C/C++ General->Paths and Symbols
  • On the "Includes" tab, select "GNU C"
  • Click "Add", click "Workspace...", select "teensy3" directory in project, click "Ok"
  • On the "Includes" tab, select "GNU C++"
  • Click "Add", click "Workspace...", select "teensy3" directory in project, click "Ok"
  • Now for another tedious library bit. In order to find the include files, the libraries used must be explicitly listed here. In the same place, do the following:
    • Click "Add", click "File System...", browse to whatever libraries you include. For instance, using my i2c_t3 library I would have the following entry:
      C:\<sketchbookLocation>\libraries\i2c_t3
    • Similarly add in paths to any other libraries used. If you don't do this, the include files won't work. Now you might ask why not include the base libraries directory instead of each specific one. Again this is for the Arduino compatibility. If I included the base library then instead of #include "i2c_t3.h" I would have to write #include "i2c_t3/i2c_t3.h".

So final step is to build the project, click on the little hammer icon and it should build and spit out a hex file. Also, as outlined in a earlier post, you can set it up so that the Teensyduino loader can be executed via a button. I use this quite a lot. Just make sure to put your cursor in the project.cpp file before hitting the button otherwise it will complain it can't find the project name (apparently uses the current file to determine what project to upload).

Now one nice thing of this setup is it does not require modification when Teensyduino is updated. No rebuilding the core, or maintaining the 3.0 vs 3.1 separation, just swap in the new Teensyduino in the same path as the old one and rebuild the project. Oh one bit regarding 3.0/3.1 - if you retarget a project to a different device, after changing the #define and .ld, right-click on the "Release" directory and delete it, then rebuild. Eclipse is not good at fully rebuilding when that happens.

And again, once you do this setup once, just copy it to make new projects.

Also I would be interested if someone knows how to make Eclipse build an .ino as a .cpp (when porting a project out to Arduino the copy/rename can get tiresome).
 
Last edited:
Hi everyone,

I didn't check into the Arduin Eclipse Plugin too much yet, but can anyone here tell me if the HEX files needed for the Teensy loader is Motorola or Intel (s-rec vs intel hex)?

Thanks,
Mevon
 
I wondering if I should start with the Arduino IDE or just jump in to using eclipse? Does Paul (PJRC) just use the Arduino IDE for all the wonderful library support he gives?
 
Last edited:
Yes. At least start with the Arduino IDE. Even if you never really use it, just having it installed can be really handy to check whether a problem you're having in some other environment also happens in Arduino.
 
Thanks Paul. I'll get it installed tonight and will likely buy a 3.2 so I can get started before the Kickstarter ships. I came soooo close to getting a 3.x so many times but waned something with a floating point unit in it. I ended up never getting pass buying the boards with my ST boards. Doesn't matter how fast FP math is if you don't get passed ordering the board.
 
Paul is absolutely right. Start with the Arduino IDE. For Teensy you have to install Arduino iDE and add Teensyduino to it before you can tell the Arduino eclipse plugin named sloeber where the teensy hardware information is located on your system.
Jantje
 
Thanks Paul. I'll get it installed tonight and will likely buy a 3.2 so I can get started before the Kickstarter ships. I came soooo close to getting a 3.x so many times but waned something with a floating point unit in it. I ended up never getting pass buying the boards with my ST boards. Doesn't matter how fast FP math is if you don't get passed ordering the board.

I did in fact order a 3.2 the same day and I just wanted to say you shipped it incredibly fast.I ordered using my phone while I should have been working and before my next break at work I had a couple emails including one with the tracking number. It already had shipped. I'm impressed and just wanted to say well done and thanks.
 
Good day Nassa

I see that you did this in 2012 with the Teensy 3 ( implying the Teensy 3.0) but will it work with the Teensy 3.5 and 3.6?
I am looking at purchasing one of then as they have more pins than Teensy 3.1 and 3.2. I also not allowed to the Arduino IDE.

You Answer would be greatly appreciated.

Kind regards,
Timtodie
 
Good day chow

I have also interested your method and would like to know if it will work with the Teensy 3.5 and 3.6?
Your answer would be greatly appreciated as well.

Kind regards,
Timtodie
 
I didn't test this out yet. But I support Teensy so if there is a problem make a issue and I'll fix it.
Jantje
 
Good day Jantje

I tried to follow step 4 of the post on page 1 posted by Nassarane on 12-08-2012, 09:48 PM.

I followed all the steps up to the below mentioned steps but I cant seem to find the “ARM Cross Target Static Library/Empty Project”. in the “Project type” area or the “ARM Windows GCC (Yagarto)” in the “Toolchains” area. I however could not download the zip folder for the ARM GNU plugin and thus installed it via the install new software option in the help tab of Eclipse.

- 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)”.

I was not 100% sure what was meant by (Add Teensy tool chain path in the Windows Path : “C:\Teensy3\arduino-1.0.2\hardware\tools\arm-none-eabi\bin”) so what i did was install the teensyduino software in the Teensy3 folder and then pasted the application into the Windows Path : “C:\Teensy3\arduino-1.0.2\hardware\tools\arm-none-eabi\bin”.

Any assistance or updated instructions would be greatly appreciated.

Kind regards
Timtodie
 
Last edited:
Did you manage to download the V3 file from the posted link timtodie, i seem to be having problems downloading it. My download will reach a maximum download speed of 23 kb/s before decreasing and staying on 0b/s after a few seconds. It is not my imternet as I have tested the upload and download speeds numerous times to confirm.

Could someone please suggest a fix or provide an alternative download link?
 
Did you manage to download the V3 file from the posted link timtodie, i seem to be having problems downloading it. My download will reach a maximum download speed of 23 kb/s before decreasing and staying on 0b/s after a few seconds. It is not my imternet as I have tested the upload and download speeds numerous times to confirm.

Could someone please suggest a fix or provide an alternative download link?

check http:\\sloeber.io
I had to move all download files
 
Status
Not open for further replies.
Back
Top