Hi,
I have a GPIO used as input or output.
When it's used as an input (99% of the time), I have an interruption on it (falling and rising edge).
When I use it as a output, I only do this:
/* Disable interruption */
GpioRemoveInterrupt(&uart_sync);
/* Set momentarily pin as output and set pin high */
GpioInit(&uart_sync, PIN_UART_SYNC, PIN_OUTPUT, PIN_PUSH_PULL, NRF_GPIO_PIN_PULLDOWN, 0);
GpioWrite(&uart_sync, 1);
nrf_delay_ms(2U);
GpioWrite(&uart_sync, 0);
nrf_delay_us(50);
GpioInit(&uart_sync, PIN_UART_SYNC, PIN_INPUT, PIN_PUSH_PULL, NRF_GPIO_PIN_NOPULL, 0);
/* Recreate interruption on pin */
GpioSetInterrupt(&uart_sync, IRQ_RISING_FALLING_EDGE, IRQ_HIGH_PRIORITY, sdcs_uart_wakeup);
This code is only call in one place, in the main function, not in an interruption.
"Sometimes" (that the pain point), the pin stay on high level. I don't know if the problem is only the pin state or the nRF itself is in a strange state (I use this pin to wakeup the nRF). I never see the problem on debug mode, only see on release.
I use a nRF52832 with SDK version 16.0.0.
I don't know if something can generate this kind of problem, or where to start to check