This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GPIOTE toggling error

I am working with the nRF52 DK, using SDK v14.2.0 and SoftDevice S132.

After removing all BSP functions from the BLE UART example, I am setting up LED1 and LED2 of the nRF52 DK as followed

#define LED1_PIN_NUMBER 17
#define LED2_PIN_NUMBER 18

static void leds_init(void)
{
    uint32_t err_code;
    if(!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }

    nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_SIMPLE(NRF_GPIOTE_INITIAL_VALUE_LOW);
//    config.init_state = NRF_GPIOTE_INITIAL_VALUE_LOW;
//    config.task_pin = false;
    

    err_code = nrf_drv_gpiote_out_init(LED1_PIN_NUMBER, &config);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_gpiote_out_init(LED2_PIN_NUMBER, &config);
    APP_ERROR_CHECK(err_code);
}

Whenever I call nrf_drv_gpiote_out_toggle(LED1_PIN_NUMBER), the application crashes after outputting the following error log:

0> <error> app: ERROR 3735928559 [Unknown error code] at F:\nRF5_SDK_14.2.0\components\drivers_nrf\gpiote\nrf_drv_gpiote.c:386

Line 386 of nrf_drv_gpiote.c is ASSERT(!pin_in_use_by_te(pin));.

This is very strange to me because as far as I understand I am setting up the GPIO as a simple pin, not controlled by the TE features.

What is going on?

Related