Go Down

Topic: [RESOLVED!] Modify adaboot for ATmega1284P (Read 1 time) previous topic - next topic

RunAway

Dec 03, 2009, 05:40 pm Last Edit: Dec 04, 2009, 12:47 am by RunAway Reason: 1
Hi, I just got 2 Atmega128P as samples from Atmel.
I was wondering if ADABOOT can be adapted for the 1284P since it already support the 644P (used by Sanguino project).

I tried to modify latest ADABootLoaderR3_9D15 myself, basically I added
Code: [Select]
|| defined(__AVR_ATmega1284P__) in the same #elif of 644P except for the signature section.
However isn't working (no led flashes) :(

I figured out that maybe the problem was "simply" the different LDSECTION value in the Makefile that needs to be changed for the 1284P.
So, as the datasheet say, for a boot size of 1024 words (2kbytes) the boot reset address is 0xFC00 then the LDSECTION will be LDSECTION  = --section-start=.text=0x1F800 (0xFC00 x 2 = 0x1F800)
The value of 1F800 is even confirmed calculating it starting from the flash size (128k = 131072 bytes - 2048 bytes = 129024 bytes = 0x1F800)
However using 0x1F800 give me this error:
Code: [Select]
Max:Yrouel$ make atmega1284p
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -g -Wall -O2 -mmcu=atmega1284p -DF_CPU=16000000L   '-DMAX_TIME_COUNT=F_CPU>>6' '-DBAUD_RATE=57600' '-DADABOOT=4' '-DWATCHDOG_MODS'   -c -o ATmegaBOOT_168.o ATmegaBOOT_168.c
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -g -Wall -O2 -mmcu=atmega1284p -DF_CPU=16000000L   '-DMAX_TIME_COUNT=F_CPU>>6' '-DBAUD_RATE=57600' '-DADABOOT=4' '-DWATCHDOG_MODS' -Wl,--section-start=.text=0x1F800 -o ADABoot_1284p.elf ATmegaBOOT_168.o
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: address 0x2000e of ADABoot_1284p.elf section .text is not within region text
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: address 0x2000e of ADABoot_1284p.elf section .text is not within region text
make: *** [ADABoot_1284p.elf] Error 1
rm ATmegaBOOT_168.o


Here the files I'm using:
Makefile
Modified source (diff with the original)

RESOLVED: I modified the optimization from -O2 to -Os and NO ERRORS! and now the bootloader is working (led flashes correctly) :D

ChrisS

Did I understand right? You got the 1284p fully working with IDE?

If so, please repost links.... they don't ork any more....

Please!

Thank you!
ChrisS
Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

house91320

How did you get the sample from them i have had no luck.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy