Society of Robots - Robot Forum

Software => Software => Topic started by: klims on June 15, 2010, 12:06:26 AM

Title: Webbotlib without AVR Studio in windows: need help
Post by: klims on June 15, 2010, 12:06:26 AM
Hi guys,

I have been trying to get my robot working with the webbotlib's and have run into some trouble. I have decided to start with the "Hello world" example that comes in the webbotlib zip file, and am using a modified makefile I found at http://www.societyofrobots.com/member_tutorials/node/381 (http://www.societyofrobots.com/member_tutorials/node/381) and got it compiling successfully (I think).
This is my makefile:
Code: [Select]
# Name: Makefile
# Created: 12/FEB/2010 to work with WebbotLib-1-15
# Last Updated: 12/FEB/2010

# PROJECT is the program file name used without the .c
# Choose TARGET to match your MCU from this list: atmega8, atmega32, atmega168, atmega640, atmega329p, atmega2560, atmega2561
# Choose LIBRARY to match your MCU from this list: Webbot-ATMega8, Webbot-ATMega32, Webbot-ATMega168, Webbot-ATMega640, Webbot-ATMega328P,Webbot-ATMega2560, Webbot-ATMega2561
# CPU_SPEED is in Hz. 16MHz = 16000000. 8MHz = 8000000. 1MHz = 1000000
# WEBBOTLIB is where you unpacked WebbotLib.

PROJECT = webbotlib_test
TARGET = atmega640
LIBRARY = Webbot-ATMega640
CPU_SPEED = 16000000
WEBBOTLIB = ../Source/webbotavrclib-1.20/

# If your system has problems finding avr-gcc, specify the full path here.
GCC = avr-gcc
LINKER = avr-objcopy

COMPILE = -Wall -I"$(WEBBOTLIB)" -mmcu=$(TARGET) -Wall -gdwarf-2 -std=gnu99 -DF_CPU=$(CPU_SPEED)UL -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP

LINK = -L"$(WEBBOTLIB)" -mmcu=$(TARGET) -Wl,-Map=WebbotTest.map -l$(LIBRARY) -lm -lc


# symbolic targets:
all:    link

compile:
$(GCC) $(COMPILE) -c $(PROJECT).c -o $(PROJECT).o -MT $(PROJECT).o

link: webbotlib_test.elf compile
$(GCC) $(PROJECT).o $(LINK) -o $(PROJECT).elf

copy: webbotlib_test.hex link
$(LINKER) -O ihex $(PROJECT).elf $(PROJECT).hex

clean:
rm -f webbotlib_test.elf webbotlib_test.hex webbotlib_test.lst webbotlib_test.obj webbotlib_test.cof webbotlib_test.list webbotlib_test.map webbotlib_test.eep.hex webbotlib_test.bin *.o webbotlib_test.s

webbotlib_test.elf:       
rm -f webbotlib_test.elf

webbotlib_test.hex:
rm -f webbotlib_test.hex

From what I read in the makefile I need to "make compile", then "make link" then "make copy" to get a hex file. Does this sound correct?

My problem comes when I try to load the hex file onto my Axon. I am getting an error that says the hex file could not be opened. What does this mean????? I have snapped a shot of the error and have attached.

I'm totally stuck at this point. Any suggestions would be much appreciated.


thanks guys.
Andrew
Title: Re: Webbotlib without AVR Studio in windows: need help
Post by: klims on June 15, 2010, 02:54:00 AM
I worked it out. The file name was too long  ::)

Woohoo I'm compiling with webbotlib's without AVR Studio!