BLE+Wifi coexistence

I am trying BLE+WiFi coexistence on NCS 2.8.0 with nRF7002DK and finding some issues.

First is that it's non-functional. Running the wifi/ble_coex example, there is no activity on the COEX_REQUEST and COEX_STATUS0 pins.

Tracked that down to the GPIOs not being assigned to cpunet, and the cause of that is MPSL_CX_ANY_SUPPORT not set.

That is auto-configured based on nrf_radio_coex node existing in the DTS, which was removed from nrf5340_cpuapp_common.dtsi (relative to NCS 2.6.1).

Copying the nrf_radio_coex section from cpunet to cpuapp DTS, I see the coex pins toggling as expected. The proper fix is probably different, to avoid duplication.

Second issue is that coex appears to be limiting BLE + 5GHz Wifi, which I wouldn't expect because there is no interference.

The wifi/ble_coex README provides some results for 2.4 and 5GHz Wifi, and the BLE throughput for 5GHz wifi is shown to be the same with and without coex enabled.

I am seeing a difference - BLE throughput without coex is ~1.2Mbps, with coex it's ~700kbps.

Tried setting CONFIG_NRF70_SR_COEX_RF_SWITCH=n, same reduced throughput.

Here's a logic analyzer capture of BLE + 5GHz wifi coexistence with CONFIG_NRF70_SR_COEX_RF_SWITCH=n. Note the long pulse on COEX_GRANT, which appears to preempt the COEX_REQUEST (its rising edge is before the falling edge of COEX_REQUEST), indicating that BLE is yielding to WiFi, which shouldn't be necessary because there's no dependency.

Can you try the 5GHz benchmarks again for this scenario to see if the results in the README are still valid? 

Finally, there appears to be some long periods where WiFi is scanning where it holds the COEX_GRANT signal high, preventing BLE from transmitting.

To reproduce that, hack the wifi/ble_coex example:

  • Enable the coex signals, fix from first issue above.
  • Set CONFIG_WIFI_CREDENTIALS_STATIC_SSID to an invalid SSID, so it will only scan but not connect.
  • In main.c, move the BLE setup "if (test_ble)" section (line 417-425) to before the "if (test_wlan)" section (before line 380), so BLE starts first.
  • Edit ble_throughput_test.c, and change line 600 from select_role(true) to "select_role(false); return 0;". That will change BLE to peripheral role.
  • Build with coexistence enabled.
  • Don't need another DK to connect to over BLE, just let the board advertise indefinitely.

Those changes will run the test with BLE advertising concurrent with WiFi scanning. The effects of coexistence can be seen by missing BLE advertisements (a throughput test with missing packet detection would be better, but this is simpler/quicker).

Here's a logic analyzer trace of that setup:

Note the ~1 second intervals where COEX_GRANT stays high. This is part of the WiFi scanning, and BLE transmissions are not allowed during those periods. Here's a screenshot from the nRF Connect app monitoring those advertisements:

 

It's easier to see live, because the graph connects between missing advertisements, but each of those scanning periods shows missing advertisements.

Our application connects to BLE continuously but to WiFi only when needed, so a 1 second outage will result in a glitch to BLE real-time activity (e.g. audio or HID).

Related