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

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

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

Jump to solution
1,024 Views
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

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
820 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
4 Replies
820 Views
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 Kudos
Reply
820 Views
ikkishingu
Contributor II

Hi,

Thank you for your responce.

> What is the processor your customer is using ?

S12ZVM, MagniV.

Best

Ikki

0 Kudos
Reply
821 Views
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 Kudos
Reply
820 Views
ikkishingu
Contributor II

Hi Pascal,

Thank you for your helpful info!!

Ikki

0 Kudos
Reply