[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] bootloader woes

From: Reza Naima
Subject: [avr-gcc-list] bootloader woes
Date: Thu, 22 May 2003 01:04:27 -0700
User-agent: Mutt/1.4i

Thanks for the file.  I've modified the code that comes with MegaLoad
(originally IAR-CC) to compile with avr-gcc, and trying to use that as my
bootloading system.  However, I've been running into some problems, and
any help would be welcome.  I'm using the FTDI usb<->serial
(www.ftdichip.com) ICs to upload the new flash.  I'm also using a serial
port to do debugging.  I'm also doing this on the ATmega128.

First off, my test code is setup with a main() function that will invoke
the bootloader() function.  I've tried this both with a call and a jump
code, same results.  If the bootloader() function is not at
0x1E000 (I'm also using that ATmega128 with BOOTZ1=0 and BOOTZ0=0), then
it seems to work fine.  If the function is relocated to 0x1E000 (or
anywere else, then it doesn't work).  Nor does it work on a reset
(BOOTRST = 0).  If I let avr-gcc do the locating, then it works fine.

A friend suggested that the problem is that if it's just the function
that's located at 0x1e000, then upon reset, the stack pointer/etc is not
going to be initalized, and thus the bootloader will not work.  However,
by simply calling the function, it still fails.  Any thoughts?  I've
tried putting the bootloader code in main(), and relocating the entire
text section to 0x1e000 (avr-gcc ... -Ttext 0x1E000), but that doesn't
seem to help at all.

Any advice would be greatly appreciated.  


reply via email to

[Prev in Thread] Current Thread [Next in Thread]