Using eclipse CDT or just avr-gcc on command line

I want to use eclipse. I downloaded eclipse CDT, configured it for WIFI Rev 2, and built the blink led code. As I recall, it would not download the file.

I create a batch file to download the program using avrdude. I have used this batch file to download the blink led hex file generated by the arduino IDE successfully. Blinks the led on the board. Using the same batch file to download the eclipse hex file does not blink the led. Downloads just fine, erases the flash, programs the flash and just sits there.

I have been able to compile the led blink program and core core/api variant and blink.cpp files from the command line using the Arduino IDE tools, download the hex file with my avrdude batch file but no joy.

The working arduino ide hex file is different from the hex files generated from the command line or from eclipse. The object files are different for each source.

I have copied the gcc switches used by the arduino IDE from the bottom window. I am using the same switches for my compiles from the command line and with eclipse. Still no joy.

Got any ideas ???

As I recall, it would not download the file.

It might be helpful if you post the error message you get when you try to do that.

I do non get any compile errors. Program just will not blink the led. The avrdude batch file listed below:

@echo off
REM avrdude test ! it worked with arduino ide hex file !

set DUDE_HOME=C:\Users\CJR\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14

echo %DUDE_HOME%

%DUDE_HOME%/bin/avrdude -C%DUDE_HOME%\etc\avrdude.conf ^
-patmega4809 ^
-cxplainedmini_updi ^
-Pusb ^
-b115200 ^
-V ^
-v ^
-e ^
-D ^

A log of the makefile output is attached as make_log.txt.

make_log.txt (25.3 KB)


Got it to work. Turns out that the link needs to have as inputs in this order: blink.o variant.o core.a

Not sure why. Make file is attached. It is a modified version of the makefile from eclipse cdt and is not optimal. Had to rename to Makefile.txt so it would upload…

Makefile.txt (12.5 KB)