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

Button functionality does not work when initialized using bsp_init.

I have added button in my project and used bsp_init() to initialize it. All functions in bsp_init() returns NRF_SUCCESS but if I push my button even gpiote_event_handler() is not called by program. I have used gdb to read CONFIG[0] register and eveyrthing looks fine, INTEN register indicates that interrupts are enabled. I have also checked if there really is a voltage transition on physical pin. There is no response from the button neither with low accuracy nor high accuracy. This is how my application init looks like:

SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION,true);
APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_MAX_TIMERS,APP_OP_QUEUES_SIZE, false);
APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);
APP_BSP_INIT(APP_BSP_TYPE, APP_BSP_TICKS_PER_100MS, APP_BSP_CALLBACK);
APP_SCHED_INIT(APP_SCHED_EVENT_SIZE, APP_SCHED_QUEUE_SIZE);

EDIT:

I have realized that initializing buttons using bsp_init() works only on nrf_drv_gpiote.h and does not use app_gpiote.h so m_user_count remains 0. GPIOTE_IRQHandler() return without calling gpiote_event_handler().

Now I am not sure how I should initialize buttons in applications with softdevice?

Parents Reply Children
No Data
Related