fixed location for const

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

fixed location for const

1,029 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Jarda on Thu Oct 13 23:00:10 MST 2011
Hi,
is there any possibility to locate constant on given address in LPCXpresso? I need to put serial number to known position for automatically updating it in production.
Thank you for your tips.
Jarda
0 项奖励
回复
4 回复数

1,014 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Oct 17 14:20:45 MST 2011
The syntax you are trying to use, "__attribute__((at(" looks like it is taken from some code written for the Keil/RealView ARM compiler. It is not supported by GCC (as used by LPCXpresso), so I'm a little surprised that you say that it works under Rowley, (as that uses GCC too).

Thus as already pointed out, with LPCXpresso, you will need to modify the linker script.

Regards,
CodeRedSupport.
0 项奖励
回复

1,014 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Jarda on Sun Oct 16 23:28:41 MST 2011
Thank you for your answers, but it is a little bit complicated. I wish something like:
const unsigned long serial_num __attribute__((at(0x1F18))) = SER_NUM;
it works in Rowley's CrossStudio.
Is it such a possibility in LPCXpressou too, or only way is through modify linker script to define memory region?
Jarda
0 项奖励
回复

1,014 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Oct 14 11:13:26 MST 2011
http://knowledgebase.nxp.com/showthread.php?t=1537
0 项奖励
回复

1,014 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Fri Oct 14 01:46:58 MST 2011
Did you search the FAQs?

http://support.code-red-tech.com/CodeRedWiki/PlacingData
0 项奖励
回复