How to exclude code from flash space? LPC1114

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

How to exclude code from flash space? LPC1114

693 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JSalisbury on Tue Aug 23 04:06:45 MST 2011
Hi,
I would like to use the upper 2 flash sectors for use as flash based non-volatile storage as per AN11008. What is the best way to arrange the linker script for this, it is posiable to use cr_section_macros.h or do I have to manualy edit the linker script?

Thanks
0 Kudos
Reply
2 Replies

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Aug 23 06:22:49 MST 2011
This is described here:
http://support.code-red-tech.com/CodeRedWiki/OwnLinkScripts
0 Kudos
Reply

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Tue Aug 23 05:08:01 MST 2011
You have to change the linker script.
But do remember that you should not change the default linked script as that one can/will be overwritten by the LPCXpresso tools.

The best way to do this is to create a new directory called linkscripts and copy the linker script file to that directory.
The RDB1768cmsis2_usb_bootloader example contains a section called 'Modifying your linker scripts' that contains a step by step instruction on how to do this.

When changing the linker script you have two options: The first (and easiest one) is to just change the length of the Flash section to exclude the last two sectors. Your software will have to hard code the addresses of these sectors.
The second is to add separate sections for both sectors and use the _SECTION macro from cr_section_macros.h to place two arrays in these sections.

I'd go for the easy solution and just change the end address of the Flash section.

Rob
0 Kudos
Reply