Hello,
I am attempting to use the nRF7002EK shield with my nRF54L15PDK development kit.
I have custom code, but it's based on the wifi scan example provided by Nordic to scan nearby SSIDs.
My code builds successfully and runs, but when I enter "wifi scan" in my shell I hit an attribution unit violation.
Using a debugger, I tracked this down to net_if_get_default(); returning NULL, which makes
net_mgmt(NET_REQUEST_WIFI_SCAN, iface, ¶ms, sizeof(struct wifi_scan_params)) attempt to dereference a NULL pointer.
So, I'm wondering what needs to be done to get the nRF7002EK to populate as a network interface (wlan0) for this development kit.
Below is the networking-related part of my prj.conf:
# WIFI CONFIG_WIFI_SCAN_PROFILE_PASSIVE=y CONFIG_NET_DEFAULT_IF_FIRST=y CONFIG_WIFI_NRF70=y CONFIG_WIFI=y CONFIG_NET_L2_WIFI_MGMT=y CONFIG_NET_MGMT_EVENT=y CONFIG_HEAP_MEM_POOL_SIZE=25000 CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y CONFIG_NETWORKING=y CONFIG_NET_BUF_RX_COUNT=1 CONFIG_NET_BUF_TX_COUNT=1 CONFIG_NET_NATIVE=n CONFIG_NET_OFFLOAD=y CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=n CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY=n CONFIG_WIFI_SCAN_DWELL_TIME_ACTIVE=50 CONFIG_WIFI_SCAN_DWELL_TIME_PASSIVE=130
And below is the fragment of my Devicetree overlay where I initialize my spi00 peripheral with the pins I have attached it to on my nRF54L15DK:
/ { chosen { ncs,dtm-uart = &uart20; zephyr,wifi = &wlan0; }; }; &spi00 { status = "okay"; cs-gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; compatible = "nordic,nrf-spim"; pinctrl-0 = <&spi00_default>; pinctrl-1 = <&spi00_sleep>; pinctrl-names = "default", "sleep"; nrf70: nrf7002-spi@0 { compatible = "nordic,nrf7002-spi"; status = "okay"; reg = <0>; spi-max-frequency = <DT_FREQ_M(8)>; // Pin assignments for nrf7002 chip iovdd-ctrl-gpios = <&gpio2 5 GPIO_PULL_DOWN>; bucken-gpios = <&gpio2 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; host-irq-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>; // Short-range (SR) co-existence (disabled) //srrf-switch-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; /* Maximum TX power limits for 2.4 GHz */ wifi-max-tx-pwr-2g-dsss = <21>; wifi-max-tx-pwr-2g-mcs0 = <16>; wifi-max-tx-pwr-2g-mcs7 = <16>; /* List of interfaces */ wlan0: wlan0 { compatible = "nordic,wlan"; }; wifi-max-tx-pwr-5g-low-mcs0 = <13>; wifi-max-tx-pwr-5g-low-mcs7 = <13>; wifi-max-tx-pwr-5g-mid-mcs0 = <13>; wifi-max-tx-pwr-5g-mid-mcs7 = <13>; wifi-max-tx-pwr-5g-high-mcs0 = <12>; wifi-max-tx-pwr-5g-high-mcs7 = <12>; }; }; &pinctrl { spi00_default: spi00_default { group1 { psels = <NRF_PSEL(SPIM_SCK, 2, 1)>, <NRF_PSEL(SPIM_MOSI, 2, 2)>, <NRF_PSEL(SPIM_MISO, 2, 4)>; }; }; spi00_sleep: spi00_sleep { group1 { psels = <NRF_PSEL(SPIM_SCK, 2, 1)>, <NRF_PSEL(SPIM_MOSI, 2, 2)>, <NRF_PSEL(SPIM_MISO, 2, 4)>; low-power-enable; }; }; };
Please let me know if I've made an error in setting up this network companion chip, or if the nRF7002EK shield isn't compatible with the DK I'm using for some reason.
I can try to provide additional details if necessary. Thank you.