GPIO state not retained after FOTA reboot on nRF54L15 (Zephyr SDK 3.0.2)

Hi,

I am using nRF54L15 with Zephyr RTOS in nRF Connect SDK v3.0.2.

After performing a FOTA update, the device reboots. I need to retain the state of a GPIO pin across this reboot.

The GPIO I am trying to retain is P1.06. I attempted to configure it with retention using the following code:

#define PIN_P1_06 38
#define P1_INDEX  6

void configure_retained_gpio(void) {
    // Configure the pin as output with retention enabled
    nrf_gpio_cfg_output(PIN_P1_06);
 
    NRF_P1->PIN_CNF[P1_INDEX] &= ~GPIO_PIN_CNF_CTRLSEL_Msk;
    NRF_P1->PIN_CNF[P1_INDEX] |= (GPIO_PIN_CNF_CTRLSEL_GPIO << GPIO_PIN_CNF_CTRLSEL_Pos);
}

However, after the OTA update and subsequent reboot, the GPIO state is cleared and does not retain the previous value.

My questions:

  1. Is there any additional configuration required in nRF54L15 to retain GPIO states across a reboot after FOTA?

  2. Is GPIO retention supported across MCU reset triggered by FOTA, or is it only supported for specific low-power modes?

Any guidance or recommended approach to preserve the GPIO state across OTA reboot would be greatly appreciated.

Thanks.

Parents
  • Hello,
    In that case, I believe there is no way to achieve this through software alone. You would probably need some hardware customization.

    One possible suggestion is to add a pull-up on Q1 by connecting R9 to VDD instead of GND, and use P1.06 in an open-drain configuration. The default behavior for GPIOs is high-impedance, so during reset, SYS_EN would also be pulled high.

    If possible, you could also redesign this part of the circuit so that it turns off on a high input instead of a low input.

    Kind Regards,

    Abhijith

  • Hello Abhijith,

    Thank you for the clarification and for your support. We will review the hardware changes you suggested.

    Best regards,
    Jishnu K J

Reply Children
No Data
Related