Eclipse development without Arduino

Status
Not open for further replies.

WMXZ

Well-known member
OK,
I was curious if I could use eclipse for programming Teensy in a more bare-metal style, that is, without using Arduino and Teensyduino.
This was done to prepare for a future debugger opportunity with T3.6

I know Jantie's Arduino plugin, but wanted a try without his approach.

So, I accept to miss several Arduino style GUI feature (verify, upload button, build-in terminal, plotter) Jantie has implemented

Summary,
It can be done (needed 2 days to get system up and running).

Of course, my approach is not free of PJRC software, only a slightly different use

I use Paul's cores/teensy3 directory for core software, but not his toolchain as this is not available outside teensyduino (or I could not find it, links are welcome). There is overall compatibility, but I had to comment in a function prototype in WProgram.h due to conflicting system declaration.
Also Paul's system libraries seem to be more compact than the one from the GNU ARM Toolchain.

Instead of teensy.exe for loading, I use my own version of teemsy_loader_cli.


A rough log of the installation is in the following


Code:
/*
 * on windows 10
 * downloaded and installed
 * latest java run time:	jre-8u102-windows-x64.exe
 * eclipse neon (4.6):		eclipse-inst-win64.exe
 * GNU ARM Toolchain:		gcc-arm-none-eabi-5_4-2016q2-20160622-win32.exe
 * GNU ARM build tools:		gnuarmeclipse-build-tools-win64-2.6-201507152002-setup.exe
 *
 * created blink project
 * set toolchain  and build-util path accordingly
 * dragged teensy3 directory from local cores githup into project (link filesystem structure)
 *
 *-------------------------------------------------------------------------------------------
 * Project ->Properties -> C/C++ Build
 *
 * -> Environment		(to be used for used makefile.targets extension)
 *		MCU		mk66fx1m0
 *		TARGET	${ProjName}
 *
 * -> Settings
 * -> target processor:
 * 		arm family: cortex-m4
 * 		arm arch:	armv7e-m
 * 		float ABI:	soft (3.2) or hard (3.6)
 *
 * -> preprocessor symbols (C, C++) or C/C++ General -> Path and Symbols
 *            _FPU_PRESENT
 *            ARM_MATH_CM4
 * 		__MK66FX1M0__
 *		F_CPU=240000000
 *		USB_SERIAL
 *		LAYOUT_US_ENGLISH
 *		TEENSYDUINO
 *		ARDUINO=10600
 *
 * -> miscellaneous
 *		other compiler flags:	-felide-constructors
 *
 * -> include path (C, C++)
 *		"C:\Users\Walter\Documents\GitHub\cores\teensy3"
 *
 * -> Linker
 *	-> General -> script files
 *		"C:\Users\Walter\Documents\GitHub\cores\teensy3\\mk66fx1m0.ld"
 *
 *	-> Miscellaneous
 *		--defsym
 *		__rtc_localtime=$$(date +%s)
 *
 * ------------------------------------------------------------------------------------------
 *	Project -> Make Target
 *		-> Create upload : uncheck all boxes;  insert build command: ${cross_make} -j4 upload
 *		-> create monitor: uncheck all boxes;  insert build command: ${cross_make} monitor
 *
 * -------------------------------------------------------------------------------------------
 *	create makefile.targets (under blink):
 * WMXZ_TOOLS = C:\\Users\\Walter\\Desktop\\teensy_3.1
 *
 * $(TARGET).elf: FORCE
 * .PHONY: FORCE
 *
 * upload: $(TARGET).hex $(TARGET).siz
 *		@echo "__rtc_localtime=$$(date +%s)"
 *		@echo 'Uploading: $<'
 *		@$(WMXZ_TOOLS)\\cliLoader\\teensy_loader_cli -v -mmcu=${MCU} $<
 *	
 *	monitor:
 *		@echo 'monitor'
 *		@$(WMXZ_TOOLS)\\cliLoader\\teensy_loader_cli -p
 *		@$(WMXZ_TOOLS)\\puttytel -serial $(port)
 *
 * ---------------------------------------------------------------------------------------------
 *	comment in WProgram.h
 *		//uint32_t random(void);
 *		as already defined in system library
 * ---------------------------------------------------------------------------------------------
 * to generate template
 * copy content of blink to new directory, say templates\teensy
 * delete all Debug and Release directories
 * keep src, .project, .cproject, .settings, makefile.targets
 *
 * ---------------------------------------------------------------------------------------------
 * to use template for new project, say to test
 * edit in .project in templates\teensy
 * change in 3rd line <name>blink</name> to <name>test</name> 
 *
 * in eclipse
 * File -> Import -> General -> Existing project into workspace
 * brows and choose templates\teensy
 * check test
 * check copy into workspace
 * -> Finish
 *
 * ---------------------------------------------------------------------------------------------
 * to compile (.elf)
 * -> Project
 *	-> Build Project (may need first activation of Project (click in left panel auf project name)
 *
 * to uplad
 * right panel: Make Target
 * 	expand test
 *	select update
 *	select: Build Make Target
 * 
 */

Please note, this post is only an answer that using eclipse for teensy can easily be done, but I'm sure improvements are possible.

edit1: needles to say that all path indications are WMXZ only and should be adapted to local situation

edit2: added -p to teensy_loader_cli to list only com ports.

edit3: better not to use 'build variables' but to define symbols explicit in C++/General Settings under paths and symbols, so IDE is aware of symbols.
also it seems good to create different configuration for T3.2 and T3.6 (say Debug_32 and Debug_36) so one can easily switch between boards
 
Last edited:
Status
Not open for further replies.
Back
Top