Absolute memory location

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Absolute memory location

578件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jim.smith on Thu Jan 06 11:38:18 MST 2011
I'm working toward compiling code from NXP app note AN10960.  Part of that code places some variables in a particular block of RAM and initializes them to default values.  During program execution those values can be changed or read, and and the entire block of variables can be stored/retrieved from NVRAM using the iap_entry calls 

The app note used the KEIL compiler, and has a line like

[FONT=Courier New][SIZE=2]const BYTE LEVEL __attribute__((at(0x00003000))) = 254;[/SIZE][/FONT]

That places the byte variable LEVEL at ram location 0x00003000 and initializes it to the value of 254.  It can be read, or written, and the location of the block of variables is known so we can use the iap_entry calls to stuff it into NVRAM.  Unfortunately, the LPCXpresso GNU compiler does not recognize the [FONT=Courier New]at [/FONT]attribute.  Any ideas on how to do this the LPCXpresso way?  I've looked through the forums and the help files and so far have come up empty.
0 件の賞賛
返信
1 返信

557件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Thu Jan 06 15:14:24 MST 2011
I've not looked at the apps note, but I imagine that you'll need to place the variable into its own section, and then place the section appropriately within the project linker script.

Suggest you take a look at these FAQs....

http://support.code-red-tech.com/CodeRedWiki/PlacingData
http://support.code-red-tech.com/CodeRedWiki/OwnLinkScripts
http://support.code-red-tech.com/CodeRedWiki/EnhancedManagedLinkScripts

HTH!
0 件の賞賛
返信