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
  • 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?

    The memory area you specify in the target tab of the project options is the memory area that the linker can use to locate program code and variables. Therefore, the area you specify for XDATA should be 0x0000-0xF7FF.

    2) In the startup.a51 file, what should be the configuration of the XDATA

    The startup code clears the XDATA ram for the range that you specify. If you don't want the startup code to clear ANY of the XDATA, you must specify a 0 for the XDATA size. If you want it to clear your RAM and your memory-mapped devices, specify a size of 0x10000.

    3) I donot want the compiler to allocate any variable or stack in 0xF800 to 0xFFFF space.

    OK. See #1.

    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.

    No. That is done in the startup code.

    Jon

Reply
  • 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?

    The memory area you specify in the target tab of the project options is the memory area that the linker can use to locate program code and variables. Therefore, the area you specify for XDATA should be 0x0000-0xF7FF.

    2) In the startup.a51 file, what should be the configuration of the XDATA

    The startup code clears the XDATA ram for the range that you specify. If you don't want the startup code to clear ANY of the XDATA, you must specify a 0 for the XDATA size. If you want it to clear your RAM and your memory-mapped devices, specify a size of 0x10000.

    3) I donot want the compiler to allocate any variable or stack in 0xF800 to 0xFFFF space.

    OK. See #1.

    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.

    No. That is done in the startup code.

    Jon

Children
More questions in this forum