We’re using a rak11720, we noticed some weird behaviour with P33. We’re using it as an output pin. After sleep the pin refuses to change state.
Upon further inspection we found this:
void uhal_gpio_suspend(void) {
for (int i = 0 ; i < M_MAX_GPIO_PIN ; i++)
{
if (i == 20 || i == 21
) {
continue;
}
if (i == WB_A0 || i == WB_A1)
{
// GPIO INPUT
uint32_t err_code = am_hal_gpio_pinconfig(i, GPIO_OPENDRAIN);
ERROR_CHECK(err_code);
// GPIO OPENDRAIN
// uint32_t err_code = am_hal_gpio_pinconfig(i, GPIO_OPENDRAIN);
// ERROR_CHECK(err_code);
}
if (gpio_status[i].wakeup_source == true)
{
uhal_gpio_wakeup_trigger_mode(i, uhal_gpio_wakeup_mode);
continue;
}
#if defined(SUPPORT_LORA) || defined(SUPPORT_LORA_P2P)
//if (i == RADIO_RESET)
//{
// am_hal_gpio_pinconfig(i, g_AM_HAL_GPIO_DISABLE);
// continue;
//}
if (i == RADIO_ANT_SW)
{
am_hal_gpio_pinconfig(i, g_AM_HAL_GPIO_DISABLE);
continue;
}
//if (i == RADIO_NSS)
//{
// am_hal_gpio_pinconfig(i, g_AM_HAL_GPIO_DISABLE);
// continue;
//}
//if (i == RADIO_BUSY)
//{
// am_hal_gpio_pinconfig(i, g_AM_HAL_GPIO_DISABLE);
// continue;
//}
#endif
if (sg_gpio_isr[i] != NULL)
{
continue;
}
//am_hal_gpio_pinconfig(i, g_AM_HAL_GPIO_DISABLE); // (Why are we disabling all pin???)
}
return;
}
Pins P13 and P33 are set to High Impedance mode, this changes the existing state of the pin (it needs to remain HIGH in our application). Is there a reason why these pins are configured this way? It’s rather odd.