I have nrf52840 DK board, running cutom image that implements BLE central, constantly scanning on coded (S8) phy. Trying to add NFC T2T tag, and it doesn't work. Disabling BLE - T2T tag works flawlessly. It looks like SoftDevice is intentionally doesn't allow to be pre-empted by any interrupts, including NFC
Hence the question - can these two (BLE Central and NFC tag) coexist ? Is there a recommended timing pattern to stop scanning to get NFC a chance to run ?
Example would be great.
PS I'm on NCS 2.1.2 but if there are newer versions that addresss this issue somehow I'll gladly upgrade to newer
AI provided satisfactory answer, but still publishing for posterity:
Can BLE Central and NFC Tag Coexist?
scan_window == scan_interval)—causes severe resource starvation.Recommended Timing and Duty Cycle Strategies
-
Reduce the Scan Duty Cycle: Do not continuously scan. Use a long scan interval with a shorter scan window to free up the radio and CPU for other activities [Concurrent SoftDevice and Bluetooth mesh activity; Bluetooth LE and Thread coexistence].
-
Note that the Coded PHY (S8) has significantly longer packet transmission/reception durations on-air, so large scan windows will keep the radio occupied longer.
-
As an example for general coexistence, parameters such as an interval of 100 ms with a window of 25 ms (25% duty cycle) or 60 ms interval with a 20 ms window are used to leave gaps for other protocols [Bluetooth LE and Thread coexistence].
-
-
Pause Scanning on NFC Field Detection: If you must use continuous or aggressive scanning, pause scanning when an NFC field is detected:
-
When the NFC T2T library senses an NFC carrier/field (or through the NFC sensing/callback events), call
bt_le_scan_stop(). -
Let the NFC read/exchange finish or wait for the field-lost event.
-
Call
bt_le_scan_start()to resume scanning.
-
-
Invert the Pattern (Scan Only After Touch): In applications such as touch-to-pair/commissioning, standard reference designs do not scan continuously; instead, the device waits for an NFC interaction first, parses the tag/payload, and only then starts the Bluetooth LE scanning/connection procedure [Bluetooth: Central NFC pairing].
Example: Adjusting Scan Parameters (Duty Cycling)
bt_le_scan_param with a reduced duty cycle instead of continuous scanning (BT_LE_SCAN_CODED_CONTINUOUS):