/* Reads a byte array from the on-chip EEPROM memory.  */
RAMFUNC err_t readEEPROM(uint8_t *eeAddress, uint8_t *buffAddress, uint32_t byteCount)
/* Reads a byte array from the on-chip EEPROM memory.  */
RAMFUNC err_t readEEPROM(uint8_t *eeAddress, uint8_t *buffAddress, uint32_t byteCount)
{
  unsigned int command[5], result[4];
  command[0] = 62;
  command[1] = (uint32_t) eeAddress;
  command[2] = (uint32_t) buffAddress;
  command[3] = byteCount;
  command[4] = (uint32_t) (SystemCoreClock/1000);
  __disable_irq();
  iap_entry(command, result);
  __enable_irq();
  if (0 != result[0])
  {
    return ERROR_ADDRESSOUTOFRANGE;
  }
  return ERROR_NONE;
}