Hi Everyone, I'm using xhuge pointers to reprogram the code storage flash devices on my target hardware while it's in operation and have run across something I don't understand. I reviewed Keil appnote 138 and am able to copy the flash programming module (C module not ASM) into XRAM and run that code while erasing and reprogramming the flash. I'm using a xhuge pointer to read/write the flash devices as follows (simplified):
void Write(unsigned long lAdr, unsigned char cData) { volatile unsigned char xhuge *FlashPointer; FlashPointer = &FLASH_STARTB; //Base address FlashPointer += lAdr; //Add in write offset *FlashPointer = cData; //Write data return; }
#define FLASH_STARTB XVAR (unsigned char, 0x000000)
Thanks for the reminder Mike, I had forgotten about the internally mapped addresses down there (heat of the battle and all). ~Tim