How to Access Memory

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

How to Access Memory

803 Views
netra
Contributor IV

can anyone give me a example code to store a structure  in particular memory address.

Structure consist of data members (a) string (b)pointer to next structure.

Please reply,thanks in advance

2 Replies

695 Views
JuroV
NXP Employee
NXP Employee

I prefer the placement specification in the linker file and name the section where you want to place those symbols. Because the linker is responsible about symbol placement, it is good approach to define it in the linker file. And it is good to have everything related to the symbol placement in one file instead of many.

695 Views
BryGuyH
Contributor IV

That is compiler specific so you have to look at the compiler you are using and determine from their documentation how best to accomplish that.

If you are using codewarrior the forum for that is:

CodeWarrior Development Tools

GCC uses __attribute__ specifiers to place variables into sections. Your linker script then has to allocate those sections to the correct addresses

ARMCC (Keil) also use the __attribute__ specifiers just as GCC but also has the ability to use the specifer "at" which allows you to directly place a variable (or structure) at the given address without having to change your scatter file.

0 Kudos
Reply