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

nrf51822 gpiote could not enter interrupt routine

Hello I am using SDK12.3 without softdevice on a custom board (with nrf51822 256k flash, 16kram without 32768 crystal).

I have written some code using GPIOTE to detect two buttons (with app_button library) when pressed and it worked no problem on nrf5 dev board.

However when i ported the code to the custom board i found that button press could only wake up the MCU but it won't enter the interrupt routine (button handler function).

Any idea could lead to this problem??

Thanks. MM

Parents
  • Thanks Amigo, tried to add this but it makes no difference (also the original code works in NFF51 DK board do not need it)

    Below are the code i initialize the buttons...

    static void buttons_leds_init(bool * p_erase_bonds)
    {    
    	uint32_t err_code;
    	static app_button_cfg_t p_button[] = {{BUTTON_1, APP_BUTTON_ACTIVE_HIGH, NRF_GPIO_PIN_NOPULL, button_handler},		
    											  {BUTTON_2, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_handler}};	
    				
    	APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);																					
    	// Initializing the buttons.
    	err_code = app_button_init(p_button, sizeof(p_button) / sizeof(p_button[0]), BUTTON_DEBOUNCE_DELAY);
    	
    	APP_ERROR_CHECK(err_code);																					
    	err_code = app_button_enable();	
    	APP_ERROR_CHECK(err_code); 
    }
    
Reply
  • Thanks Amigo, tried to add this but it makes no difference (also the original code works in NFF51 DK board do not need it)

    Below are the code i initialize the buttons...

    static void buttons_leds_init(bool * p_erase_bonds)
    {    
    	uint32_t err_code;
    	static app_button_cfg_t p_button[] = {{BUTTON_1, APP_BUTTON_ACTIVE_HIGH, NRF_GPIO_PIN_NOPULL, button_handler},		
    											  {BUTTON_2, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_handler}};	
    				
    	APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);																					
    	// Initializing the buttons.
    	err_code = app_button_init(p_button, sizeof(p_button) / sizeof(p_button[0]), BUTTON_DEBOUNCE_DELAY);
    	
    	APP_ERROR_CHECK(err_code);																					
    	err_code = app_button_enable();	
    	APP_ERROR_CHECK(err_code); 
    }
    
Children
No Data
Related