#error "PSA_WANT_ALG_DETERMINISTIC_ECDSA defined, but not all prerequisites".

I have used ncs-example application workspace to develop our project. In that we were trying to include WIFI, so we include all (sample/wifi/sta) content to my project. but while compiling we facing #error "PSA_WANT_ALG_DETERMINISTIC_ECDSA defined, but not all prerequisites". Here I share the build log.

I am using nRF Connect SDK v2.6.1
  

D:/nrf_projects/Workspace/nrf/ext/oberon/psa/core/library/check_crypto_config.h:80:2: error: #error "PSA_WANT_ALG_DETERMINISTIC_ECDSA defined, but not all prerequisites"
80 | #error "PSA_WANT_ALG_DETERMINISTIC_ECDSA defined, but not all prerequisites"
| ^~~~~
ninja: build stopped: subcommand failed.
FAILED: modules/trusted-firmware-m/tfm-prefix/src/tfm-stamp/tfm-build tfm/bin/tfm_s.elf tfm/bin/tfm_s.bin tfm/bin/tfm_s.hex tfm/bin/tfm_s_signed.bin tfm/bin/tfm_s_ns_signed.bin 



Parents
  • Hi,

    PSA_WANT_ALG_DETERMINISTIC_ECDSA is not used in the STA sample, so I wonder how/why it is set and if you need it? If not, can you remove PSA_WANT_ALG_DETERMINISTIC_ECDSA=y from your project configuration?

  • Thank you. its working now. 

    But I'm facing below issue. 
    I have create simple wifi code just connect with provided SSID and password. After boot error
    "<err> net_config: Timeout while waiting network interface
     <err> net_config: Network initialization failed (-115)"

    But wifi is working good. connected to my network. Here i share my conf and debug log FYR.


    CONFIG_SENSOR=y
    CONFIG_APP_EVENT_MANAGER=y
    CONFIG_HEAP_MEM_POOL_SIZE=153600
    CONFIG_REBOOT=y
    CONFIG_TFM_KEY_FILE_S="D:/nrf_projects/Workspace/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072.pem"
    CONFIG_TFM_KEY_FILE_NS="D:/nrf_projects/Workspace/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072_1.pem"
    
    CONFIG_POSIX_MQUEUE=y
    CONFIG_POLL=y
    CONFIG_PWM=y
    CONFIG_GPIO=y
    
    # compiler
    CONFIG_DEBUG_OPTIMIZATIONS=y
    
    # console
    CONFIG_CONSOLE=y
    
    # UART console
    CONFIG_SERIAL=y
    CONFIG_UART_CONSOLE=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    # logging
    CONFIG_LOG=y
    CONFIG_APP_LOG_LEVEL_DBG=y
    
    CONFIG_WIFI=y
    CONFIG_INIT_STACKS=y
    CONFIG_NET_L2_WIFI_MGMT=y
    
    CONFIG_NETWORKING=y
    CONFIG_NET_IPV4=y
    CONFIG_NET_IPV6=y
    CONFIG_NET_UDP=y
    CONFIG_NET_TCP=y
    CONFIG_DNS_RESOLVER=y
    CONFIG_DNS_RESOLVER_AI_MAX_ENTRIES=10
    
    CONFIG_NET_SOCKETS=y
    CONFIG_HTTP_CLIENT=y
    
    # Use DHCP for IPv4
    CONFIG_NET_DHCPV4=y
    CONFIG_NET_CONFIG_AUTO_INIT=y
    
    # Or assign a static IP address (useful for testing)
    # Following line must be enabled, otherwise WiFi connection fails with -1.
    CONFIG_NET_CONFIG_SETTINGS=y
    # Add CONFIG_INIT_TIMEOUT to prevent 30 second timeout when starting:
    # [00:00:30.600,250] <err> net_config: Timeout while waiting network interface
    # [00:00:30.600,250] <err> net_config: Network initialization failed (-115)
    CONFIG_NET_CONFIG_INIT_TIMEOUT=1
    CONFIG_NET_CONFIG_NEED_IPV4=y
    CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99"
    CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0"
    CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1"
    #CONFIG_NET_CONFIG_NEED_IPV6=y
    #CONFIG_NET_CONFIG_MY_IPV6_ADDR="fe80::100"
    
    # Enabling logging can be helpful for debugging
    CONFIG_NET_LOG=y
    CONFIG_WIFI_LOG_LEVEL_ERR=y
    # CONFIG_NET_IPV6_LOG_LEVEL_DBG=y
    
    CONFIG_NET_TX_STACK_SIZE=4096
    CONFIG_NET_RX_STACK_SIZE=4096
    
    CONFIG_NET_PKT_RX_COUNT=10
    CONFIG_NET_PKT_TX_COUNT=10
    
    CONFIG_NET_BUF_RX_COUNT=20
    CONFIG_NET_BUF_TX_COUNT=20
    
    CONFIG_NET_MAX_CONTEXTS=10
    
    # Added to prevent error with missing #include <ethernet/eth_stats.h> for esp_wifi_drv.c
    # Adding this line will cause CMAKE Warning: No SOURCES given to Zephyr library: drivers__ethernet
    # Just ignore.
    CONFIG_NET_L2_ETHERNET=y
    
    # Enable nordic security backend and PSA APIs
    CONFIG_NRF_SECURITY=y
    CONFIG_MBEDTLS_PSA_CRYPTO_C=y
    
    CONFIG_MBEDTLS_ENABLE_HEAP=y
    CONFIG_MBEDTLS_HEAP_SIZE=8192
    
    CONFIG_WIFI_NRF700X=y
    
    # Include WPA Supplement.
    CONFIG_WPA_SUPP=y
    
    # Required to prevent error in \wifi\nrf700x\zephyr\src\shim.c:14:10: fatal error: sys/time.h: No such file or directory
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_NANO=n
    
    # Required to prevent undefined reference to `z_impl_sys_rand32_get'
    CONFIG_ENTROPY_GENERATOR=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

  • Hi,

    It looks like there is a problem with DHCPv4, but you are getting an IPv6 address.I don't see any obvious issue here though. Does the Wi-Fi Station sample work out of the box for you? If so, you would knot that thereis no issue outside of the nRF (with the access point or router).

    If you don't make progress, perhaps you can share your code?

  • but you are getting an IPv6 address

    But I'm not config any IPv6 related configuration.


    Wi-Fi Station sample

    This sample alone in SDK is working fine. After include that to my application create such issue.

    Here I share code. WifiInit() is called from main function.

    #define MODULE wifi
    
    #include <zephyr/logging/log.h>
    LOG_MODULE_REGISTER(MODULE, CONFIG_APP_LOG_LEVEL);
    
    #define SSID "test_ap"
    #define PSK "secretsquirrel"
    
    static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb);
    static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb);
    static void handle_ipv4_result(struct net_if *iface);
    static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface);
    
    /*
    =================================
     Variable Declarations
    =================================
    */
    static struct net_mgmt_event_callback wifi_cb;
    static struct net_mgmt_event_callback ipv4_cb;
    static bool IsNetworkConnected = false;
    
    
    int WfiInit(void)
    {
    	LOG_INF("WfiInit");
        LOG_INF("WiFi ExampleBoard: %s", CONFIG_BOARD);
    
        net_mgmt_init_event_callback(&wifi_cb, wifi_mgmt_event_handler,
                                     NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT
                                     | NET_EVENT_WIFI_SCAN_RESULT | NET_EVENT_WIFI_SCAN_DONE | NET_EVENT_WIFI_RAW_SCAN_RESULT
                                     | NET_EVENT_WIFI_DISCONNECT_COMPLETE | NET_EVENT_WIFI_AP_STA_CONNECTED
                                     | NET_EVENT_WIFI_AP_STA_DISCONNECTED);
    
        net_mgmt_init_event_callback(&ipv4_cb, wifi_mgmt_event_handler, NET_EVENT_IPV4_ADDR_ADD);
    
        net_mgmt_add_event_callback(&wifi_cb);
        net_mgmt_add_event_callback(&ipv4_cb);
    	
    	WifiConnect();
    	return 0;
    }
    
    static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb)
    {
        const struct wifi_status *status = (const struct wifi_status *)cb->info;
    
        if (status->status)
        {
            LOG_ERR("Connection request failed (%d)", status->status);
        }
        else
        {
            LOG_INF("Connected");
        }
    }
    
    static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb)
    {
        const struct wifi_status *status = (const struct wifi_status *)cb->info;
    
        if (status->status)
        {
            LOG_INF("Disconnection request (%d)", status->status);
        }
        else
        {
            LOG_INF("Disconnected");
        }
    }
    
    static void handle_ipv4_result(struct net_if *iface)
    {
        int i = 0;
        struct wifi_event_data event_data;
    
        for (i = 0; i < NET_IF_MAX_IPV4_ADDR; i++) {
    
            char buf[NET_IPV4_ADDR_LEN];
    
            if (iface->config.ip.ipv4->unicast[i].addr_type != NET_ADDR_DHCP) {
                continue;
            }
    
            LOG_INF("IPv4 address: %s",
                    net_addr_ntop(AF_INET,
                                    &iface->config.ip.ipv4->unicast[i].address.in_addr,
                                    buf, sizeof(buf)));
            LOG_INF("Subnet: %s",
                    net_addr_ntop(AF_INET,
                                    &iface->config.ip.ipv4->netmask,
                                    buf, sizeof(buf)));
            LOG_INF("Router: %s",
                    net_addr_ntop(AF_INET,
                                    &iface->config.ip.ipv4->gw,
                                    buf, sizeof(buf)));
            }
    
    		IsNetworkConnected = true;
    
    }
    
    static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface)
    {
        switch (mgmt_event)
        {
            case NET_EVENT_WIFI_CONNECT_RESULT:
                LOG_INF("Connected");
                handle_wifi_connect_result(cb);
                break;
    
            case NET_EVENT_WIFI_DISCONNECT_RESULT:
                LOG_INF("Disconnected");
                handle_wifi_disconnect_result(cb);
                break;
    
            case NET_EVENT_IPV4_ADDR_ADD:
                LOG_INF("NET_EVENT_IPV4_ADDR_ADD");
                handle_ipv4_result(iface);
                break;        
                
            case NET_EVENT_WIFI_SCAN_RESULT:
                LOG_INF("NET_EVENT_WIFI_SCAN_RESULT");
                break;
    
            case NET_EVENT_WIFI_SCAN_DONE:
                LOG_INF("NET_EVENT_WIFI_SCAN_DONE");
                break;
    
            case NET_EVENT_WIFI_RAW_SCAN_RESULT:
                LOG_INF("NET_EVENT_WIFI_RAW_SCAN_RESULT");
                break;
    
            case NET_EVENT_WIFI_DISCONNECT_COMPLETE:
                LOG_INF("NET_EVENT_WIFI_DISCONNECT_COMPLETE");
                break;
    
            case NET_EVENT_WIFI_AP_STA_CONNECTED:
                LOG_INF("NET_EVENT_WIFI_AP_STA_CONNECTED");
                break;
    
            case NET_EVENT_WIFI_AP_STA_DISCONNECTED:
                LOG_INF("NET_EVENT_WIFI_AP_STA_DISCONNECTED");
                break;
    
            default:
                break;
        }
    }
    
    void WifiConnect(void)
    {
        struct net_if *iface = net_if_get_default();
    
        struct wifi_connect_req_params wifi_params = {0};
    
        wifi_params.ssid = SSID;
        wifi_params.psk = PSK;
        wifi_params.ssid_length = strlen(SSID);
        wifi_params.psk_length = strlen(PSK);
        wifi_params.channel = WIFI_CHANNEL_ANY;
        wifi_params.security = WIFI_SECURITY_TYPE_PSK;
        wifi_params.band = WIFI_FREQ_BAND_2_4_GHZ; 
        wifi_params.mfp = WIFI_MFP_OPTIONAL;
    
        LOG_INF("Connecting to SSID: %s", wifi_params.ssid);
    
        if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, &wifi_params, sizeof(struct wifi_connect_req_params)))
        {
            LOG_ERR("WiFi Connection Request Failed");
        }
    }
    
    void GetWifiStatus(void)
    {
        struct net_if *iface = net_if_get_default();
        
        struct wifi_iface_status status = {0};
    
        if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, iface, &status,	sizeof(struct wifi_iface_status)))
        {
            LOG_ERR("WiFi Status Request Failed");
        }
    
        if (status.state >= WIFI_STATE_ASSOCIATED) 
        {
            LOG_INF("SSID: %-32s", status.ssid);
            LOG_INF("Band: %s", wifi_band_txt(status.band));
            LOG_INF("Channel: %d", status.channel);
            LOG_INF("Security: %s", wifi_security_txt(status.security));
            LOG_INF("RSSI: %d", status.rssi);
        }
    }
    
    void wifi_disconnect(void)
    {
        struct net_if *iface = net_if_get_default();
    
        if (net_mgmt(NET_REQUEST_WIFI_DISCONNECT, iface, NULL, 0))
        {
            LOG_ERR("WiFi Disconnection Request Failed");
        }
    }

  • Hi,

    I see. I cannot see from the code snippet, but -115 is -EINPROGRESS, and as you write that it works even if you get this error, that indicate to me that you are tryign to bring up the interface twice. And on the second attempt, this is already in progres, and would fail.

Reply Children
  • Hi, 

    it works even if you get this error, that indicate to me that you are tryign to bring up the interface twice.

    Yes, I think so. But how could I found that?

    Like auto Init config may cause this issues? Please provide your suggestion to figure out this issue.

  • Hi Einar,

    setting CONFIG_NET_CONFIG_AUTO_INIT=n

    I have change this setting and check, the below error is not coming 
    # [00:00:30.600,250] <err> net_config: Timeout while waiting network interface
    # [00:00:30.600,250] <err> net_config: Network initialization failed (-115)

    but faced below error "WiFi Connection Request Failed"


     *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    
    2024-06-05 10:10:30.483000 [00:00:00.577,392] <inf> main: Node Sensor!
    
    2024-06-05 10:10:30.483000 [00:00:00.577,392] <inf> nrf7002_wifi: WfiInit
    
    2024-06-05 10:10:30.498000 [00:00:00.577,423] <inf> nrf7002_wifi: WiFi ExampleBoard: nrf7002dk_nrf5340_cpuapp
    
    2024-06-05 10:10:30.498000 [00:00:00.577,453] <inf> nrf7002_wifi: WfiConfiguration
    
    2024-06-05 10:10:30.498000 [00:00:00.577,484] <inf> nrf7002_wifi: Connecting to SSID: test_ap
    
    2024-06-05 10:10:30.514000 [00:00:00.577,484] <err> nrf7002_wifi: WiFi Connection Request Failed


    then I have included net_config_init function to initialize network in WifiInit() function

        int ret;

        // Initialize network configuration
        ret = net_config_init("Initializing network...", K_SECONDS(10));
        if (ret < 0) {
            LOG_ERR("Network initialization failed: %d", ret);
            return;
        }

    but it takes 6min to get the error response and while trying to connected to the SSID, it gives IP and  stuck there event cb is not working. Is anything to change in the event callback?

    2024-06-05 10:32:53.617000 *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    
    2024-06-05 10:32:53.633000 [00:00:00.641,174] <inf> main: Node Sensor!
    
    2024-06-05 10:32:53.633000 [00:00:00.641,174] <inf> nrf7002_wifi: WfiInit
    
    2024-06-05 10:32:53.633000 [00:00:00.641,204] <inf> nrf7002_wifi: WiFi ExampleBoard: nrf7002dk_nrf5340_cpuapp
    
    2024-06-05 10:32:53.648000 [00:00:00.641,235] <inf> net_config: Initializing network...
    
    2024-06-05 10:32:53.648000 [00:00:00.641,265] <inf> net_config: Waiting interface 1 (0x20000f48) to be up...
    
    2024-06-05 10:38:21.862000 [00:05:28.322,082] <inf> net_config: IPv4 address: 192.168.1.1
    
    2024-06-05 10:38:21.862000 [00:05:28.322,143] <inf> net_config: Running dhcpv4 client...
    
    2024-06-05 10:38:21.877000 [00:05:28.322,357] <err> net_config: Timeout while waiting network interface
    
    2024-06-05 10:38:21.877000 [00:05:28.322,387] <err> nrf7002_wifi: Network initialization failed: -115
    
    2024-06-05 10:38:21.877000 [00:05:28.322,387] <inf> nrf7002_wifi: WfiConfiguration
    
    2024-06-05 10:38:21.893000 [00:05:28.322,418] <inf> nrf7002_wifi: Connecting to SSID: test_ap
    
    2024-06-05 10:38:24.190000 [00:05:31.203,399] <inf> net_dhcpv4: Received: 192.168.137.220
    
    2024-06-05 10:38:24.190000 [00:05:31.203,552] <inf> net_config: IPv4 address: 192.168.137.220
    
    2024-06-05 10:38:24.206000 [00:05:31.203,552] <inf> net_config: Lease time: 604800 seconds
    
    2024-06-05 10:38:24.206000 [00:05:31.203,613] <inf> net_config: Subnet: 255.255.255.0
    
    2024-06-05 10:38:24.206000 [00:05:31.203,643] <inf> net_config: Router: 192.168.137.1
  • Hi,

    I see. Looking at the code I see that you do no thandle the NET_EVENT_IPV4_DHCP_BOUND event. As you based your code on the STA sample, you can refer to how it is handled there (calling print_dhcp_ip() on the event). I did not spot anything obvious, but there may also be other issues.

Related