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

GPIO configuration issues AFTER moving to NCS 1.6.1

The following code works perfectly fine every single time if i use NCS 1.5.1..we decided to move to 1.6.1 recently, and while we were able to get everything else working, GPIO interrupts and and IO for GPIOs that are NOT part of the device tree (but defined outside) don't seem to work.. As in same EXACT project with no changes but just using 1.6.1 SDK has different behavior. 

behavior of the following piece of code.. if someone can tell me what changed in 1.6.1 that is related to GPIO management, that will be greatly appreciated.. 

SDK 1.5.1: interrupts every time we touch the touch surface
SDK 1.6.1: no interrupts what so ever.. build has no warnings , the log has no errors/warning either

//Touch interrupt
#define NRF53440_GPIO_PIN_FOR_ZTW622_TOUCH_INTR (1) //P1.1 

volatile bool touch_ztw622_intr_happened = false;
void touch_ztw622_intr_process(const struct device *dev,
    struct gpio_callback *cb,
    uint32_t pins) {

  printk("\n touch intr happened");
  touch_ztw622_intr_happened = true;
#if KBPRO_ENABLE_TOUCH
  k_sem_give(kbpro_touch_get_sem_details());
#endif 
}

//works on 1.5.1 but not on 1.6.1
bool kbpro_nrf5340_gpio_interrupt_for_touch_ztw622_setup(void) {
  int ret;

  gpio_pin_configure(gpio_1_dev, NRF53440_GPIO_PIN_FOR_ZTW622_TOUCH_INTR, GPIO_INPUT);

  ret = gpio_pin_interrupt_configure(gpio_1_dev, NRF53440_GPIO_PIN_FOR_ZTW622_TOUCH_INTR, GPIO_INT_EDGE_FALLING); //GPIO_INT_LEVEL_LOW);
  if (ret != 0) {
    printk("Error %d: failed to configure Touch interrupt pin %d\n", ret, NRF53440_GPIO_PIN_FOR_ZTW622_TOUCH_INTR);
    return false;
  }

  gpio_init_callback(&touch_ztw622_cb,
      touch_ztw622_intr_process,
      BIT(NRF53440_GPIO_PIN_FOR_ZTW622_TOUCH_INTR));

  gpio_add_callback(gpio_1_dev, &touch_ztw622_cb);
  return true;
}

any feedback will be very helpful

Parents Reply Children
No Data
Related