How can my main application access functions in the bootloader?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can my main application access functions in the bootloader?

842 Views
jdupre
Contributor II

I have two projects based on the LPCOpen libraries.  The bootloader does checksum calculations, serial IO, saves data to flash, etc.  The main application also needs to do these functions.  Is there a method to set up these projects so that the main application has access to the same functions that reside in the bootloader?  The point being to make the main application image smaller in size by accessing code in the bootloader.

An alternative would be a shared library that resides in flash that both the bootloader and  application could access.

0 Kudos
2 Replies

566 Views
tomaskrysl
Contributor I

I've seen this approach already when I worked for one company and it is error prone and thus not very safe. We don't share any code between application and bootloader. All we share is a common data segment. We use the same features you mention (plus Ethernet IO) and our bootloader occupies only 8KB FLASH (not LPCOpen based), the rest is application (we use LPC1766 with 256KB Flash).

0 Kudos

566 Views
lpcxpresso_supp
NXP Employee
NXP Employee

You may be able make use of the linker "--just-symbols" option to get the addresses of the bootloader functions you need to access into the main application. Check the ld docs (within the LPCXpresso IDE Help system or online at https://sourceware.org/binutils/docs-2.26/  ) for basic information. But I suggest doing an internet search for more information.

Regards,

LPCXpresso Support

0 Kudos