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

configuring the xdata in the startup.a51

I have assigned 0x0000 to 0xF7FF space to the external RAM and the rest space i.e. 0xF800 to 0xFFFF to the I/O devices. Please advice me on the following:
1) The xdata defination in the target files should be 0-F7FF or 0-FFFF?
2) In the startup.a51 file, what should be the configuration of the XDATA
3) I donot want the compiler to allocate any variable or stack in 0xF800 to 0xFFFF space.
4)Does the _at_ defination makes sure that the data being defined there is not initialized to 0 by the startup.a51 and the init.51 files.

Regards
Mohit

Parents
  • 1) What is the drawback if we donot initialise the XDATA Space to 0 using the startup.a51 file.

    In C, by default all global uninitialized variables are set to a value of 0. That's what clearing the memory to 0 does. If this is not important, you can leave this out.

    2) If I XRAM is from 0 - 0xF7ff and I want my battery backup variables to reside from 0x8000 - 0xF7FF then should I should specify the XDATALEN as 0x8000 in the startup.a51 file to make sure that this area is not initialized?

    Yep. That's it exactly.

    Jon

Reply
  • 1) What is the drawback if we donot initialise the XDATA Space to 0 using the startup.a51 file.

    In C, by default all global uninitialized variables are set to a value of 0. That's what clearing the memory to 0 does. If this is not important, you can leave this out.

    2) If I XRAM is from 0 - 0xF7ff and I want my battery backup variables to reside from 0x8000 - 0xF7FF then should I should specify the XDATALEN as 0x8000 in the startup.a51 file to make sure that this area is not initialized?

    Yep. That's it exactly.

    Jon

Children
No data