Re: How to link embedded code against existing routines in flash



"emeb" <ebrombaugh@xxxxxxxxx> wrote in message
news:56ce350c-27a3-4a31-b8a3-0919918abc63@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm using arm-elf-gcc to write embedded code targeting the NXP
LPC2148. My application code will be loaded from an SD card into the
MCU flash and run by an existing bootloader described in more detail
here:

http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=94

This bootloader contains a number of utility / library routines that
I'd like to be able to use from my own application rather than
duplicating the same code in my binary file. Since I've compiled &
flashed the bootloader myself, I have access to all the linker output
from the build process, including the maps, lists and symbol tables
and I know what the function addresses are. What I need is a clean way
to let the compiler/linker know this when I prepare the application
code.

There are several solutions to this problem. You can use (a) software
interrupt(s) to access functions in the bootloader, you can create a call
table at a fixed address and even let the bootloader pass a pointer to that
table to main(). The benefit of this approach is that you don't need to
rebuild your application when the bootloader changes.

Meindert


.



Relevant Pages