Enable receiving of CTE... failed (err -134) in BLE Direction Finding Connectionless RX Sample with nRF52833 CONFIG_BT_DF_CONNECTIONLESS_CTE_RX was assigned the value y, but got the value n

I use the ncs v2.5.1 and VSCode to build the Direction Finding Connectionless TX/RX sample and flash them to my nRF52833DKs.

I just built it for AoA, so when I build the TX sample I have added the overlay-aod.conf and it worked very well. The output is exactly the same as the output at the end of the document below.

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/direction_finding_connectionless_tx/README.html

But at the terminal of the RX, I got this:

[DEVICE]: 2E:A1:15:C5:BB:B7 (random), AD evt type 3, Tx Pwr: 127, RSSI -89  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: DA:C7:3B:78:43:5D (random), AD evt type 0, Tx Pwr: 127, RSSI -90  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 07:55:BF:A2:37:85 (random), AD evt type 5, Tx Pwr: 127, RSSI -63 DF Connectionless Beacon App C:0 S:0 D:0 SR:0 E:1 Prim: LE 1M, Secn: LE 2M, Interval: 0x0780 (2400 ms), SID: 0
[DEVICE]: DA:C7:3B:78:43:5D (random), AD evt type 0, Tx Pwr: 127, RSSI -89  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 3C:9C:C4:75:5A:B1 (random), AD evt type 3, Tx Pwr: 127, RSSI -84  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 74:F6:1C:38:E3:8A (public), AD evt type 0, Tx Pwr: 127, RSSI -72 HTC BS 8ACFCA C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 3E:82:6A:61:E6:42 (random), AD evt type 3, Tx Pwr: 127, RSSI -73  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 1B:91:8C:BC:8A:98 (random), AD evt type 3, Tx Pwr: 127, RSSI -81  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 0B:27:53:E0:46:0A (random), AD evt type 3, Tx Pwr: 127, RSSI -62  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 3C:9C:C4:75:5A:B1 (random), AD evt type 3, Tx Pwr: 127, RSSI -80  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 74:F6:1C:38:E3:8A (public), AD evt type 0, Tx Pwr: 127, RSSI -66 HTC BS 8ACFCA C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 0A:7B:F7:6C:20:AF (random), AD evt type 3, Tx Pwr: 127, RSSI -81  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 3E:82:6A:61:E6:42 (random), AD evt type 3, Tx Pwr: 127, RSSI -69  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 7C:27:BC:D1:9D:2E (public), AD evt type 3, Tx Pwr: 127, RSSI -77  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 29:13:AC:D3:F4:DD (random), AD evt type 3, Tx Pwr: 127, RSSI -53  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 2E:A1:15:C5:BB:B7 (random), AD evt type 3, Tx Pwr: 127, RSSI -91  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
PER_ADV_SYNC[0]: [DEVICE]: 07:55:BF:A2:37:85 (random) synced, Interval 0x0780 (2400 ms), PHY LE 2M
PER_ADV_SYNC[0]: [DEVICE]: 07:55:BF:A2:37:85 (random) sync terminated
success. Periodic sync established.
Enable receiving of CTE...
failed (err -134)
Scan disable...Success.
Waiting for periodic sync lost...
Periodic sync lost.
Start scanning...success
Waiting for periodic advertising...
[DEVICE]: 7E:DD:2C:61:3A:00 (random), AD evt type 2, Tx Pwr: 127, RSSI -65  C:0 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 07:55:BF:A2:37:85 (random), AD evt type 5, Tx Pwr: 127, RSSI -69 DF Connectionless Beacon App C:0 S:0 D:0 SR:0 E:1 Prim: LE 1M, Secn: LE 2M, Interval: 0x0780 (2400 ms), SID: 0
success. Found periodic advertising.
Creating Periodic Advertising Sync...success.
Waiting for perio[DEVICE]: 49:D7:CC:A4:E2:8B (random), AD evt type 0, Tx Pwr: 127, RSSI -85  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 49:D7:CC:A4:E2:8B (random), AD evt type 4, Tx Pwr: 127, RSSI -85  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 03:BB:27:F5:78:2E (random), AD evt type 3, Tx Pwr: 127, RSSI -88  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 29:13:AC:D3:F4:DD (random), AD evt type 3, Tx Pwr: 127, RSSI -47  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
dic sync...
[DEVICE]: 5A:23:B0:B5:ED:98 (random), AD evt type 2, Tx Pwr: 127, RSSI -76  C:0 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 07:55:BF:A2:37:85 (random), AD evt type 5, Tx Pwr: 127, RSSI -69 DF Connectionless Beacon App C:0 S:0 D:0 SR:0 E:1 Prim: LE 1M, Secn: LE 2M, Interval: 0x0780 (2400 ms), SID: 0
[DEVICE]: 03:BB:27:F5:78:2E (random), AD evt type 3, Tx Pwr: 127, RSSI -91  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255

Then it just goes back to the top of the while loop and excutes the code again and again. Whenever err = bt_df_per_adv_sync_cte_rx_enable(sync, &cte_rx_params) in enable_cte_rx()  is called, the err -134 will be thrown.

I found a case, but it seems too old to address my current issues: RE: Update CTE params...failed (err -134) in 'direction_finding_connectionless_tx' 

The official TX sample without any modifications worked well.

However, I noticed an issue in my prj.conf when I build the official RX sample without any modifications:

# Enable Direction Finding Feature including AoA and AoD
CONFIG_BT_DF=y
CONFIG_BT_DF_CONNECTIONLESS_CTE_RX=y in build:n

CONFIG_BT_DF_CONNECTIONLESS_CTE_RX was assigned the value y, but got the value n.

The CONFIG_BT_DF_CONNECTIONLESS_CTE_RX is not defined, and I don't know why I can't set it to 'y' instead of 'n', which leads to the error that something in direction.c and hci_core.h can not be recognized when I build it. 

So I added the define in direction.c and hci_core.h:

//Ziao added when build connectionless rx
#define CONFIG_BT_DF_CONNECTIONLESS_CTE_RX

And I don't find the CONFIG_BT_DF_CTE_RX_AOA  in prj.conf. When I try to set CONFIG_BT_DF_CTE_RX_AOA to 'y' in prj.conf, I met the same problem: "in build n".

So, I added it in the main.c to enable the use of ant_patterns (which was grayed out in the official original code):

//Ziao added
#define CONFIG_BT_DF_CTE_RX_AOA

All I changed was adding these three lines of code in the RX sample, which allowed it to be built and flashed successfully, at least.

In TX, I have not changed anything. And I have added the overlay-aod.conf to the project.

 

Please help me. Thank you in advance.

Related