We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi. I have a XC167CI-32 project with external flash - AM29F800BB. The programming algorithm is from the file m29f800a.c . I am using XARRAY to write and read to flash adresses.
#define ExtFLASH XARRAY (int, 0x400000)
example: ExtFLASH[0x5555L] = 0x00AA; //write to flash
iRetVal = ExtFLASH[0x0001L]; //read from flash
Everything is working ok if the offsetadress eg array index is smaller than FFFF. If it is 10000 adress 0x0000 will be written instead of 0x10000 and the write process will fail.
How can i solve this problem? I have tried a lot of things like using XVAR(int,offsetadress)=data but nothing except for XARRAY will work.
/Christian
Hi!. I don´t think it is a hardware problem. I haven´t looked at the compiler code yet becauce i think that XARRAY only have 16-bit index but i can be wrong. Thank for the tip.
What makes you think that the compiler supports more than 16-bit index? Many compilers are not just limited to 16-bit indices, but to only span 64kB.
Consider rewriting your code to not rely on "infinite" array sizes - or switch to a 32-bit processor.