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

52833 LONG RANGE UART_APP_BLE Peripherals

I get long range demo code for 52840 on the web:

long_range_demo_15.2

and modify the code to test the 52833 long range feature;

52833 long range peripheral demo.zip

MAINLY code:

static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;

    memset(&init, 0, sizeof(init));

    init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = false;
+    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;//BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
+    init.config.ble_adv_primary_phy   = BLE_GAP_PHY_CODED;
+    init.config.ble_adv_secondary_phy = BLE_GAP_PHY_CODED;
+    init.config.ble_adv_extended_enabled  = true;
    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}

*******************
    // Copy advertising data.
    if (!p_advertising->initialized)
    {
        p_advertising->adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
    }
    p_advertising->adv_data.adv_data.p_data = p_advertising->enc_advdata[0];
    p_advertising->adv_data.adv_data.len = adv_set_data_size_max_get(p_advertising);

    ret = ble_advdata_encode(&p_init->advdata, p_advertising->enc_advdata[0], &p_advertising->adv_data.adv_data.len);
    VERIFY_SUCCESS(ret);

+    p_advertising->adv_data.scan_rsp_data.p_data = NULL;
+    p_advertising->adv_data.scan_rsp_data.len = 0;

-//    p_advertising->adv_data.scan_rsp_data.p_data = p_advertising->enc_scan_rsp_data[0];
-//    p_advertising->adv_data.scan_rsp_data.len = adv_set_data_size_max_get(p_advertising);

-//    ret = ble_advdata_encode(&p_init->srdata,
-//                              p_advertising->adv_data.scan_rsp_data.p_data,
-//                             &p_advertising->adv_data.scan_rsp_data.len);
-//    VERIFY_SUCCESS(ret);

***************

static void advertising_start(void)
{
    uint32_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
   //Optional: Change output power
+    err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, 8);
+    APP_ERROR_CHECK(err_code);
}
*************

My question is: WHY IT cannot be connected to the long-range-DK 52840? (THE led1 is always flicking!!)

WHAT IS THE PROBLEM FOR THE LONG RANGE TEST ON 52833 DK????

Parents Reply Children
  • As described in my question, after modified the ble_app_uart_pca10056 to run on the pca10100 DK, it doesn't work acturally. nRF52833 board cannot connect to the nRF52840,

    you have suggested me to debug the code. because I am new to this DK, I cannot find the problem why it cannot work.

    There may have some problems caused by the different RAM and FLASH size, which i cannot find out.

    If you could ,could you pls provide me a demo code of ble_app_uart_peripheral for PCA10100 board?

    There are very less demo code for the PCA10100 board, it makes some diffculties to develop project on this chip.

Related