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

GPIOTE interrupt not working with softdevice s130

I am using the template example for S130(works fine). I tried adding a simple Pin interrupt on the code but it didn't call the pin interrupt handler everytime I press the button. I believe I'm using some part of the peripherals that are restricted in S130. Below is my code, I put it before all the BLE initialization.


err_code = nrf_drv_gpiote_init();

APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);

in_config.pull = NRF_GPIO_PIN_PULLDOWN;

err_code = nrf_drv_gpiote_in_init(BUTTON_1, &in_config, in_pin_handler);

APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_event_enable(BUTTON_1, true);

Am I missing something? or Is this implementation not applicable with Softdevices. BTW the code for interrupt works if no support of BLE is added.

Parents
  • I noticed that with the new routine you are initialising your button with a Pull up configuration whereas in the previous routine it was pull down. Was it intentional? Have you tried using your first routine with a pull up configuration?

    I had a look at the design files for PCA10040 board (assuming you use them) and the buttons are connected to ground already. If you use them in Pull down mode, the state never toggles and so no interrupt is generated.

Reply
  • I noticed that with the new routine you are initialising your button with a Pull up configuration whereas in the previous routine it was pull down. Was it intentional? Have you tried using your first routine with a pull up configuration?

    I had a look at the design files for PCA10040 board (assuming you use them) and the buttons are connected to ground already. If you use them in Pull down mode, the state never toggles and so no interrupt is generated.

Children
Related