This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error 3735928559 on Multiple Pin Change Interrupt enable

Hi,

   I have to control 16 pin output pins based on the 16 pin interrupt.

Is it possible to have 16 pins interrupt in nrf52840 . Pin change interrupt

when i config

void statuspinenable() {
  uint32_t err_code;
  nrf_drv_gpiote_init();
  nrf_drv_gpiote_in_config_t config =
      {
          .sense = NRF_GPIOTE_POLARITY_TOGGLE,
          .pull = NRF_GPIO_PIN_PULLUP,
          .is_watcher = false,
          .hi_accuracy = true,
          .skip_gpio_setup = false};
  nrf_drv_gpiote_in_init(sbut1, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(sbut2, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(sbut3, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status1, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status2, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status3, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status4, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status5, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status6, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status7, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status8, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status9, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status10, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status11, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status12, &config, int_evt_handler);
  nrf_drv_gpiote_in_init(Status13, &config, int_evt_handler);
  nrf_drv_gpiote_in_event_enable(sbut1, true);
  nrf_drv_gpiote_in_event_enable(sbut2, true);
  nrf_drv_gpiote_in_event_enable(sbut3, true);
  nrf_drv_gpiote_in_event_enable(Status1, true);
  nrf_drv_gpiote_in_event_enable(Status2, true);
  nrf_drv_gpiote_in_event_enable(Status3, true);
  nrf_drv_gpiote_in_event_enable(Status4, true);
  nrf_drv_gpiote_in_event_enable(Status5, true);
  nrf_drv_gpiote_in_event_enable(Status6, true);
  nrf_drv_gpiote_in_event_enable(Status7, true);
  nrf_drv_gpiote_in_event_enable(Status8, true);
  nrf_drv_gpiote_in_event_enable(Status9, true);
  nrf_drv_gpiote_in_event_enable(Status10, true);
  nrf_drv_gpiote_in_event_enable(Status11, true);
  nrf_drv_gpiote_in_event_enable(Status12, true);
  nrf_drv_gpiote_in_event_enable(Status13, true);
}

it return me the error as

<info> app_timer: RTC: initialized.
<error> app: ERROR 3735928559 [Unknown error code] at D:\nRF5xx\1.SDK_17.0.2\modules\nrfx\drivers\src\nrfx_gpiote.c:609
PC at: 0x00032007
<error> app: End of error report

and i check the 609 line in the nrfx_gpiote.c

marking the line : NRFX_ASSERT(pin_in_use_by_gpiote(pin));

under the function

void nrfx_gpiote_in_event_enable(nrfx_gpiote_pin_t pin, bool int_enable)
{
    NRFX_ASSERT(nrf_gpio_pin_present_check(pin));
    NRFX_ASSERT(pin_in_use_by_gpiote(pin));
    if (pin_in_use_by_port(pin))
    {
        nrf_gpiote_polarity_t polarity =
            port_handler_polarity_get(channel_port_get(pin) - GPIOTE_CH_NUM);
        nrf_gpio_pin_sense_t sense;
        if (polarity == NRF_GPIOTE_POLARITY_TOGGLE)
        {
            /* read current pin state and set for next sense to oposit */
            sense = (nrf_gpio_pin_read(pin)) ?
                    NRF_GPIO_PIN_SENSE_LOW : NRF_GPIO_PIN_SENSE_HIGH;
        }
        else
        {
            sense = (polarity == NRF_GPIOTE_POLARITY_LOTOHI) ?
                    NRF_GPIO_PIN_SENSE_HIGH : NRF_GPIO_PIN_SENSE_LOW;
        }
        nrf_gpio_cfg_sense_set(pin, sense);
    }
    else if (pin_in_use_by_te(pin))
    {
        int32_t             channel = (int32_t)channel_port_get(pin);
        nrf_gpiote_events_t event   = TE_IDX_TO_EVENT_ADDR((uint32_t)channel);

        nrf_gpiote_event_enable((uint32_t)channel);

        nrf_gpiote_event_clear(event);
        if (int_enable)
        {
            nrfx_gpiote_evt_handler_t handler = channel_handler_get((uint32_t)channel_port_get(pin));
            // Enable the interrupt only if event handler was provided.
            if (handler)
            {
                nrf_gpiote_int_enable(1 << channel);
            }
        }
    }
}

When i use breakpoints and check.

after enabling 8 pins then the error is thrown

Related