This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

why report error with BLE_ERROR_NO_TX_BUFFERS(0x3004)

Hi, My project need to transmit mass data(maybe over 64kB)to APP once.But the total transmiting time is better not over 30Min.i use your example nRF51_SDK_8.1.0_b6ed55f\examples\ble_peripheral\ble_app_uart.But i meet a problem that calling function ble_nus_string_send() with time interval 200ms, it will report error with BLE_ERROR_NO_TX_BUFFERS(0x3004) after runing dozens of times successfully. if modify time interval 300ms, it run ok all the time. why it report error with BLE_ERROR_NO_TX_BUFFERS(0x3004)? my code will check if return value is NRF_SUCCESS after calling ble_nus_string_send(). if it is NRF_SUCCESS, it will transmit next packet data. part code is as below: if(err_code ==NRF_SUCCESS) { err_code = ble_nus_string_send(&m_nus, data_array, 20);

       if (err_code != NRF_ERROR_INVALID_STATE)
	 {
		          APP_ERROR_CHECK(err_code);
        }

}. i can't search which give error value with BLE_ERROR_NO_TX_BUFFERS in code. is bottom code give it? Another, is select using ble_uart case to tranmist mass data ok because of its limited size 20Byte packet each time? if not, do you give your advice? something like DFU, it can tranmist mass image packet. Thank you.

  • i see the comment for function ble_nus_string_send(ble_nus_t * p_nus, uint8_t * p_string, uint16_t length) as @retval NRF_SUCCESS If the string was sent successfully. Otherwise, an error code is returned. returning NRF_SUCCESS mean that the string was sent successfully. it should was sent to the peer and free TX buffer. then the function call again should not result to error BLE_ERROR_NO_TX_BUFFERS . unless returning NRF_SUCCESS mean that quque TX buffer successfully and quque up transimiting data.

  • Hi Leif,

    Which phone did you use to test ? You should also need to check the connection interval of the connection. The smaller the interval the higher the bandwidth. The peripheral can request the central to change to lower connection interval using connection parameter request.

    It's the best to use a sniffer to check the actual connection interval.

    You receive BLE_ERROR_NO_TX_BUFFERS when you have queued a full buffer of application buffer for BLE. Usually 7 packets. Then you have to wait for the packet to be sent otherwise you will receive more BLE_ERROR_NO_TX_BUFFERS error return. You should wait for the BLE_EVT_TX_COMPLETE event that indicate there is packet(s) sent.

    Maximum number of packet per connection event is 6 (with S110) and minimum connection interval is 7.5ms. But not all the phone/tablet support this.

  • Thank your reply. according to your advice. i fixed the issue by modifying macro define as below: #define MIN_CONN_INTERVAL MSEC_TO_UNITS(8, UNIT_1_25_MS) //old value is 500 #define MAX_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) //old value is 1000. i wonder that it set the range of MIN_CONN_INTERVAL and MAX_CONN_INTERVAL and their relation. Thank you again.

  • Hi Leif, you can have a look at this tutorial here. We have some explanation on the parameters.

Related