This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

It will post NRF_ERROR_RESOURCES if I send 20 bytes to pperpherial device per 30ms in BLE_GAP_PHY_1MBPS

These are Central device 52840 settings:

These are peripheral device 52810 settings:

I use official sdk16.0. Central Project is ble_app_multilink_central.Peripheral project is ble_app_blinky.Central device is 52840, peripheral device is 52810,

I change the ble service data len from 1bytes to 20 bytes.

I create a app-timer to send data to peripheral device if there is a link that has post BLE_LBS_C_EVT_DISCOVERY_COMPLETE. If 52840 send data per 30ms, 52840 will print NRF_ERROR_RESOURCES log as shown in the figure above. 

52840 send 20bytes to 52810 per 30ms, I don't think it exceeded the speed limit.

attempt:

1、52840 send data per 50ms, there is no exception.But its transmission speed doesn't near maximum;

Parents
  • Hi, 

    If you read the description of hvn_tx_queue_size you can find that it is: 


     Minimum guaranteed number of Handle Value Notifications that can be queued for transmission.

    It's not the actual queue size but the minimum guaranteed buffer you will have. It also does not directly decide the number of the packets/data you will send on each connection event. It's the NRF_SDH_BLE_GAP_EVENT_LENGTH , NRF_SDH_BLE_GATT_MAX_MTU_SIZE, and the connection interval that decide it. 

    A large queue size doesn't mean you will have a high throughput. See this case

    You can't get the number of buffer you have left, but if you queue and get NRF_ERROR_RESOURCES this meant the packet is not queued and you need to wait for a BLE_GATTS_EVT_HVN_TX_COMPLETE (for notification) or BLE_GATTS_EVT_HVC (for indication) to continue queueing. 

    It's important to have a higher throughput on BLE is to have large enough ATT_MTU, large enough NRF_SDH_BLE_GAP_DATA_LENGTH (4 byte longer that ATT_MTU), long enough EVENT LENGTH (that it cover the entire connection interval), and not too long connection interval (for example 30-50ms).

    Regards, 
    Amanda

  • Hi,

    I am sorry that some  errors  in my previous reply. Excuse me my English is not very good.

    According to your previous reply,and I found some information on the Internet.

    I see the NRF_BLE_GQ_ENABLED relevant information, data storaged in queue will use api named sd_ble_gattc_write() to send,so I try to use this api to send data, and  solve transporat speed slow problem preliminarily.

    Then the remainingproblem:

    Host Device Settings:

    MAX_CONNECTION_INTERVAL    150ms

    MIN_CONNECTION_INTERVAL      100ms

    NRF_SDH_BLE_GAP_DATA_LENGTH   60

    NRF_SDH_BLE_GAP_EVENT_LENGTH   140

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE   53

    NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 2048

    Peripheral  Device   Settings:

    NRF_SDH_BLE_GAP_DATA_LENGTH 60

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE 53

    NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408

    NRF_SDH_BLE_VS_UUID_COUNT 10

    NRF_SDH_BLE_GAP_EVENT_LENGTH 140

     

    1、I change my MTU size from 23 to 53,as shown in the figure.Then Host RTT_Viewer print this log.Are any of those Settings wrong?

    2、Host write one package to slave, why does host threw eight BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE events?I have set the  max_on_air_package_length param to 60.So I want to know the reason or to get a direction.

    Looking forward to your reply.

Reply
  • Hi,

    I am sorry that some  errors  in my previous reply. Excuse me my English is not very good.

    According to your previous reply,and I found some information on the Internet.

    I see the NRF_BLE_GQ_ENABLED relevant information, data storaged in queue will use api named sd_ble_gattc_write() to send,so I try to use this api to send data, and  solve transporat speed slow problem preliminarily.

    Then the remainingproblem:

    Host Device Settings:

    MAX_CONNECTION_INTERVAL    150ms

    MIN_CONNECTION_INTERVAL      100ms

    NRF_SDH_BLE_GAP_DATA_LENGTH   60

    NRF_SDH_BLE_GAP_EVENT_LENGTH   140

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE   53

    NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 2048

    Peripheral  Device   Settings:

    NRF_SDH_BLE_GAP_DATA_LENGTH 60

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE 53

    NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408

    NRF_SDH_BLE_VS_UUID_COUNT 10

    NRF_SDH_BLE_GAP_EVENT_LENGTH 140

     

    1、I change my MTU size from 23 to 53,as shown in the figure.Then Host RTT_Viewer print this log.Are any of those Settings wrong?

    2、Host write one package to slave, why does host threw eight BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE events?I have set the  max_on_air_package_length param to 60.So I want to know the reason or to get a direction.

    Looking forward to your reply.

Children
  • Hi, 

    qiao said:
    1、I change my MTU size from 23 to 53,as shown in the figure.Then Host RTT_Viewer print this log.Are any of those Settings wrong?

    If you would like to set MTU size 53, then the data length should be 54. 

    NRF_SDH_BLE_GAP_DATA_LENGTH   57

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE   53

    qiao said:
    2、Host write one package to slave, why does host threw eight BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE events?

    See this answer

    -Amanda

Related