BLE slot allocation error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-31 11:05 PM
I read in this document about the concept of BLE slot allocation. I experimented with 5 STM32WB boards, one as master the four as slaves), and encountered an error I didn't understand.
The master issued `aci_gap_create_connection` to each of the four slaves with the following parameters:
- Common parameters:
- LE_Scan_Interval: 96 (which means 96 * 0.625 = 60 ms)
- LE_Scan_Window: 96 (same as above)
- Conn_Interval_Min: 48 (48 * 1.25 = 60 ms)
- Conn_Interval_Max: 48 (same as above)
- Conn_Latency: 0
- Slave1:
- Minimum_CE_Length: 0
- Maximum_CE_Length: 0
- Slave2:
- Minimum_CE_Length: 14 (14 * 0.625 = 8.75 ms)
- Maximum_CE_Length: 14
- Slave3:
- Minimum_CE_Length: 28 (28 * 0.625 = 17.5 ms)
- Maximum_CE_Length: 28
- Slave4:
- Minimum_CE_Length: 43 (43 * 0.625 = 26.875 ms)
- Maximum_CE_Length: 43
If I understand the document correctly, the first connection (to slave1) will make the anchor period 60 ms, and the subsequent connections won't change that as Conn_Interval_Min and Conn_Interval_Max are the same for all connections.
All four connections should fit in a single anchor period and the master connections with them for 0, 8.75, 17.5, 26.875 ms, respectively, every 60ms.
However, when the master tries to connection with slave4 (after successfully connecting with salve 1~3), it receives error code 0x86, which is BLE_STATUS_LENGTH_FAILED. I don't understand why the error occurs as the parameters seem to be legitimate. Please help!
Solved! Go to Solution.
- Labels:
-
STM32WB series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-02 8:37 AM
Hello,
According to the figure 27 of PM0271, the slot length correspond to the CE_Length_Max and there is a small guard interval of 1.5 ms between the different slot. In your case case, the anchor period is equal to 60 ms and :
- Slave 1 : CE_Length_Max = 0, so the master and slave perform only a single TX-RX exchange per connection event, so slot1_len = xx us, I don't know exactly the duration.
- Slave 2 : CE_Length_Max = 14 (14 * 0.625 = 8.75 ms), so slot2_len = 8.75 ms
- Slave 3 : CE_Length_Max = 28 (28 * 0.625 = 17.5 ms), so slot3_len = 17.5 ms
- Slave 4 : CE_Length_Max = 43 (43 * 0.625 = 26.875 ms), so slot4_len = 26.875 ms
So slot2_len + slot3_len + slot4_len + 3* guard interval = 59,625 ms which very close to the anchor period. Maybe you can try with CE_Length_Max = 10 for each slave.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-01 2:58 AM
Hello
I would recommend here to set CE Length to 0. The stack will be then able to adjust pending to number of slots.
Br
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-02 8:37 AM
Hello,
According to the figure 27 of PM0271, the slot length correspond to the CE_Length_Max and there is a small guard interval of 1.5 ms between the different slot. In your case case, the anchor period is equal to 60 ms and :
- Slave 1 : CE_Length_Max = 0, so the master and slave perform only a single TX-RX exchange per connection event, so slot1_len = xx us, I don't know exactly the duration.
- Slave 2 : CE_Length_Max = 14 (14 * 0.625 = 8.75 ms), so slot2_len = 8.75 ms
- Slave 3 : CE_Length_Max = 28 (28 * 0.625 = 17.5 ms), so slot3_len = 17.5 ms
- Slave 4 : CE_Length_Max = 43 (43 * 0.625 = 26.875 ms), so slot4_len = 26.875 ms
So slot2_len + slot3_len + slot4_len + 3* guard interval = 59,625 ms which very close to the anchor period. Maybe you can try with CE_Length_Max = 10 for each slave.
Best Regards
