Is there any good way to allocate RAM address of global variables in .h(header file) in a coding-declared order?

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

Is there any good way to allocate RAM address of global variables in .h(header file) in a coding-declared order?

跳至解决方案
1,693 次查看
ikkishingu
Contributor II

Is there any good way to allocate RAM address of global variables in .h(header file) in a coding-declared order?

 

[background of this question]
My customer uses in-house RAM monitor tool to monitor RAM values.
Now they define the global variables in .h file, and build on CW10.6, and MAP file is generated.
Whenever they add global variables, RAM address of global variables is changed.
This bothers them because they have to change RAM address settings of RAM monitor tool every time they add global variables.
They expect RAM address of global variables are not changed by the addition of global variables.

 

Best,

Ikki

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,488 次查看
trytohelp
NXP Employee
NXP Employee

Hi Iki,

There are some possibilities you can use.

@keyword or #pragma can be used to do that.

for instance:

unsigned int fiboCount@0x002000;    /* define the fiboCount at 0x002000 */

#pragma DATA_SEG my_data_test        /* my_data_test is defined in the prm file which is using the RAM_TEST memory section */

unsigned int counter;

#pragma DATA_SEG DEFAULT_RAM

unsigned fib1, fib2, fibo;            /* the default memory is used */

Attached you will find an example.


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,488 次查看
trytohelp
NXP Employee
NXP Employee

Hi,

What is the processor your customer is using ?


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,488 次查看
ikkishingu
Contributor II

Hi,

Thank you for your responce.

> What is the processor your customer is using ?

S12ZVM, MagniV.

Best

Ikki

0 项奖励
回复
1,489 次查看
trytohelp
NXP Employee
NXP Employee

Hi Iki,

There are some possibilities you can use.

@keyword or #pragma can be used to do that.

for instance:

unsigned int fiboCount@0x002000;    /* define the fiboCount at 0x002000 */

#pragma DATA_SEG my_data_test        /* my_data_test is defined in the prm file which is using the RAM_TEST memory section */

unsigned int counter;

#pragma DATA_SEG DEFAULT_RAM

unsigned fib1, fib2, fibo;            /* the default memory is used */

Attached you will find an example.


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,488 次查看
ikkishingu
Contributor II

Hi Pascal,

Thank you for your helpful info!!

Ikki

0 项奖励
回复