Global variable on LPC1113

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

Global variable on LPC1113

855 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxmel on Thu Jan 06 09:06:53 MST 2011
[FONT=Verdana][SIZE=2]Hi, [/SIZE][/FONT]
[FONT=Verdana][SIZE=2][/SIZE][/FONT]
[FONT=Verdana][SIZE=2]I have got a question on the placement on the global variables :[/SIZE][/FONT]
[FONT=Verdana][SIZE=2]the unsigned char and unsigned  int  are not located in the file .map in the order of their declarations [/SIZE][/FONT]
[FONT=Verdana][SIZE=2]there is no optimization selected[/SIZE][/FONT]
[FONT=Verdana][SIZE=2] [/SIZE][/FONT]
[FONT=Verdana][SIZE=2]What is the reason?  How to fix their addresses?[/SIZE][/FONT]
[FONT=Verdana][SIZE=2][/SIZE][/FONT]
[FONT=Verdana][SIZE=2]Thank you[/SIZE][/FONT]
0 项奖励
回复
2 回复数

848 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxmel on Fri Jan 07 01:17:30 MST 2011
thank you
0 项奖励
回复

848 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu Jan 06 10:04:50 MST 2011
The C language does not provide any guarantees about where globals will be placed. It all depends on how the compiler (and linker) decide to place them. If you need your char and int to be 'next' to each other, place them in a structure. If you want to physically locate them at a specific location in flash, look at the CRP examples to see how this is done.
0 项奖励
回复