AnsweredAssumed Answered

Writing/Reading EEPROM on LPC11U6x

Question asked by Sam Bennett on Jun 28, 2018
Latest reply on Oct 6, 2018 by ATHMESH NANDAKUMAR

I'm using an LPC11U67 on a custom designed circuit board. I want to store the board serial number in the eeprom of the LPC. It seemed like this would be a simple task using the functions provided by LPC Open in eeprom.c/eeprom.h. I wrote the following functions to access the serial number. The problem is, every time I tried to read or write to eeprom I get a return code of 14 (#define IAP_ADDR_NOT_MAPPED         14 /*!< Address is not mapped in the memory map */). 

 

I tried changing the address to no avail. (On a side note, where is the eeprom located in memory, its not listed in the memory map in the datasheet.) I looked at the example code provided with LPC Open and I don't see any additional initialization steps that I'm not taking. I'm not quite sure what I'm missing. Is there another step I need to take before trying to invoke these commands? Is the address an absolute memory address?

 

#include "eeprom.h"

#define EEPROM_ADDRESS_ECHO_SN 64 //Top 64 bytes of eeprom are locked and cannot be written

uint8_t WriteSN(uint8_t SN){
return Chip_EEPROM_Write(EEPROM_ADDRESS_ECHO_SN, &SN, 1);
}

uint8_t ReadSN(void){
uint8_t SN = 255;
uint8_t retCode = 0;

retCode = Chip_EEPROM_Read(EEPROM_ADDRESS_ECHO_SN, &SN, 1);
log_msg("EEPROM Read Return Code: %u", retCode);

return SN;
}

 

Thanks,

Sam

Outcomes