Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Increasing the data packet without DLE as my central device uses BLE v4.1

Before I explain my issue I wanted to be sure on my basics, so here is my understanding after doing the research in nordic devzone

I'm using nrf52832 with sdk15

1) BLE v4.1 doesn't support DLE

2) Maximum number of packets that can be sent is 6, even for BLE v4.2 and this is by default set to 6 packets by the softdevice S132 v6

3) To increase the packet size, I have to increase the ATT_MAX_MTU from 23 to 247 (in my case), enable gap event length extension, increase the gap event length extension.

Now coming to my issue, I have increased the MTU size from 23 to 247, enabled the gap event length extension and set it to 12 (1.25*12 = 15ms. Because my connection interval is 15ms) and increased the size of the softdevice tx buffer to 20 

ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 20;

My connection interval is set to 15ms. Now I'm trying to send 50 bytes of data every 15ms, but I get an NRF_ERROR_RESOURCE. I know that the error occurs because the softdevice buffer is full.

I'm counting the number of packets being sent from the nrf using "p_ble_evt->evt.gatts_evt.params.hvn_tx_complete.count;" in the BLE_GATTS_EVT_HVN_TX_COMPLETE event and it always shows as 1. So i'm assuming that my central device can handle only one packet per connection. My central device is HTC One m9 which has BLE v4.1. My doubt is, what is the packet size now ? the packet size in the gap layer is restricted to 27 bytes because I cant implement DLE so if im sending 50 bytes, then 50-27 = 23 bytes are always being queued in the tx buffer of the softdevice. Am I correct on this? Is this the reason why softdevice buffer gets full.

When I use a different central device Oppo mobile, this error seems to be resolved, but even the oppo mobile was receiving one packet.

The only difference is that HTC one m9 minimum connection interval is 11.25 ms and Oppo's is 7.5ms but this shouldn't matter as my connection interval is 15ms. I'm kind of lost right now so any kind of help would really help me understand nordic and ble better.

Parents
  • Hi,

    It seems impossible that long packets (DLE) would works as it is not supported by the central, so the only option would be to use multiple packets per connection event hoping that that is supported. From the nRF side this should be OK as long as you have increased the event length and TX buffer size. Can you record a sniffer trace so that we can see what is happening on air?

  • Htc one m9 (my central device) doesn't support more than one packet. Could also tell me if I'm correct about point 2) , which is "Maximum number of packets that can be sent is 6, even for BLE v4.2 and this is by default set to 6 packets by the softdevice S132 v6"

  • There is no definitive restriction of 6 packets per connection in the BLE spec nor in the SoftDevice. It depends on the length of the connection event and that the SoftDevice has data to send. Generally, you will get the maximum amount of packets if you have enough memory (TX buffer), so that there is data ready to send. (Even with the older SoftDevice where you could set 1, 3 or 6 as buffer length, you could sometimes get 7 packets per connection if the application was able to write a new packet to the SoftDevice in time.)

  • So you mean to say that number of packets depends on the number I define in this variable :

    ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 10;

    Here I should be able to send 10 packets right ? 

    Also what will be the size of this packet? Will it be equal to the size set in the DLE packet size?

    P.S I only have one development board with me so I cant really use nrf sniffer. I already ordered one more board, I will send you the screenshots ASAP when i get another nrf board.

Reply
  • So you mean to say that number of packets depends on the number I define in this variable :

    ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 10;

    Here I should be able to send 10 packets right ? 

    Also what will be the size of this packet? Will it be equal to the size set in the DLE packet size?

    P.S I only have one development board with me so I cant really use nrf sniffer. I already ordered one more board, I will send you the screenshots ASAP when i get another nrf board.

Children
Related