> -----Original Message----- > From: > avr-gcc-list-bounces+eweddington=cso.atmel....@nongnu.org > [mailto:avr-gcc-list-bounces+eweddington=cso.atmel....@nongnu. > org] On Behalf Of dphar...@telus.net > Sent: Sunday, December 28, 2008 11:11 PM > To: avr-gcc-list@nongnu.org > Subject: [avr-gcc-list] Sharing code between a bootloader and > an application. > > Since bootloaders need to establish communications in order > to function, it would seem useful to be able to use some of > this functionality by the bootloaded application code. In > particular, this is in relation to CAN, where the boot-up > code will need to establish a node-id, and be able to > communicate serial number information to a central node. > > > > Obviously, access to the serial number, and links to the CAN > driver routines, would be useful in the applications code, > and would save duplication. > > > > How would one go about producing a header or library file > that would let you link references to the routines in the > bootloader for use in the application?
One solution is to place the routines at fixed addresses. In your application, you would call these routines by an indirect call through a function pointer, pointing at the fixed known address of a subroutine. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list