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
  • Hi

    I think this is due to converting an nRF52840 project to run on an nRF52833 might cause problems as the two chips have different RAM and Flash sizes.

    By inserting just the main file from the long-range demo for nRF52840 into the already existing pca10100 ble_app_uart project you should be able to run it successfully. If you're still having trouble, I think you'll have to debug the project to find out what is going on.

    Best regards,

    Simon

Reply
  • Hi

    I think this is due to converting an nRF52840 project to run on an nRF52833 might cause problems as the two chips have different RAM and Flash sizes.

    By inserting just the main file from the long-range demo for nRF52840 into the already existing pca10100 ble_app_uart project you should be able to run it successfully. If you're still having trouble, I think you'll have to debug the project to find out what is going on.

    Best regards,

    Simon

Children
No Data
Related