Using xhuge memory

Hello,

I have been using an xhuge array of size 512KB on the C167HSE and my software has been working fine. It is declared as follows:

unsigned int xhuge x[256000]={0};

By looking at .M66 file (MEMORY MAP OF MODULE section), the begin, end, and the size looks like the following:

300000H 37CFFFH 07D000H

Now I need to enlarge the array from 512KB to 800KB and I'm getting the following error:

WARNING L5: SECTION LOCATED OUTSIDE CLASS AREA
SECTION: ?XD0?MAIN
CLASS: XDATA0

C167HSE has two 512KB RAM. How can I create a logical array of 400000 type int? Thanks in advance.

Parents
  • You should map the two 512K banks of RAM into address space so that they are contiguous. It can be done by adjusting the relevant ADDRSELx registers. If I understood the hardware manual for phyCORE-C167HS/E correctly, setting ADDRSEL1=0x2007 and ADDRSEL3=0x2807 will give you a 1M continuous block of RAM in address range 0x20000-0x2FFFFF. That's just an example, adjust ADDRSELx's to meet your needs. After that configure memory banks in Keil Target Options dialog, because now you have a single 1M block of RAM instead of two separate 512K ones. Then it should be possible to allocate a 800K array.

    Regards,
    - mike

Reply
  • You should map the two 512K banks of RAM into address space so that they are contiguous. It can be done by adjusting the relevant ADDRSELx registers. If I understood the hardware manual for phyCORE-C167HS/E correctly, setting ADDRSEL1=0x2007 and ADDRSEL3=0x2807 will give you a 1M continuous block of RAM in address range 0x20000-0x2FFFFF. That's just an example, adjust ADDRSELx's to meet your needs. After that configure memory banks in Keil Target Options dialog, because now you have a single 1M block of RAM instead of two separate 512K ones. Then it should be possible to allocate a 800K array.

    Regards,
    - mike

Children
More questions in this forum