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

Scanning and Advertising Parameter setting for coded in ¨ble_app_att_mtu_throughput¨

Hi

I am modifying the scanning and advertising paremeters for coded (125kbps).

I made the following changes in advertising

 .primary_phy   =BLE_GAP_PHY_CODED,  instead of    // BLE_GAP_PHY_1MBPS

 .type =   BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED,   instead of //BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED,

I made the following changes in scanning

 p_scan_ctx->scan_params.scan_phys     = BLE_GAP_PHY_CODED;    instead of // BLE_GAP_PHY_1MBPS;//

p_scan_ctx->scan_params.extended      = 0x01,

also made changes and checked for different values for  scan_interval, scan_window and scan_duration.

I am getting the error 

¨¨[00:00:21.095,642] <error> ble_scan: sd_ble_gap_scan_start returned 0x9
[00:00:21.118,713] <error> app: Fatal error
[00:00:21.123,535] <warning> app: System reset¨¨

I have read all the ticket in your portal related to this problem and made changes according to that but still i am not getting success.

have a nice day

regards,

Usman

Parents
  • Hi Usman

    Error 0x9 means that the function returns with invalid length. When using Coded_PHY you need to enable the extended bit as you have done. What you also need to do is to set NRF_BLE_SCAN_BUFFER to BLE_GAP_SCAN_BUFFER_EXTENDED_MIN which is 255. Please try that and see if you are able to get past this fatal error.

    You should also make sure that the init.advdata.flags is set to BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE as this is also necessary in order to use Coded_PHY.

    Best regards,

    Simon

Reply
  • Hi Usman

    Error 0x9 means that the function returns with invalid length. When using Coded_PHY you need to enable the extended bit as you have done. What you also need to do is to set NRF_BLE_SCAN_BUFFER to BLE_GAP_SCAN_BUFFER_EXTENDED_MIN which is 255. Please try that and see if you are able to get past this fatal error.

    You should also make sure that the init.advdata.flags is set to BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE as this is also necessary in order to use Coded_PHY.

    Best regards,

    Simon

Children
No Data
Related