nRF9160 with nRF7002-ek; connect to Wi-Fi network

My setup is a nRF7002-EK shield on top of the nRF9160-DK.
Trying to use this shield to connect to a Wi-Fi network, using the shell example compiled with the suggested command:

west build -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG="overlay-scan-only.conf" -DSHIELD=nrf7002ek

Using the shell `wifi scan`, I can see all the available networks.
However, connecting to a network instantly fails.

Does the `scan-only-overlay` mean that I am only able to use the scan command?
Is it possible (and how?) to also use the other commands as most of the other commands return an error.

  • Hi

    Yes, this is an overlay to do scanning only in order to minimize the RAM usage on the nRF9160. You will need to remove this overlay config to use the other options, but I'm not sure if this will fit on the nRF9160 in terms of RAM/Flash memory usage.

    If you check out the overlay-scan-only.conf file, you can see what options are disabled or not (attached below):

    # Scan only using offload API
    CONFIG_WPA_SUPP=n
    # In 9160 default is socket interface
    CONFIG_NET_DEFAULT_IF_ETHERNET=y
    CONFIG_MBEDTLS=n
    CONFIG_NORDIC_SECURITY_BACKEND=n
    # If MbedTLS is enabled, use the standard files
    CONFIG_GENERATE_MBEDTLS_CFG_FILE=y
    
    # Disable unused networking options
    CONFIG_NET_SOCKETS=n
    CONFIG_POSIX_API=n
    CONFIG_NET_LOG=n
    CONFIG_NET_IPV6=n
    CONFIG_NET_TCP=n
    CONFIG_DNS_RESOLVER=n
    
    # Memories
    CONFIG_NET_PKT_RX_COUNT=1
    CONFIG_NET_PKT_TX_COUNT=1
    # Needed to handle more scan results
    CONFIG_HEAP_MEM_POOL_SIZE=25000
    

    Best regards,

    Simon

  • Thanks for the quick reply Simon! Will follow-up later this week.

    In the meantime, I have a new related question. The end goal of my project is to use the nRF7002 Wi-Fi chip besides the build-in nRF9160 LTE module. Do you think this is possible at all on the nRF9160?

    Current application (only uses the LTE, no Wi-Fi).

    Memory region         Used Size  Region Size  %age Used
               FLASH:      141668 B       960 KB     14.41%
                 RAM:      110632 B     211736 B     52.25%

  • Hi

    That depends on what you're planning on using the nRF7002 for exactly, but yes I think that should be possible.

    Best regards,

    Simon

  • Alright took some time to look into this.

    With the scan-only overlay the used size is fine:

    Memory region         Used Size  Region Size  %age Used
               FLASH:      250704 B       992 KB     24.68%
                 RAM:       76028 B     211608 B     35.93%
            IDT_LIST:          0 GB        32 KB      0.00%

    Without this overlay the RAM is not big enough and overflows by more than 6000 bytes.
    So yes this must be the reason why the examples page uses the scan-only overflow for the nRF9160 MCU.

    Tried to remove some of the configs from the scan-only overlay, but this always results in compilation errors.
    I am not familiar with these configuration parameters, hence I was looking for an example. 

    My first question (I start to get the feeling this is impossible as only the nRF7002-ek code already doesn't fit) Is it possible to use the nRF9160 with the lte module AND the nRF7002-ek WiFi module?

    If yes, can you provide me with an example of the nRF7002 WiFi code in combination with the nRF9160 (with more functionality than just scanning for networks)? 

  • Hi

    Did some digging on my end, and doing anything else than scanning won't be possible I'm afraid. If you check out the memory requirements for Wi-Fi applications in STA mode here you can see that just a "simple" UDP socket functionality will require a total of 211 kB of RAM, which is almost all of the nRF9160's 256kB, especially since some of this RAM is coined for secure partitions.

    Best regards,

    Simon

Related