Hello there,
First things first, I'm using Linux-x86_64.
I'm starting a rather complex project that will probably require a lot more source tracking (ie. GIT) than the Arduino IDE can manage.
So, i followed the instructions on the playground to get Eclipse, the arduino lib and the toolchain set up to develop there.
It DOES compile things, and AVRDUDE Does upload, when the programmer is set to STK500V2.
The strange problem is that i can't get the timing right on my Arduino. I'm using a Mega2560, so, naturally, the AVR target properties for the library
and the code projects is a Mega2560, running at 16Mhz (setting: 16000000).
Now, i have compiled the basic library as libArduino.a, and i have made a little test program:
#include <Arduino.h>
void setup() {
pinMode(13,OUTPUT);
}
void loop() {
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
The timing IS NOT RIGHT. The led does not blink then wait one second before turning off, and one second before turning on again. Instead, it just blinks madly, twice, then delays randomly before looping all over again. (Much less than a second)
The compiler output is, if it is any help:
**** Build of configuration 2560 for project hemsutClient ****
make all
Building file: ../src/client.cpp
Invoking: AVR C++ Compiler
avr-g++ -I"/home/rasheek/workspace/Arduino/src" -I"/home/rasheek/workspace/hemsutClient/arduinolib" -I"/home/rasheek/workspace/hemsutClient/lib" -DARDUINO=100 -Wall -Os -ffunction-sections -fdata-sections -fno-exceptions -mmcu=atmega2560 -DF_CPU=16000000UL -MMD -MP -MF"src/client.d" -MT"src/client.d" -c -o "src/client.o" "../src/client.cpp"
Finished building: ../src/client.cpp
Building target: hemsutClient.elf
Invoking: AVR C++ Linker
avr-g++ --cref -s -Os -o"hemsutClient.elf" ./src/client.o ./arduinolib/Dhcp.o ./arduinolib/Dns.o ./arduinolib/EEPROM.o ./arduinolib/Ethernet.o ./arduinolib/EthernetClient.o ./arduinolib/EthernetServer.o ./arduinolib/EthernetUdp.o ./arduinolib/SPI.o ./arduinolib/socket.o ./arduinolib/w5100.o -lArduino -lm -lm -Wl,-Map,hemsutClient.map,--cref -Wl,--gc-sections -L"/home/rasheek/workspace/Arduino/2560_16M" -mmcu=atmega2560
Finished building target: hemsutClient.elf
Invoking: Print Size
avr-size --format=avr --mcu=atmega2560 hemsutClient.elf
AVR Memory Usage
----------------
Device: atmega2560
Program: 2976 bytes (1.1% Full)
(.text + .data + .bootloader)
Data: 69 bytes (0.8% Full)
(.data + .bss + .noinit)
Finished building: sizedummy
**** Build Finished ****
I'm at a loss. I'm not sure what is going on here. I hope someone can give me some pointers!
-R