Zephyr Save GPIO output status after reset

Hi All,

I am using a nrf52840 chip with Zephyr OS. I wanted to know if there is a way to save the status of a GPIO output pin after a reset (caused by the Watchdog timer).

I found the initialization GPIO API:

int gpio_pin_configure_dt(const struct gpio_dt_spec *spec, gpio_flags_t extra_flags)

And passing as flag:  “GPIO_OUTPUT" in the documentation it is written "/** Enables pin as output, no change to the output state. */", so I thought that maybe it could save the GPIO output status. 

As soon as the device resets I am experiencing the GPIO pin changing it's status, I thought that maybe the WDT resets the entire SOC (GPIO peripheral included).

Am I doing something wrong? Is there a better way to do it?

Thanks.

Parents Reply Children
No Data
Related