ble central example button not working with da14531evz module

Hi team,

My button pin function is not working when I press the button on the DA14531EVZ module.

static void configure_alert_button() {
    wkupct_register_callback(app_button_press_cb);

    arch_printf("configure_alert_button");

    wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_BUTTON_PORT, GPIO_BUTTON_PIN), // select pin (GPIO_BUTTON_PORT, GPIO_BUTTON_PIN)
                      WKUPCT_PIN_POLARITY(GPIO_BUTTON_PORT, GPIO_BUTTON_PIN, WKUPCT_PIN_POLARITY_LOW), // polarity low
                      1, // 1 event
                      0x3F); // debouncing time = 63
}

static void app_button_press_cb() {
    arch_printf("app_button_press_cb");
    configure_alert_button();
}

I am printing this: app_button_press_cb. This is not working and is not printing on UART. The pin status is also not being read in this function. Please give me a solution for this.





Parents Reply
  • Hi team

    I'm writing led value  by gett write function  in my button  callback  in my central firmware module to my peripheral module 

    In starting my communication is working as expected led glow on my peripheral module my button press in central  module with central example and next press on my central it goes off as expected  it works  

    for  40 to 50 sec after it stop working     and it stops print GETT WRITE after few second it print many times GETT WRITE not working my led is not responding on my peripheral side 

    Please give me solution 

Children

  • hii team thank you for your response

    my button function works will in in code central example of sdk 6


    static void app_button_press_cb()
    {
    uint8_t i;

    uint8_t led_val = (led_counter % 2 == 0) ? 0x01 : 0x00;

    arch_printf("***button***** \r\n");

    // Write to the Custom Characteristic 1 using the user_ble_gatt_write API
    user_ble_gatt_write(GATTC_WRITE,
    characteristic_1.con_id,
    characteristic_1.MyHandle,
    &led_val,
    sizeof(led_val));

    led_counter++;



    configure_alert_button();
    }


    void configure_alert_button()
    {
    wkupct_register_callback(app_button_press_cb);

    arch_printf("***configure_alert_button***** \r\n");

    wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_BUTTON_PORT, GPIO_BUTTON_PIN), // select pin (GPIO_BUTTON_PORT, GPIO_BUTTON_PIN)
    WKUPCT_PIN_POLARITY(GPIO_BUTTON_PORT, GPIO_BUTTON_PIN, WKUPCT_PIN_POLARITY_LOW), // polarity low
    1, // 1 event
    0x3F); // debouncing time = 63


    }

    im writing cmds in my central example code for led on my peripheral side

    but after writing few cmd on my peripheral side it stop working


    Serial port COM6 opened
    Device Local Name: Colorfit Pro 2
    RSSI: -79
    BD_ADDR:de:aa:87:33:a8:77
    ---------------END_ADV-----------
    Device Local Name: PRPH-OV
    RSSI: -31
    BD_ADDR:48:23:35:07:8d:d8
    ---------------END_ADV-----------
    Connecting to Device...
    user_on_connection
    handle_svc_ind: conn_idx=0000 start_h=0001 end_h=0005
    0x1800:
    0003 char 0x2a00 prop=02 (-R------)
    0005 char 0x2a01 prop=02 (-R------)
    handle_svc_ind: conn_idx=0000 start_h=0006 end_h=0009
    0x1801:
    0008 char 0x2a05 prop=22 (-R---I--)
    Completion Event: GATTC_WRITE
    handle_svc_ind: conn_idx=0000 start_h=000a end_h=0016
    0x180a:
    000c char 2x2a29 prop=02 (-R------)
    000e char 0x2a24 prop=02 (-R------)
    0010 char 0x2a26 prop=02 (-R------)
    0012 char 0x2a28 prop=02 (-R------)
    0014 char 0x2a23 prop=02 (-R------)
    0016 char 0x2a50 prop=02 (-R------)
    handle_svc_ind: conn_idx=0000 start_h=0017 end_h=0030
    18424398-7cbc-11e9-8f9e-2a86e4085a59:
    0019 char 2d86686a-53dc-25b3-0c4a-f0e10c8dee20 prop=08 (---W----)
    Found LED State Characteristic
    001c char 5a87b4ef-3bfa-76a8-e642-92933c31434f prop=08 (---W----)
    001c char 5a87b4ef-3bfa-76a8-e642-92933c31434f prop=08 (---W----)
    001f char 15005991-b131-3396-014c-664c9867b917 prop=12 (-R--N---)
    0023 char 6eb675ab-8bd1-1b9a-7444-621e52ec6823 prop=02 (-R------)
    0026 char 6c290d2e-1c03-aca1-ab48-a9b908bae79e prop=12 (-R--N---)
    002a char 9e1547ba-c365-57b5-2947-c5e1c1e1d528 prop=22 (-R---I--)
    002e char 772ae377-b3d2-4f8e-4042-5481d1e0098c prop=1a (-R-WN---)
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    handle_svc_ind: conn_idx=0000 start_h=0031 end_h=0037
    1842467c-7cbc-11e9-8f9e-2a86e4085a59:
    0033 char 2c86686a-53dc-25b3-0c4a-f0e10c8dee20 prop=08 (---W----)
    0036 char 5987b4ef-3bfa-76a8-e642-92933c31434f prop=04 (--X-----)
    handle_svc_ind: conn_idx=0000 start_h=0038 end_h=0046
    184247d0-7cbc-11e9-089e-2a86e4085a59:
    003a char 14005991-b131-3396-014c-664c9867b917 prop=12 (-R--N---)
    003e char 6db675ab-8bd1-1b9a-7444-621e52ec6823 prop=02 (-R------)
    0041 char 9d1547ba-c365-57b5-2947-c5e1c1e1d528 prop=22 (-R---I--)
    0045 char 6e6c31cc-3bd6-fe13-124d-9611451cd8f3 prop=02 (-R------)
    Completion Event: GATTC_DISC_ALL_SVC: status: 0000
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button**.**
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE
    ***button*****
    ***configure_alert_button*****
    Completion Event: GATTC_WRITE