I'm trying to read data from EEPROM. I use LPC11u68. When I read data from EEPROM, it shows "No source available for "0xfffffffe". Can any one help me? I don't understand what I've done wrong.
my code:
#define EEPROM_START_ADDRESS (0x00000040)
#define IAP_NUM_BYTES_TO_READ_WRITE 16
uint32_t buffer[IAP_NUM_BYTES_TO_READ_WRITE / sizeof(uint32_t)];
void readEEPROM(int addressEEPROM, uint32_t serial)
{
uint32_t command[5], result[4];
uint8_t *ptr = (uint8_t *) buffer;
uint32_t i;
/ * Data to be read from EEPROM */
command[0] = IAP_EEPROM_READ;
command[1] = addressEEPROM;
command[2] = (uint32_t) ptr;
command[3] = IAP_NUM_BYTES_TO_READ_WRITE;
command[4] = SystemCoreClock / 1000;
iap_entry(command, result);
for(i = 0 ; i < IAP_NUM_BYTES_TO_READ_WRITE ; i++)
{
testReceiverUID[serial][i] = *((uint8_t *)buffer + i);
}
}
while(1)
{
uint32_t i;
readEEPROM(EEPROM_START_ADDRESS + (10 * IAP_NUM_BYTES_TO_READ_WRITE), 10);
}
Please refer to : https://community.nxp.com/thread/436678
(You must disable interrupts ; And from my experience, available too for LPC17xx) ;
Hi Lee Chen
To provide the fastest possible support, I'd like to suggest you to refer to the periph_eeprom demo which illustrates using IAP command to read, write EEPROM operations in LPCOpen library.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------