I used segger embedded studio tool, is there list or manual of preprocessor definitions?

Hi there

I'm developing a board with a BLE

I am using nrf52840 sdk17

I used segger embedded studio tool 

I want to turn off PHY 2M.

(ble4.2)                                                                                                  (ble5.1)

The picture is BLE Sniffer data.

It was found that the results of Extended Reject Indication, LE Ping, and LE 2M PHY were changed.

I have a question

1.  Is there a list or manual of preprocessor definitions?

(example picture)

2. Is there a way to turn off PHY 2M?

3. Is there a way to change the list of FEATURE SET in LL_FEATURE_RSP to TURE OR FALSE?

Please answer this question.

Parents
  • Hi

    In the nRF5 SDK the PHY is set when you initialize the advertising and set parameters as well as within a connection when answering a PHY UPDATE request. To make sure you only use I.E. the 1MBPS PHY you can set both primary and secondary PHY in advertising_init() to BLE_GAP_PHY_1MBPS and make sure the BLE_GAP_EVT_PHY_UPDATE_REQUEST LSO only sets the PHY to 1MBPS. Please see the two snippets below for reference:

            case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
            {
                NRF_LOG_DEBUG("PHY update request.");
                ble_gap_phys_t const phys =
                {
                    .rx_phys = BLE_GAP_PHY_1MBPS,
                    .tx_phys = BLE_GAP_PHY_1MBPS,
                };
                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
                APP_ERROR_CHECK(err_code);
            } break;

    static void advertising_init(void)
    {
        ret_code_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      = true;
        init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        init.advdata.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_1MBPS;
        init.config.ble_adv_secondary_phy = BLE_GAP_PHY_1MBPS;
    
        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);
    }

    Best regards,

    Simon

Reply
  • Hi

    In the nRF5 SDK the PHY is set when you initialize the advertising and set parameters as well as within a connection when answering a PHY UPDATE request. To make sure you only use I.E. the 1MBPS PHY you can set both primary and secondary PHY in advertising_init() to BLE_GAP_PHY_1MBPS and make sure the BLE_GAP_EVT_PHY_UPDATE_REQUEST LSO only sets the PHY to 1MBPS. Please see the two snippets below for reference:

            case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
            {
                NRF_LOG_DEBUG("PHY update request.");
                ble_gap_phys_t const phys =
                {
                    .rx_phys = BLE_GAP_PHY_1MBPS,
                    .tx_phys = BLE_GAP_PHY_1MBPS,
                };
                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
                APP_ERROR_CHECK(err_code);
            } break;

    static void advertising_init(void)
    {
        ret_code_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      = true;
        init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        init.advdata.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_1MBPS;
        init.config.ble_adv_secondary_phy = BLE_GAP_PHY_1MBPS;
    
        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);
    }

    Best regards,

    Simon

Children
No Data
Related