Peripheral Initialization Issue After Wake-Up from Deep Sleep (nRF5340)

Hi i am facing the issue with initializing the peripherals when the device is wake up from the deep sleep 

this are the logs i am getting after wake up this taking to log to initialize and readding is getting error

Wake-up from System OFF mode
[00:00:00.467,864] <inf> data_processing: P0 Latch Register: 0x00200000
[00:00:00.467,895] <inf> data_processing: P1 Latch Register: 0x00000000
[00:00:00.467,895] <inf> data_processing: Wake-up source: Port 0, Pin 21
[00:00:00.467,895] <inf> data_processing: P0 Latch Register after clearing: 0x00200000
[00:00:00.467,895] <inf> data_processing: P1 Latch Register after clearing: 0x00000000
[00:00:00.467,926] <wrn> data_processing: P0 latch bits not fully cleared: 0x00200000
Setting UART[00:00:00.568,084] <inf> main: EEPROM TEST STARTED




[00:00:00.568,084] <inf> main: EEPROM Init successful
[00:00:11.108,367] <inf> main: XXXX: 120
[00:00:11.608,642] <inf> main: XXXXX: 60
[00:00:12.111,267] <inf> main: XXXXX: 20
[00:00:14.117,095] <inf> main: XXXXX: 0 | XXXXXX: 0 | XXXXX: 0 | XXXXX: 0
[00:00:24.145,904] <err> main: Failed to read XXXXXXXX from EEPROM
--- 11 messages dropped ---
[00:00:25.149,047] <inf> main: xxxxx: 10


with out providing any delay it taking approx 10 sec time to wake up . 


this is the code is used to put the device into the sleep.

Sleep_Didabling_pins();
                                                // Clear latch before sleeping
                                                NRF_GPIOTE->EVENTS_PORT = 0; // Clear GPIOTE events
                                                NRF_P0->LATCH = NRF_P0->LATCH;
                                                NRF_P1->LATCH = NRF_P1->LATCH;
                        
                                                LOG_INF("P0 Latch Register after clearing: 0x%08X", NRF_P0->LATCH);
                                                LOG_INF("P1 Latch Register after clearing: 0x%08X", NRF_P1->LATCH);
                        
                                                k_msleep(10); // Small delay
                        
                        
                                                LOG_INF("Entering sleep mode...");
                        

                                                sys_poweroff(); // Put device to sleep







Parents
  • Hello Pavan,

    From the log you attached it seems there's a 10 second delay in the EEPROM related functionality after coming out of deep sleep.

    [00:00:00.568,084] <inf> main: EEPROM Init successful
    [00:00:11.108,367] <inf> main: XXXX: 120
    [00:00:11.608,642] <inf> main: XXXXX: 60
    [00:00:12.111,267] <inf> main: XXXXX: 20
    [00:00:14.117,095] <inf> main: XXXXX: 0 | XXXXXX: 0 | XXXXX: 0 | XXXXX: 0
    [00:00:24.145,904] <err> main: Failed to read XXXXXXXX from EEPROM
    --- 11 messages dropped ---
    [00:00:25.149,047] <inf> main: xxxxx: 10

    What is running from EEPROM and what happen if you for the test skip using the EEPROM functionality, does the nRF5340 still take 10 seconds to wake up?

    Best regards

    Asbjørn

  • Now it's not taking 10 seconds after wake-up from the System OFF mode, but there's an issue with I2C.

    1) I'm not getting any I2C initialization error, but the I2C-connected peripheral is not functioning properly after wake-up.

    First, I'm letting some peripherals initialize, and after that, I'm trying to read the EEPROM. This is the error I'm getting:

    [00:00:01.050,964] <err> Eeprom: EEPROM Read Error at address_fp_one: -4

    Also, some I2C peripherals are not working properly.

  • REDHAT said:
    [00:00:01.050,964] <err> Eeprom: EEPROM Read Error at address_fp_one: -4

    I don't see any references to this driver in the SDK. Is this your own implementation, or is the source code available somewhere?

    REDHAT said:
    I'm not getting any I2C initialization error, but the I2C-connected peripheral is not functioning properly after wake-up.

    Do the sensors remain powered on in System OFF?

  • Hi Vidar Berg
    Good day!

    I don't see any references to this driver in the SDK. Is this your own implementation, or is the source code available somewhere?

    #define AT24CM02_ERR_WRITE -3
    #define AT24CM02_ERR_READ  -4

    This are those error that i am getting

    Do the sensors remain powered on in System OFF?

    yes







  • What does "EEPROM Init successful" indicate? Were there any successful I2C transactions with the EEPROM prior to the write and read failure?

    Do the sensors remain powered on in System OFF?

    yes

    How are sensors powered? Are they connected directly to VDD?

    This are those error that i am getting

    Have you tried to probe the bus lines with a logic analyzer or scope?

  • What does "EEPROM Init successful" indicate? Were there any successful I2C transactions with the EEPROM prior to the write and read failure?
    i am checking i2C is ready or not

    How are sensors powered? Are they connected directly to VDD?
    yes 

    Have you tried to probe the bus lines with a logic analyzer or scope?
    no 

  • Sorry, but you're only partially answering my questions and not providing enough information for me to work with.

Reply Children
  • Hi Vidar Berg,

    Sorry, while programming the device is working fine when the device is wake up from the System off mode, i am getting issue with writing and reading to the EEPROM and some I2C connected peripherals. 

    i want to know like do i need to take care of them before putting to the sleep or need to do some thing when the device is wake up from the system off mode. 

Related