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

Enable to create a wakeup button on central multilink example

I'm trying to implement a wake-up button on central multilink example. I.e, i need to implement the app_button in order to wake up from sd_evt_wat() function. The problem is when I add this characteristic on buttons_init,

uint32_t err_code;

// @note: Array must be static because a pointer to it will be saved in the Button handler
//        module.
static app_button_cfg_t buttons[] =
{
    {SEND_NOTIFICATION_BUTTON_PIN, false, NRF_GPIO_PIN_PULLUP, button_event_handler},
    {BOND_DELETE_ALL_BUTTON_PIN  , false, NRF_GPIO_PIN_PULLUP, NULL},
};

APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY, false);

err_code = app_button_enable();
APP_ERROR_CHECK(err_code);

the project simple crash until reach the main function. Can anyone hellp me? I'm using S120 1.0.1 and SDK_v6.1.0_b2ece6.

Thansk in advance and i'm sorry about my english.

Parents Reply
  • I think it is a hardfault because in debug mode, i put a breakpoint on the first call on main, in this case on "ble_stack_init(), and never stop there. There is some way to see what error happen? i'm using keil v5 . If i comment APP_BUTTON_INIT the program works perfectly. If I uncomment, the program compiles without errors and when I run anything happen :/

    This is my simple main function:

    int main(void)
    {
    			ble_stack_init();
    			leds_init();
    			gpiote_init();
    			buttons_init();
    			client_handling_init();
    			device_manager_init();
    
    			// Star scanning
    			scan_start();
    				
    			for (;;)
    			{
    					power_manage();
    			}
    }
    
Children
No Data
Related