I did this:
In loader file I added
__application_size = SIZEOF(.text) + SIZEOF(.data);
after definition of .text and .data
Warning,
in LpcXpresso you should uncheck Manage Linker Script, located in
proprierties -> C/C++ Build -> Tool Settings -> MCU Linker -> Managed linker script
and link your own linker file in Linker Script text box
(you can copy the default one and edit it)
In code I used variable
extern unsigned long __application_size;
#define APPLICATION_SIZE (uint32_t) (&__application_size);
and function
uint32_t getApplication_size(void)
{
return APPLICATION_SIZE;
}
Hope it works for you