Global variable on LPC1113

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

Global variable on LPC1113

244 Views
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 Kudos
2 Replies

237 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxmel on Fri Jan 07 01:17:30 MST 2011
thank you
0 Kudos

237 Views
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 Kudos