When should I use the Extended Data Space (EDS)?
Extended Data Space (EDS) is used when the memory location to be allocated is beyond the 32 kB limit. As an example for dsPIC33EP512MC204:
- SFR: 0x0000 to 0x0FFF
- XRAM: 0x1000 to 0x8FFE
- YRAM: 0x9000 to 0xEFFF
To allocate 6-byte memory space in the XRAM, you can use section and point it to xmemory. For example, int16_t xdata[3] attribute ((section (".xbss, bss, xmemory")));.
To allocate 6-byte memory space in the YRAM, you can use section and point it to eds. This is because YRAM is located beyond the 32 kB limit. For example, int16_t xdata[3] attribute ((section (".xbss, bss, xmemory,eds")));.
For the attributes and sections format, refer to the "MPLAB® XC16 User Guide", which could be found on the MPLAB XC Compilers webpage.