I'm currently working on a nrf52832 board and i got an issue on Gpio config after a reset.
I configure a gpio with a register value of 4, low level, output pin and clear it before calling sd_power_system_off();
I wake up with a GPIO pin, the reset value is 0x00010000 (read from RESETREAS) and according to the documentation such a reset shoud maintain register value and Gpio configuration.
But after the reset all my gpio are clear and their register value is 3 after a burst peak. In my case that causes a wakeup on my gps ...
Has anyone a clue about this issue ?
The NRF_GPIO peripheral should maintain configuration, however if you have peripheral (e.g. TWI, UART etc) controlling the pins, then during wakeup from system off it will fall back to the actual NRF_GPIO configuration. So make sure that before you go to sleep (system OFF) that you set NRF_GPIO pins to the state you want them to have when wakeup.
Also make sure you are not in debug mode during sleep, because of this errata:http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev1.errata/anomaly_832_81.html#anomaly_832_81
Didn't knew about this, i tried and it works indeed but only if my Gpio is not initialized.For example :nrf_gpio_pin_clear(EXTINT_GPS_PIN);
// System is now OFF
During my start-up phase i got init_gpio() called with in :
If i comment the last line, my gpio got the right state (value = 0) but if i initialize it I got value = 1.
It's a known issue ?
However thanks i didin't know for the gpio debug issue.
Not sure if I understand the problem, but there is no need to re-init the GPIO after a system OFF, so you may just have a check RESETREAS register if reset reason is from system OFF then skip init of GPIOs?
Yes my main problem was the debug mode issue, it's solved now.
But a gpio init with NRF_GPIO_PIN_NOPULL should keep the same state at start and instead it changed it.
Anyway thanks for your help Kenneth !