RWW EEPROM inaccessble in ATSAML21J18B

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi All,

I am working on an implantable medical device using ATSAML21J18B micro-controller. User can configure the micro-controller through wireless communication and all the setup data gets stored in the emulated RWW EEPROM. Everything was working fine initially but It so happened that the device was not charged for couple of days and the battery of the device got drained. Presently, upon charging it wirelessly, the device boots-up but the RWW EEPROM is inaccessible. I can still change the settings wirelessly but its not getting stored in the RWW EEPROM. Upon start-up, the micro-controller initializes the RWW EEPROM in the following manner.

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

void Configure_RWW_EEPROM(void)                        // Setup EEPROM emulator service
{
    enum status_code status;

    RWW_EEPROM_Erased = false;
        
    status = rww_eeprom_emulator_init();            // Initialize the EEPROM emulator
        
    if (status == STATUS_ERR_NO_MEMORY)                    // check_init_ok
    {
        while (true)
        {
            /* No EEPROM section has been set in the device's fuses */
        }
    }
    else if (status != STATUS_OK)                        
    {
        rww_eeprom_emulator_erase_memory();                                // Format memory
        RWW_EEPROM_Erased = true;
        status = rww_eeprom_emulator_init();                // Re-initialize the EEPROM emulator
    }
    else if (status == STATUS_OK)                        
    {
        Load_data_from_RWW_EEPROM();
    }
    
}// Configure_EEPROM

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Why has the RWW EEPROM become inaccessible?

Is it necessary to disable Global interrupt before read/write to RWW EEPROM?

 

Kindly help.

Thanks,

Last Edited: Tue. Jan 14, 2020 - 01:17 PM