I'm programming an XC161 with internal flash memory at 0xC00000..0xC1FFFF and external flash at 0x400000..0xBFFFF (only 0xBB0000..0xBFFFFF 256K is used for program/data - the rest is for a flash file system).
Currently when the code is linked, it starts linking to the external memory at 0xBB0000. I presume because the address of the external memory is lower than the internal memory.
I want the code/data to be loaded into the internal flash memory where possible but if/when the code/data can't fit into the 128K internal flash I want it to be stored in the external flash.
Is there simple* way to specify that all code/data should be linked to the internal flash memory unless it can't fit, which case it should go into the external flash memory.
* By simple, I mean without hardcoding addresses (in the linker) of where to link each source module.
Regards Paul