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

Stuck in GPIO interrupt during init

While attempting to run the following code from a MESH example in IAR, the program gets stuck.  It only seems to be calling button_event_handler continuously, as if the interrupt is never clearing.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
static void initialize(void)
{
__LOG_INIT(LOG_SRC_APP | LOG_SRC_ACCESS, LOG_LEVEL_INFO, LOG_CALLBACK_DEFAULT);
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BLE Mesh Light Switch Provisioner Demo -----\n");
hal_leds_init();
#if BUTTON_BOARD
ERROR_CHECK(hal_buttons_init(button_event_handler));
#endif
/* Mesh Init */
nrf_clock_lf_cfg_t lfc_cfg = DEV_BOARD_LF_CLK_CFG;
ERROR_CHECK(mesh_softdevice_init(lfc_cfg));
mesh_init();
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Pretty much everything is bone stock in this code base, and I have logging disabled.  Does anyone have any leads on what I can check to debug this?  I've tried checking the registers in the NVIC but everything looks okay.  It only finishes initialization when I push button 1 on the board.  This is my Main() where initialize() gets called from.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
int main(void)
{
initialize();
NRF_LOG_INFO("Initialization complete");
execution_start(start);
for (;;)
{
(void)sd_app_evt_wait();
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX