Re: some questions regarding bootloader on mega128
"E. Weddington" <[email protected]> Wed, 28 May 2003 06:30:38 -0600
| Newsgroups | gmane.comp.hardware.avr.general |
|---|---|
| Message-ID | <[email protected]> |
Marc Wetzel wrote:
> Hi alltogether,
>
> I have some questions regarding the bootloader on the mega128.
>
> Is it possible to jump to the bootloader section from the application
> section?
> E.g.
> if (command == ENTER_BOOTLOADER)
> asm volatile("jmp 0xFE00");
>
Caution! The bootloader addresses in the m128 datasheet (and probably
others) are WORD addresses! So that address above should be 0x1FC00.
Also, I have a bootloader support header, boot.h, that provides an API to
help write bootloaders. My plan is to (soon) roll it into avr-libc. You
can set a function attribute on your bootloader routines and then relocate
your bootloader code to the correct address through your makefile and
linker flags (see avr-libc FAQ). You should then, just be able to call the
function directly:
if (command == ENTER_BOOTLOADER)
bootloader();
Others have tried out boot.h with success, especially on the mega128. Let
me know if you want a copy.
Eric