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
解決済! 解決策の投稿を見る。
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!
-----------------------------------------------------------------------------------------------------------------------
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!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Thank you for your responce.
> What is the processor your customer is using ?
S12ZVM, MagniV.
Best
Ikki
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Pascal,
Thank you for your helpful info!!
Ikki