Trying to use SPI for nrf7002 connection to Host

I've been trying to use SPI instead of QSPI to connect the nrf7002 to de nrf5340 on the nrf7002dk. I used the wifi shell example from nordic. I used an overlay file to reassign the nrf7002 module to de SPI pins, and the example is building correctly. I have an issue at running time. This is whats appears at the terminal:

[00:00:00.285,766] <inf> wifi_nrf: SPIM spi@b000: freq = 24 MHz

[00:00:00.285,797] <inf> wifi_nrf: SPIM spi@b000: latency = 1

[00:00:00.286,193] <err> wifi_nrf: hal_rpu_reg_read: Error !! Value read at addr_offset = 400 is = FFFFFFFF

[00:00:00.286,254] <err> wifi_nrf: hal_rpu_irq_enable: Reading from Root interrupt register failed

[00:00:00.286,285] <err> wifi_nrf: wifi_nrf_hal_dev_add: hal_rpu_irq_enable failed

[00:00:00.286,407] <err> wifi_nrf: wifi_nrf_fmac_dev_add: wifi_nrf_hal_dev_add failed

[00:00:00.286,437] <err> wifi_nrf: wifi_nrf_fmac_dev_add_zep: wifi_nrf_fmac_dev_add failed

[00:00:00.286,437] <err> wifi_nrf: wifi_nrf_drv_main_zep: wifi_nrf_fmac_dev_add_zep failed

[00:00:00.286,712] <err> wifi_nrf: wifi_nrf_if_init_zep: Device wlan0 is not ready

[00:00:00.286,956] <err> wifi_nrf: wifi_nrf_if_start_zep: Device wlan0 is not ready

[00:00:00.290,771] <inf> fs_nvs: 6 Sectors of 4096 bytes
[00:00:00.290,802] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.290,802] <inf> fs_nvs: data wra: 0, 0
*** Booting Zephyr OS build v3.2.99-ncs2 ***
Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 128 MHz
[00:00:00.291,015] <inf> wpa_supp: z_wpas_start: 385 Starting wpa_supplicant thread with debug level: 3

[00:00:00.291,137] <inf> wpa_supp: Successfully initialized wpa_supplicant
uart:~$
uart:~$ wifi scan
Scan request failed

[00:04:12.161,987] <err> wifi_nrf: wifi_nrf_disp_scan_zep: Interface not UP

nrf7002dk_nrf5340_cpuapp.overlay

I suspect that there are errors in the configuration, but i couldn't find any information about this.

Parents
  • Josefina,

    I'm a third party developer, not associated with Nordic. We have been working with using the nRF7002 on the nRF52840 in SPI mode as QSPI mode currently throws some build errors such as unknown type nrf_qspi_encryption_t.  (nRF52840 QSPI I/F doesn't have HW encryption, like the nRF5340).

    Your post caught my interest. This is the output nRF7002-DK working in SPI Mode:

    [00:00:00.306,579] <inf> wifi_nrf: SPIM spi@b000: freq = 24 MHz
    [00:00:00.306,610] <inf> wifi_nrf: SPIM spi@b000: latency = 1
    [00:00:00.326,202] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: LMAC patches loaded
    [00:00:00.337,036] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: LMAC boot check passed
    [00:00:00.355,682] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: UMAC patches loaded
    [00:00:00.366,516] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: UMAC boot check passed
    [00:00:00.387,725] <inf> wifi_nrf: RPU LPM type: HW
    [00:00:00.506,317] <inf> fs_nvs: 6 Sectors of 4096 bytes
    [00:00:00.506,317] <inf> fs_nvs: alloc wra: 0, fe8
    [00:00:00.506,347] <inf> fs_nvs: data wra: 0, 0
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 128 MHz
    [00:00:00.506,622] <inf> wpa_supp: z_wpas_start: 385 Starting wpa_supplicant thread with debug level: 3
    [00:00:00.506,713] <inf> wpa_supp: Successfully initialized wpa_supplicant

    Attached is the overlay file.  5430.nrf7002dk_nrf5340_cpuapp.overlay (Looks like the forum has changed the filename) 

    SPI2 works fine. Your SPI2 node was pointing to pins defined in spi2_default (pinctrl-0 = <&spi2_default>), but these were not in the overlay file. In your pinctrl node, you were defining alternatives (spi2_default_alt: spi2_default_alt)

    In the nRF7002dk board files, spi2_default had assigned different pins to what was required to talk to the nRF7002 on the DK (and hence why it was returning 0xFFFF)

  • Thanks for your answer, I corrected that mistake! Anyways, I discovered that besides that error it wasn´t working due to a different reason. Disabling the qspi node in my overlay file isn't enough, since the wifi pins are still connected to the nrf7002 instance on the qspi node. In order for it to work I had to delete the qspi node from the original dts file, wich I know is wrong. I would like to know if there's a way to disable qspi and the nrf7002 instance at the same time from my overlay file. The reason I want to disable qspi is because I want to use the same pins but with spi.

Reply
  • Thanks for your answer, I corrected that mistake! Anyways, I discovered that besides that error it wasn´t working due to a different reason. Disabling the qspi node in my overlay file isn't enough, since the wifi pins are still connected to the nrf7002 instance on the qspi node. In order for it to work I had to delete the qspi node from the original dts file, wich I know is wrong. I would like to know if there's a way to disable qspi and the nrf7002 instance at the same time from my overlay file. The reason I want to disable qspi is because I want to use the same pins but with spi.

Children
Related