declaring variable at absolute ram location in lpcxpresso

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

declaring variable at absolute ram location in lpcxpresso

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by badri89 on Wed Sep 05 22:15:56 MST 2012
Hi all,

I need to define a variable at absolute ram location. I tried the way discussed in this following:

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

But I am getting errors, stating the linkerscript is not found. Though I given the location properly, still it shows the error.

Kindly post the steps involved in  defining variable at absolute ram address. Is there any way without using linkerscripts, like __at attribute in keil?

Thanks
0 Kudos
Reply
1 Reply

281 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Thu Sep 06 17:17:25 MST 2012
There is a way for doing that in Flash, so it might be the same procedure in RAM:

GPIO_T * myVar= (GPIO_T *)(0xE0028000);


Where GPIO_T is a struct that holds the registers used by GPIO in the LPC2129 uC, but you can use whatever makes sense for your project.

This other snippet is used with LPCXpresso, and works great, although more obscure, 'cause a lot of #define(s) involved:

LPC_TIMER_T * tmr32b1 = (LPC_TMR_TypeDef *)(LPC_CT32B1_BASE);
0 Kudos
Reply