Onboard LED blinks and nrf52840 does not advertise

Hello,

I'm trying to open an L2CAP connection and send some test data to the nrf52840 dev board from my computer. But my connections were timing out with 'Page Timeout' (0x04). From this thread, I realized I need to configure the l2cap configuration to accept l2cap connections. However, once I added that code, the device fails to advertise & the onboard LED blinks (even though there is no code to make it blink that I have explicitly invoked).

#define APP_BLE_CONN_CFG_TAG 1
#define APP_BLE_OBSERVER_PRIO 3
#define L2CAP_TX_MPS 30
#define L2CAP_RX_MPS 30

static void ble_stack_init(void)
{
    ret_code_t err_code;
    ble_cfg_t ble_cfg;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
    APP_ERROR_CHECK(err_code);

    memset(&ble_cfg, 0x00, sizeof(ble_cfg));
    // Set l2cap channel configuration
    ble_cfg.conn_cfg.conn_cfg_tag                        = APP_BLE_CONN_CFG_TAG;
    ble_cfg.conn_cfg.params.l2cap_conn_cfg.rx_mps        = L2CAP_RX_MPS;
    ble_cfg.conn_cfg.params.l2cap_conn_cfg.rx_queue_size = 1;
    ble_cfg.conn_cfg.params.l2cap_conn_cfg.tx_mps        = L2CAP_TX_MPS;
    ble_cfg.conn_cfg.params.l2cap_conn_cfg.tx_queue_size = 1;
    ble_cfg.conn_cfg.params.l2cap_conn_cfg.ch_count      = 1;

    err_code = sd_ble_cfg_set(BLE_CONN_CFG_L2CAP, &ble_cfg, ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&ram_start);
    APP_ERROR_CHECK(err_code);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}

I'm checking to see if the LED blinking is a functionality provided by the app_error code.

Would be amazing if someone could point me in the right direction.

Thanks

Parents Reply Children
No Data
Related