Skip to content

Commit c48bb97

Browse files
committed
samples: Bluetooth: observer: Extended Scanning on BBC Micro Bit board
Add configuration overlay file to support observer sample with Extended Scanning on BBC Microbit board. Due to slow CPU, there will be assertions, and this commit (for now) validates build-only. And the sample may run for a duration until it asserts. Asserts: - ASSERTION FAIL [start_us == (aux_start_us + 1U)] @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw/ nordic/lll/lll_scan_aux.c:359 This will happen for small aux offset value, definitely for the 300 us because CPU uage latency to setup such auxiliary PDU reception on nRF51 is high due to slow CPU. - ASSERTION FAIL [0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw/ nordic/lll/lll_scan_aux.c:592 prepare_cb: Actual EVENT_OVERHEAD_START_US = 579 This will happen due to CPU usage latencies scheduling the radio events, due to slow CPU. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 908ad59 commit c48bb97

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* Keep default IRQ priority low for peripherals to reduce Radio ISR latency.
2+
* ARM Cortex-M4 lowest priority value of 5, i.e. considering Zephyr reserved 2
3+
* levels for Exceptions and ZLI (if enabled).
4+
* ARM Cortex-M0 lowest priority value of 3, i.e. we use it as Zephyr has no
5+
* support for ZLI on Cortex-M0.
6+
*/
7+
#define NRF_DEFAULT_IRQ_PRIORITY 3
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Adjust Stack Sizes for reduce RAM usage
2+
CONFIG_MAIN_STACK_SIZE=1024
3+
CONFIG_IDLE_STACK_SIZE=128
4+
CONFIG_ISR_STACK_SIZE=1024
5+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1024
6+
7+
# Enable Extended Scanning
8+
# CONFIG_BT_EXT_ADV=y
9+
10+
# Set maximum scan data length for Extended Scanning
11+
CONFIG_BT_EXT_SCAN_BUF_SIZE=192
12+
13+
# Zephyr Bluetooth LE Controller needs 16 event buffers to generate Extended
14+
# Advertising Report for receiving the complete 1650 bytes of data.
15+
# Use 4 to be able to receive a minimal extended advertising with chains.
16+
CONFIG_BT_BUF_EVT_RX_COUNT=4
17+
18+
# Use Zephyr Bluetooth Low Energy Controller implementation
19+
CONFIG_BT_LL_SW_SPLIT=y
20+
21+
# Set maximum scan data length for Extended Scanning in Bluetooth LE Controller.
22+
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=192
23+
24+
# Increase Zephyr Bluetooth LE Controller Rx buffer to receive complete chain
25+
# of PDUs. Need 9 for maximum of 1650 bytes, but we use 3 as minimum to receive
26+
# at least a primary PDU, an auxiliary PDU and a chain PDU.
27+
CONFIG_BT_CTLR_RX_BUFFERS=3
28+
29+
# Enable advanced features
30+
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
31+
32+
# Adjust execution context priorities to achieve lower Radio ISR latencies
33+
CONFIG_BT_CTLR_LLL_PRIO=0
34+
CONFIG_BT_CTLR_ULL_HIGH_PRIO=1
35+
CONFIG_BT_CTLR_ULL_LOW_PRIO=1
36+
37+
# Use just-in-time collision resolution in ticker and LLL pipeline
38+
CONFIG_BT_CTLR_LOW_LAT=n
39+
CONFIG_BT_CTLR_LOW_LAT_ULL_DONE=n
40+
CONFIG_BT_TICKER_LOW_LAT=n
41+
42+
# Increase the below to receive interleaved advertising chains
43+
CONFIG_BT_CTLR_SCAN_AUX_SET=3
44+
CONFIG_BT_CTLR_LOW_LAT_ULL=y
45+
# CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS=y
46+
# CONFIG_BT_CTLR_SCAN_AUX_CHAIN_COUNT=3
47+
48+
# Use unreserved timespace scanning
49+
CONFIG_BT_CTLR_SCAN_UNRESERVED=y
50+
51+
CONFIG_THREAD_ANALYZER=y
52+
CONFIG_THREAD_ANALYZER_AUTO=y
53+
CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
54+
CONFIG_THREAD_NAME=y

samples/bluetooth/observer/sample.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,30 @@ sample:
33
tests:
44
sample.bluetooth.observer:
55
harness: bluetooth
6+
tags: bluetooth
67
platform_allow:
78
- qemu_cortex_m3
89
- qemu_x86
910
- nrf52840dk/nrf52840
1011
integration_platforms:
1112
- qemu_cortex_m3
12-
tags: bluetooth
1313
sample.bluetooth.observer.extended:
1414
harness: bluetooth
15+
tags: bluetooth
1516
extra_args: CONF_FILE="prj_extended.conf"
1617
platform_allow:
1718
- qemu_cortex_m3
1819
- qemu_x86
1920
- nrf52840dk/nrf52840
20-
tags: bluetooth
2121
integration_platforms:
2222
- qemu_cortex_m3
23+
sample.bluetooth.observer.extended.bbc_microbit:
24+
harness: bluetooth
25+
tags: bluetooth
26+
extra_args:
27+
- CONF_FILE="prj_extended.conf"
28+
- EXTRA_CONF_FILE=overlay_bbc_microbit-bt_ll_sw_split.conf
29+
platform_allow:
30+
- bbc_microbit
31+
integration_platforms:
32+
- bbc_microbit

0 commit comments

Comments
 (0)