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

Multiple button interrupts: NRF_BREAKPOINT_COND

Hello

I am trying to read a multiplexed button matrix, using the BSP button interrupt example. I am doing this on a custom made PCB with an NRF52840 on-board. This is my code in the gpio_init() function:

 //configure inputs
    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
    in_config.pull = NRF_GPIO_PIN_NOPULL;

    err_code = nrf_drv_gpiote_in_init(BTNROW1_PIN, &in_config, BUTTON_PIN_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BTNROW2_PIN, &in_config, BUTTON_PIN_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BTNROW3_PIN, &in_config, BUTTON_PIN_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BTNROW4_PIN, &in_config, BUTTON_PIN_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BTNROW5_PIN, &in_config, BUTTON_PIN_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_gpiote_in_init(BTNROW6_PIN, &in_config, BUTTON_PIN_handler);
    APP_ERROR_CHECK(err_code);

    //enable interrupt on input level change
    nrf_drv_gpiote_in_event_enable(BTNROW1_PIN, true);
    nrf_drv_gpiote_in_event_enable(BTNROW2_PIN, true);
    nrf_drv_gpiote_in_event_enable(BTNROW3_PIN, true);
    nrf_drv_gpiote_in_event_enable(BTNROW4_PIN, true);
    nrf_drv_gpiote_in_event_enable(BTNROW5_PIN, true);
    nrf_drv_gpiote_in_event_enable(BTNROW6_PIN, true);

When using only one button in the code, it works perfectly. However, as soon as I use the code above and go into debug mode, I get stuck on NRF_BREAKPOINT_COND. I have seen this error popping up with UART, but it is not yet configured. What might be the cause of this?

Related