This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to define variables in a range of external ram, and start at a fixed address

Do anybody know how can I define some variables in a range of external ram, and start at a fixed address ?

When I use IAR, I can do it in the following way :
----------------------------------
(In the ....h file)
#pragma memory=dataseg(E_XDATA)
EXTERN UINT16 Tot_Rx_Cnt;
EXTERN UINT16 Tot_Misc_Err;
EXTERN UINT16 Tot_Tout_Err;
#pragma memory=default
----------------------------------
(In the ....xcl file)
-Z(XDATA)E_XDATA=0000-00FF
----------------------------------

How can I do in order to achieve the same thing using Keil ?

Parents
  • I see no reason to do so, except for debugging reasons. It is so much easier to display a buffer when you know where it is every time instead of having to hunt it because C and the linker (legally) may have relocated it.

    I define all XDATA in an assembler module and then have a .h that makes tham defined as externs.

    Erik

Reply
  • I see no reason to do so, except for debugging reasons. It is so much easier to display a buffer when you know where it is every time instead of having to hunt it because C and the linker (legally) may have relocated it.

    I define all XDATA in an assembler module and then have a .h that makes tham defined as externs.

    Erik

Children