nRF7002 randomly unable to connect to Wifi

I have an application that syncs via the internet using a nRF5340 and nRF7002.  I am using the thingy53 with a nRF7002EB for now while the custom circuit boards are being manufactured.  The application connects via wifi every 4 minutes to transmit data.  It then disconnects from the Wifi network to save power between sync intervals.  The application is currently using nRF Connect v3.0.1 and is based on the Azure IoT sample.

The application is in early field testing with around 20 users.  It works well most of the time, but randomly, after 1-2 weeks the system will stop being able to connect to the Wifi network.  A Wifi scan is initiated, but a connection event is never received.  I have also discovered that the system will start working again if I issue the new diagnostic command nrf70 util rpu_recovery_test via a shell connection.

My suspicion is that this is a bug in the nRF7002 where it can somehow get into a semi-unresponsive state.  The only way to recover is to externally reset the nRF7002.  It is difficult to know for sure because this issue takes a week or two to reproduce.  I do have CONFIG_NRF_WIFI_RPU_RECOVERY set, but this doesn't seem to be working.  I am considering updating the application firmware to add a custom nRF7002 watchdog timer that can reset it if it hangs.  However, I wanted to check with the Nordic team to make sure there aren't any known issues or other suggested troubleshooting steps.

  • Application details

    • Data transfer is to Azure IoT Hub (TCP/MQTT).  Sync attempts are once every 4 minutes and the payload is around 512 bytes.  As far as I can tell, the error occurs when trying to make a new wifi connection (not during a connection or while syncing data).
    • Issue has been duplicated in multiple environments with multiple routers.  I am using Wifi 6, 2.4 GHz (channel 3) with WPA2-PSK.
    • Yes, the issue can be duplicated on both the nRF7002DK and the nRF5340+nRF7002EK

    I will update the application logging with the RPU information so we have it the next time we reproduce the issue.  Some of the other diagnostic requests are more difficult, but I will look into them.

    Additional update - I created a modified version of the STA sample to see if I can duplicate the issue with shareable code on a DK board.  It hasn't failed yet, but this might be because I also updated the firmware to bring down the Wifi interface (net_if_down()) when not in use or if it can't connect within 60 seconds.  I will test some more, but bringing down the interface might be a good way to work around the issue.

  • Please see the attached sample program and log file that can be used to duplicate the issue using a nRF7002 DK board.  The application continuously connects and disconnects wifi.  If it can't connect for 60 seconds, it tries again and logs the message "Wifi stuck".

    In my test, it took about 6 hours for wifi to get stuck in a loop where it could no longer connect.  I tried printing the rpu stats again, but they were all 0's.  I tried again and got the message "<err> wifi_nrf: nrf_wifi_sys_fmac_stats_get: Stats request already pending".  I tried to do a wifi scan, but no devices were found.  Lastly, I issued the rpu_recovery_test command and things started working again.

    I think the problem is caused by calling net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, net_if_get_default(), NULL, 0) when a previous connect request is in progress (or failed).  Also, it appears that bringing down the wifi interface between connnect/disconnect cycles avoids the issue.

    wifi.log

     0042.sta.zip

Related