nRF 7002 coexistence interface doesn't work

Hi,

I have designed a custom board, and I cannot get coexistence interface to work reliably. I don't get any errors, but I'm not able to connect to my board with BLE. WiFi also doesn't connect. I can share my parts of config files, device tree, and general block schematic. After flashing the code, swctrl0 output is low for ~1 second, and then goes high for a short time, and that continues indefinitely. While the output is high, I can see BLE advertisement data, but, when I try to connect to the board with nRF connect app, it gets disconnected when swctrl0 gets pulled low.

So, the general idea was to share the 2.4GHz antenna between BLE and WiFi. I connected the components like this. When SWCTRL0 is high - 2.4GHz BLE path is selected. Is that ok?

I followed the following resources while configuring this:

https://docs.nordicsemi.com/bundle/nan_044/page/APP/nan_044/coex_API.html

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/wifi_coex.html

NCS is 2.9.0. Tried upgrading it to 3.0.0, but there wasn't really much difference....


If you could tell me what I'm doing wrong, I would really appreciate it, thanks! 




This is in ipc_radio config file:

CONFIG_NRF_RPC=n
CONFIG_NRF_RPC_CBOR=n
CONFIG_MPSL=y
CONFIG_MPSL_CX=y
CONFIG_MPSL_CX_NRF700X=y

Prj.cfg only has this:

CONFIG_NRF70_SR_COEX=y
CONFIG_NRF70_SR_COEX_RF_SWITCH=n

_cpunet overlay has this defined:

    nrf_radio_coex: nrf7002-coex {
        status = "okay";
        compatible = "nordic,nrf7002-coex";
        req-gpios     = <&gpio0 7 GPIO_ACTIVE_HIGH>;
        status0-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
        grant-gpios   = <&gpio0 6 GPIO_ACTIVE_HIGH>;
  };
};

&radio {
	coex = <&nrf_radio_coex>;
};

and cpuapp overlay has this:

   nrf_radio_coex: nrf7002-coex {
        status = "okay";
        compatible = "nordic,nrf7002-coex";
        req-gpios     = <&gpio0 7 GPIO_ACTIVE_HIGH>;
        status0-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
        grant-gpios   = <&gpio0 6 GPIO_ACTIVE_HIGH>;
  };


	gpio_fwd: nrf-gpio-forwarder {
		compatible = "nordic,nrf-gpio-forwarder";
		status = "okay";
		uart {
			gpios = <&gpio0 7 0>, /* nrf7002-coex req-gpios     */
				    <&gpio1 3 0>, /* nrf7002-coex status0-gpios */
				    <&gpio0 6 0>; /* nrf7002-coex grant-gpios   */
		};
	};

under spi node: 
	nrf70: nrf7002@0 {
		status = "okay";
		compatible = "nordic,nrf7002-spi";
		reg = <0>;
		spi-max-frequency = <24000000>;
		/* Wi-Fi Pins used */
		iovdd-ctrl-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
		bucken-gpios = <&gpio1  6 GPIO_ACTIVE_HIGH>;
		host-irq-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
		wifi-max-tx-pwr-2g-dsss = < 0x15 >;
		wifi-max-tx-pwr-2g-mcs0 = < 0x10 >;
		wifi-max-tx-pwr-2g-mcs7 = < 0x10 >;
		wifi-max-tx-pwr-5g-low-mcs0 = < 0x9 >;
		wifi-max-tx-pwr-5g-low-mcs7 = < 0x9 >;
		wifi-max-tx-pwr-5g-mid-mcs0 = < 0xb >;
		wifi-max-tx-pwr-5g-mid-mcs7 = < 0xb >;
		wifi-max-tx-pwr-5g-high-mcs0 = < 0xd >;
		wifi-max-tx-pwr-5g-high-mcs7 = < 0xd >;
		wlan0: wlan {
			compatible = "nordic,wlan";
		};  
	};

My initialisation is just this:

    if(nrf_wifi_coex_hw_reset()){
        LOG_ERR("Error resetting coex hardware");
    }

    int ret = nrf_wifi_coex_config_non_pta(false, true);
    if (ret != 0) {
        LOG_ERR("Configuring non-PTA registers of CoexHardware FAIL\n");
    }

Parents
  • Hello Tomislav,
    Good to see you managed to get the BLE going. 
    Q1: Just as a curiosity, are you able to get the WiFi stable if you don't have any BLE traffic and switching? I mean, if the hotspot is far away and only WiFI, not BLE, is the WiFI connection stable then?
    Q2: Shared antenna config: "If shared antenna use case, set CONFIG_COEX_SEP_ANTENNAS=n in the prj.conf file" from the page you link to. You've only copied in two lines from you prj.conf, so I wanted to check if you have set this as well?
    Q3: Did you use the COEX example for nRF5340+nRF7002 as a starting point? https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/ble_coex/README.html
    Best regards
    Asbjørn
  • Hello Asbjorn,

    sorry for not answering sooner, but I wanted to double check some things...

    I believe that the coexistence actually works ok after inverting the switch, but, the output signal from nRF7002 chip, for the 2.4GHz is quite low. I can load the "radio_test" sample, alongside with my overlay for the custom board, and I can use it, but the signal levels are quite low.... This could be either the hardware design problem, or software configuration problem. I can connect to the network if I place my cellphone hotspot directly to the PCB board.

    If you would be so kind to tell me, am I testing this right, and, what could I double-check in my overlay file to ensure that the transmitted power is increased. If you think it's hardware, I'll have to check with my hardware design guys...

    So, I'm testing it like this:

    rtt:~$ wifi_radio_test init 1
    rtt:~$ wifi_radio_test tx_power 10
    rtt:~$ wifi_radio_test tx_tone 1
    

    Here's the image of the output:


    So, this is without coexistence, and right at the output of the TXRF0 pin, and connected with a cable to the analyzer. Does that look ok to you?

    I'm using "radio_test" example, and the only relevant thing in my dtsi file is this:

    &spi4{
    	status="okay";
    	compatible = "nordic,nrf-spim";
    	pinctrl-0 = <&7002_spi>;
    	pinctrl-1 = <&7002_spi_sleep>;
    	pinctrl-names = "default", "sleep";
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x0 >;
    
    	cs-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
    
    	nrf70: nrf7002@0 {
    		status = "okay";
    		compatible = "nordic,nrf7002-spi";
    		reg = <0>;
    		spi-max-frequency = <24000000>;
    		/* Wi-Fi Pins used */
    		iovdd-ctrl-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
    		bucken-gpios = <&gpio1  6 GPIO_ACTIVE_HIGH>;
    		host-irq-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
    		wifi-max-tx-pwr-2g-dsss = < 0x15 >;
    		wifi-max-tx-pwr-2g-mcs0 = < 0x10 >;
    		wifi-max-tx-pwr-2g-mcs7 = < 0x10 >;
    		wifi-max-tx-pwr-5g-low-mcs0 = < 0x9 >;
    		wifi-max-tx-pwr-5g-low-mcs7 = < 0x9 >;
    		wifi-max-tx-pwr-5g-mid-mcs0 = < 0xb >;
    		wifi-max-tx-pwr-5g-mid-mcs7 = < 0xb >;
    		wifi-max-tx-pwr-5g-high-mcs0 = < 0xd >;
    		wifi-max-tx-pwr-5g-high-mcs7 = < 0xd >;
    		wlan0: wlan {
    			compatible = "nordic,wlan";
    		};  
    	};
    };


    Here's my RTT log output after booting:

    [00:00:00.879,760] <dbg> clock_control: clkstarted_handle: lfclk: Clock started
    [00:00:00.881,378] <dbg> wifi_nrf_bus: rpu_gpio_config: GPIO configuration done...
    
    [00:00:00.883,544] <dbg> wifi_nrf_bus: rpu_pwron: Bucken = 0, IOVDD = 0
    [00:00:00.883,605] <inf> wifi_nrf_bus: SPIM spi@a000: freq = 24 MHz
    [00:00:00.883,605] <inf> wifi_nrf_bus: SPIM spi@a000: latency = 1
    [00:00:00.883,636] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000ef30 - rx_bufs 0 - 1
    [00:00:00.883,666] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000ef28 (1), current_rx 0 (0), tx buf/len 0x2000ef24/2, rx buf/len 0/0
    [00:00:00.883,697] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.883,697] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.883,728] <dbg> wifi_nrf_bus: rpu_wrsr2: Written 0x1 to WRSR2
    [00:00:00.883,728] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.883,758] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.883,819] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.883,819] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.883,819] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.883,850] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> fe 1 1 1 1 1
    [00:00:00.883,880] <dbg> wifi_nrf_bus: spim_wait_while_rpu_wake_write: RDSR2 = 0x1
    [00:00:00.883,880] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.883,911] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.883,941] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.883,941] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.883,972] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.884,002] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> 0 0 0 0 0 0
    [00:00:00.884,002] <dbg> wifi_nrf_bus: _spim_wait_while_rpu_awake: RDSR1 = 0x0
    [00:00:00.885,101] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.885,131] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.885,162] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.885,162] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.885,192] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.885,192] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> 0 0 0 0 0 0
    [00:00:00.885,223] <dbg> wifi_nrf_bus: _spim_wait_while_rpu_awake: RDSR1 = 0x0
    [00:00:00.886,291] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.886,322] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.886,352] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.886,352] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.886,383] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.886,383] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> 0 0 0 0 0 0
    [00:00:00.886,413] <dbg> wifi_nrf_bus: _spim_wait_while_rpu_awake: RDSR1 = 0x0
    [00:00:00.887,481] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1

Reply
  • Hello Asbjorn,

    sorry for not answering sooner, but I wanted to double check some things...

    I believe that the coexistence actually works ok after inverting the switch, but, the output signal from nRF7002 chip, for the 2.4GHz is quite low. I can load the "radio_test" sample, alongside with my overlay for the custom board, and I can use it, but the signal levels are quite low.... This could be either the hardware design problem, or software configuration problem. I can connect to the network if I place my cellphone hotspot directly to the PCB board.

    If you would be so kind to tell me, am I testing this right, and, what could I double-check in my overlay file to ensure that the transmitted power is increased. If you think it's hardware, I'll have to check with my hardware design guys...

    So, I'm testing it like this:

    rtt:~$ wifi_radio_test init 1
    rtt:~$ wifi_radio_test tx_power 10
    rtt:~$ wifi_radio_test tx_tone 1
    

    Here's the image of the output:


    So, this is without coexistence, and right at the output of the TXRF0 pin, and connected with a cable to the analyzer. Does that look ok to you?

    I'm using "radio_test" example, and the only relevant thing in my dtsi file is this:

    &spi4{
    	status="okay";
    	compatible = "nordic,nrf-spim";
    	pinctrl-0 = <&7002_spi>;
    	pinctrl-1 = <&7002_spi_sleep>;
    	pinctrl-names = "default", "sleep";
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x0 >;
    
    	cs-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
    
    	nrf70: nrf7002@0 {
    		status = "okay";
    		compatible = "nordic,nrf7002-spi";
    		reg = <0>;
    		spi-max-frequency = <24000000>;
    		/* Wi-Fi Pins used */
    		iovdd-ctrl-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
    		bucken-gpios = <&gpio1  6 GPIO_ACTIVE_HIGH>;
    		host-irq-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
    		wifi-max-tx-pwr-2g-dsss = < 0x15 >;
    		wifi-max-tx-pwr-2g-mcs0 = < 0x10 >;
    		wifi-max-tx-pwr-2g-mcs7 = < 0x10 >;
    		wifi-max-tx-pwr-5g-low-mcs0 = < 0x9 >;
    		wifi-max-tx-pwr-5g-low-mcs7 = < 0x9 >;
    		wifi-max-tx-pwr-5g-mid-mcs0 = < 0xb >;
    		wifi-max-tx-pwr-5g-mid-mcs7 = < 0xb >;
    		wifi-max-tx-pwr-5g-high-mcs0 = < 0xd >;
    		wifi-max-tx-pwr-5g-high-mcs7 = < 0xd >;
    		wlan0: wlan {
    			compatible = "nordic,wlan";
    		};  
    	};
    };


    Here's my RTT log output after booting:

    [00:00:00.879,760] <dbg> clock_control: clkstarted_handle: lfclk: Clock started
    [00:00:00.881,378] <dbg> wifi_nrf_bus: rpu_gpio_config: GPIO configuration done...
    
    [00:00:00.883,544] <dbg> wifi_nrf_bus: rpu_pwron: Bucken = 0, IOVDD = 0
    [00:00:00.883,605] <inf> wifi_nrf_bus: SPIM spi@a000: freq = 24 MHz
    [00:00:00.883,605] <inf> wifi_nrf_bus: SPIM spi@a000: latency = 1
    [00:00:00.883,636] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000ef30 - rx_bufs 0 - 1
    [00:00:00.883,666] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000ef28 (1), current_rx 0 (0), tx buf/len 0x2000ef24/2, rx buf/len 0/0
    [00:00:00.883,697] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.883,697] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.883,728] <dbg> wifi_nrf_bus: rpu_wrsr2: Written 0x1 to WRSR2
    [00:00:00.883,728] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.883,758] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.883,819] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.883,819] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.883,819] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.883,850] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> fe 1 1 1 1 1
    [00:00:00.883,880] <dbg> wifi_nrf_bus: spim_wait_while_rpu_wake_write: RDSR2 = 0x1
    [00:00:00.883,880] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.883,911] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.883,941] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.883,941] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.883,972] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.884,002] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> 0 0 0 0 0 0
    [00:00:00.884,002] <dbg> wifi_nrf_bus: _spim_wait_while_rpu_awake: RDSR1 = 0x0
    [00:00:00.885,101] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.885,131] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.885,162] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.885,162] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.885,192] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.885,192] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> 0 0 0 0 0 0
    [00:00:00.885,223] <dbg> wifi_nrf_bus: _spim_wait_while_rpu_awake: RDSR1 = 0x0
    [00:00:00.886,291] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1
    [00:00:00.886,322] <dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x2000eef0 (1), current_rx 0x2000ef00 (1), tx buf/len 0x2000eee0/6, rx buf/len 0x2000eee8/6
    [00:00:00.886,352] <dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0
    [00:00:00.886,352] <dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0
    [00:00:00.886,383] <dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0
    [00:00:00.886,383] <dbg> wifi_nrf_bus: spim_read_reg: err: 0 -> 0 0 0 0 0 0
    [00:00:00.886,413] <dbg> wifi_nrf_bus: _spim_wait_while_rpu_awake: RDSR1 = 0x0
    [00:00:00.887,481] <dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x2000eef8 - rx_bufs 0x2000ef08 - 1

Children
No Data
Related