How to Access Memory

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

How to Access Memory

565 次查看
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 回复数

457 次查看
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.

457 次查看
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 项奖励