Hello
I am working on a WiFi application using a custom board equipped with both the nRF5340 aswell as the nRF7002. When requesting a WiFi connection using the net_mgmt function and static credentials I get the errorcode -134 (ENOTSUP).
int main(void) { struct wifi_connect_req_params cnx_params; struct net_if *iface = net_if_get_first_wifi(); if (iface == NULL) { LOG_ERR("Returned network interface is NULL"); } /* Sleep to allow initialization of Wi-Fi driver */ k_sleep(K_SECONDS(1)); /* STEP 9 - Initialize and add the callback function for network events */ net_mgmt_init_event_callback(&mgmt_cb, net_mgmt_event_handler, EVENT_MASK); net_mgmt_add_event_callback(&mgmt_cb); /* STEP 10 - Populate cnx_params with the network configuration */ wifi_args_to_params(&cnx_params); /* STEP 11 - Call net_mgmt() to request the Wi-Fi connection */ LOG_INF("Connecting to Wi-Fi"); int err = net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, &cnx_params, sizeof(struct wifi_connect_req_params)); if (err) { LOG_ERR("Connecting to Wi-Fi failed, err: %d", err); while(1) { gpio_pin_toggle_dt(&outputs[1]); k_msleep(700); } } k_sem_take(&run_app, K_FOREVER); }
I don't understand this error means exactly. When I flash the same firmware on the nRF7002 DK I don't get any errors at all.
I found this forum post which seems to present a similar issue. However the solution from that post does not work for me. My custom board does not have an external flash and when I add CONFIG_FLASH to my prj.conf I get this error when building because of it (__device_dts_ord_152 is spi, which is disabled on my board):
[101/425] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[102/425] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[103/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/debug/thread_info.c.obj
[104/425] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
[105/425] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[106/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/mem_mgmt/mem_attr.c.obj
[107/425] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
[108/425] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/assert.c.obj
[109/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj
[110/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_line.c.obj
[111/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/utils/addr_utils.c.obj
[112/425] Building ASM object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.6.1/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj
[113/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_init.c.obj
[114/425] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.6.1/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR.c.obj
[115/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings.c.obj
[116/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_store.c.obj
[117/425] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.6.1/nrf/subsys/partition_manager/flash_map_partition_manager.c.obj
[118/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_nvs.c.obj
[119/425] Generating linker_zephyr_pre0.cmd
[120/425] Building C object zephyr/drivers/entropy/CMakeFiles/drivers__entropy.dir/entropy_psa_crypto.c.obj
[121/425] Building C object zephyr/drivers/adc/CMakeFiles/drivers__adc.dir/adc_common.c.obj
[122/425] Building C object zephyr/drivers/clock_control/CMakeFiles/drivers__clock_control.dir/nrf_clock_calibration.c.obj
[123/425] Linking C static library zephyr\drivers\entropy\libdrivers__entropy.a
[124/425] Building C object zephyr/drivers/clock_control/CMakeFiles/drivers__clock_control.dir/clock_control_nrf.c.obj
[125/425] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/flash_page_layout.c.obj
[126/425] Building C object zephyr/drivers/adc/CMakeFiles/drivers__adc.dir/adc_nrfx_saadc.c.obj
[127/425] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
FAILED: zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj
C:\ncs\toolchains\cf2149caf2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DCONFIG_NRF_WIFI_FW_BIN=C:/ncs/v2.6.1/nrfxlib/nrf_wifi/fw_bins/default/nrf70.bin -DCONFIG_ZEPHYR -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-want-config.h\" -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF52_ERRATA_215_ENABLE_WORKAROUND=0 -DNRF5340_XXAA_APPLICATION -DNRF53_ERRATA_43_ENABLE_WORKAROUND=0 -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.6.1/zephyr/include -IC:/Users/wadn/Desktop/VT2_muscle_detector/Firmware/build_1/zephyr/include/generated -IC:/ncs/v2.6.1/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.6.1/zephyr/lib/libc/newlib/include -IC:/ncs/v2.6.1/zephyr/soc/common/nordic_nrf/. -IC:/ncs/v2.6.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.6.1/zephyr/subsys/net/l2 -IC:/ncs/v2.6.1/zephyr/subsys/net/ip -IC:/ncs/v2.6.1/zephyr/subsys/net/conn_mgr/. -IC:/ncs/v2.6.1/zephyr/subsys/settings/include -IC:/ncs/v2.6.1/nrf/include -IC:/Users/wadn/Desktop/VT2_muscle_detector/Firmware/build_1/tfm/api_ns/interface/include -IC:/ncs/v2.6.1/nrf/modules/trusted-firmware-m/. -IC:/ncs/v2.6.1/nrf/include/tfm -IC:/ncs/v2.6.1/nrf/modules/hostap/src -IC:/ncs/v2.6.1/nrf/modules/hostap/../../../modules/lib/hostap -IC:/ncs/v2.6.1/nrf/modules/hostap/../../../modules/lib/hostap/wpa_supplicant -IC:/ncs/v2.6.1/nrf/modules/hostap/../../../modules/lib/hostap/src -IC:/ncs/v2.6.1/nrf/drivers/wifi/nrf700x/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/utils/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/os_if/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/bus_if/bus/qspi/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/bus_if/bal/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/fw_if/umac_if/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/fw_load/mips/fw/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/hw_if/hal/inc -IC:/ncs/v2.6.1/nrf/drivers/wifi/nrf700x/src/qspi/inc -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/hw_if/hal/inc/fw -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/fw_if/umac_if/inc/fw -IC:/ncs/v2.6.1/nrfxlib/nrf_wifi/fw_if/umac_if/inc/default -IC:/ncs/v2.6.1/nrf/tests/include -IC:/ncs/v2.6.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.6.1/zephyr/modules/cmsis/. -IC:/ncs/v2.6.1/modules/hal/nordic/nrfx -IC:/ncs/v2.6.1/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.6.1/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.6.1/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.6.1/modules/debug/segger/SEGGER/DebugMon/include -IC:/Users/wadn/Desktop/VT2_muscle_detector/Firmware/build_1/modules/nrf/subsys/nrf_security/src/include/generated -IC:/ncs/v2.6.1/nrf/subsys/nrf_security/include -IC:/ncs/v2.6.1/nrf/ext/oberon/psa/core/include -IC:/ncs/v2.6.1/nrf/ext/oberon/psa/core/library -IC:/ncs/v2.6.1/modules/crypto/mbedtls/include -IC:/ncs/v2.6.1/modules/crypto/mbedtls/library -IC:/ncs/v2.6.1/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.6.1/nrfxlib/crypto/nrf_oberon/include -isystem C:/ncs/v2.6.1/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Og -imacros C:/Users/wadn/Desktop/VT2_muscle_detector/Firmware/build_1/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Users/wadn/Desktop/VT2_muscle_detector/Firmware=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.6.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.6.1=WEST_TOPDIR -ffunction-sections -fdata-sections -D_POSIX_THREADS -std=c99 -MD -MT zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj -MF zephyr\drivers\flash\CMakeFiles\drivers__flash.dir\spi_nor.c.obj.d -o zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/spi_nor.c.obj -c C:/ncs/v2.6.1/zephyr/drivers/flash/spi_nor.c
In file included from C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:98,
from C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain.h:50,
from C:/ncs/v2.6.1/zephyr/include/zephyr/sys/util.h:18,
from C:/ncs/v2.6.1/zephyr/include/zephyr/devicetree.h:26,
from C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:12,
from C:/ncs/v2.6.1/zephyr/include/zephyr/drivers/flash.h:28,
from C:/ncs/v2.6.1/zephyr/drivers/flash/spi_nor.c:14:
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:89:41: error: '__device_dts_ord_152' undeclared here (not in a function); did you mean '__device_dts_ord_15'?
89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
137 | #define _DO_CONCAT(x, y) x ## y
| ^
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:89:33: note: in expansion of macro '_CONCAT'
89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:216:37: note: in expansion of macro 'DEVICE_NAME_GET'
216 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:233:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
233 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/drivers/spi.h:388:24: note: in expansion of macro 'DEVICE_DT_GET'
388 | .bus = DEVICE_DT_GET(DT_BUS(node_id)), \
| ^~~~~~~~~~~~~
C:/ncs/v2.6.1/zephyr/include/zephyr/drivers/spi.h:404:9: note: in expansion of macro 'SPI_DT_SPEC_GET'
404 | SPI_DT_SPEC_GET(DT_DRV_INST(inst), operation_, delay_)
| ^~~~~~~~~~~~~~~
C:/ncs/v2.6.1/zephyr/drivers/flash/spi_nor.c:1528:16: note: in expansion of macro 'SPI_DT_SPEC_INST_GET'
1528 | .spi = SPI_DT_SPEC_INST_GET(0, SPI_WORD_SET(8),
| ^~~~~~~~~~~~~~~~~~~~
[128/425] Linking C static library zephyr\drivers\clock_control\libdrivers__clock_control.a
[129/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
[130/425] Building C object zephyr/drivers/pinctrl/CMakeFiles/drivers__pinctrl.dir/common.c.obj
[131/425] Linking C static library zephyr\drivers\adc\libdrivers__adc.a
[132/425] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/jesd216.c.obj
[133/425] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/soc_flash_nrf.c.obj
[134/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_layout.c.obj
[135/425] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/fs/nvs/nvs.c.obj
[136/425] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' --build 'c:\Users\wadn\Desktop\VT2_muscle_detector\Firmware\build_1'
* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
I am not very familiar with Zephyr so I don't know if the issue is coming from the devicetree. I am using the same board file as the DK with an overlay file to change the pins and peripherals according to the custom board:
/{ zephyr,user{ io-channels = <&adc 0>,<&adc 1>,<&adc 2>,<&adc 3>,<&adc 4>,<&adc 5>,<&adc 6>,<&adc 7>; }; buttons{ button2: button2 { gpios = <&gpio1 2 0>; label = "Button_3"; }; }; leds{ sen1: sen1 { gpios = <&gpio0 3 GPIO_PULL_DOWN>; label = "Sensor_Enable1"; }; sen2: sen2 { gpios = <&gpio0 2 GPIO_PULL_DOWN>; label = "Sensor_Enable2"; }; sen3: sen3 { gpios = <&gpio1 4 GPIO_PULL_DOWN>; label = "Sensor_Enable3"; }; sen4: sen4 { gpios = <&gpio1 6 GPIO_PULL_DOWN>; label = "Sensor_Enable4"; }; sen5: sen5 { gpios = <&gpio1 15 GPIO_PULL_DOWN>; label = "Sensor_Enable5"; }; sen6: sen6 { gpios = <&gpio1 14 GPIO_PULL_DOWN>; label = "Sensor_Enable6"; }; sen7: sen7 { gpios = <&gpio1 12 GPIO_PULL_DOWN>; label = "Sensor_Enable7"; }; sen8: sen8 { gpios = <&gpio1 11 GPIO_PULL_DOWN>; label = "Sensor_Enable8"; }; //vdd7002: vdd7002 { // gpios = <&gpio0 10 0>; // label = "7002_VDD_ENABLE"; //}; }; }; &adc { #address-cells = <1>; #size-cells = <0>; status = "okay"; channel@0 { reg = <0>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN0>; /* P0.02 for nRF52xx, P0.04 for nRF53xx */ zephyr,resolution = <12>; }; channel@1 { reg = <1>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN1>; zephyr,resolution = <12>; }; channel@2 { reg = <2>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN2>; zephyr,resolution = <12>; }; channel@3 { reg = <3>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN3>; zephyr,resolution = <12>; }; channel@4 { reg = <4>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN4>; zephyr,resolution = <12>; }; channel@5 { reg = <5>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN5>; zephyr,resolution = <12>; }; channel@6 { reg = <6>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN6>; zephyr,resolution = <12>; }; channel@7 { reg = <7>; zephyr,gain = "ADC_GAIN_1_6"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; zephyr,input-positive = <NRF_SAADC_AIN7>; zephyr,resolution = <12>; }; }; &ieee802154 { status = "okay"; }; &nrf_radio_coex { swctrl1-gpios = <&gpio1 8 0>; req-gpios = <&gpio0 29 0>; }; &led0 { gpios = <&gpio0 19 GPIO_PULL_DOWN>; label = "LED_1"; }; &led1 { gpios = <&gpio0 21 GPIO_PULL_DOWN>; label = "LED_2"; }; &arduino_adc { io-channel-map = <0 &adc 0>, <1 &adc 1>, <2 &adc 2>, <3 &adc 3>, <4 &adc 4>, <5 &adc 5>; }; &arduino_header { gpio-map = <0 0 &gpio0 4 0>, <1 0 &gpio0 5 0>, <2 0 &gpio0 6 0>, <3 0 &gpio0 7 0>, <4 0 &gpio0 25 0>, <5 0 &gpio0 26 0>, <6 0 &gpio1 0 0>, <7 0 &gpio1 1 0>, <8 0 &gpio1 4 0>, <9 0 &gpio1 5 0>, <10 0 &gpio1 6 0>, <11 0 &gpio1 7 0>, <12 0 &gpio1 8 0>, <13 0 &gpio1 9 0>, <14 0 &gpio1 10 0>, <15 0 &gpio1 11 0>, <16 0 &gpio1 12 0>, <17 0 &gpio1 13 0>, <18 0 &gpio1 14 0>, <19 0 &gpio1 15 0>, <20 0 &gpio1 2 0>, <21 0 &gpio1 3 0>; }; &button0 { gpios = <&gpio1 0 0>; label = "Button_1"; }; &button1 { gpios = <&gpio1 1 0>; label = "Button_2"; }; &i2c1 { status = "disabled"; }; &uart0 { status = "disabled"; }; &pwm0 { status = "disabled"; }; &nrf_radio_coex { /delete-property/ btrf-switch-gpios; }; &arduino_adc { io-channel-map = <0 &adc 0>, <1 &adc 1>, <2 &adc 2>, <3 &adc 3>, <4 &adc 4>, <5 &adc 5>; }; &gpio_fwd { status = "disabled"; }; &spi4 { status = "disabled"; }; &gpio_fwd { /delete-node/ uart; };
I am using version 2.6.1 of the SDK
Regards
wadn