<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current</link><description>nrf5340+nrf7002 running Zephyr with NCS v2.6.x. 
 When trying to connect to a wifi AP with incorrect credentials, I have several issues: 
 1/ the result of the (failed) connect request always returns 10s later, no matter the value of &amp;#39;timeout&amp;#39; in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Dec 2024 09:06:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current" /><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/515407?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 09:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca1e301e-7cb6-4c47-bf11-9481bb621edc</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/117362/trouble-migrating-from-ncs-2-6-to-2-8"&gt;devzone.nordicsemi.com/.../trouble-migrating-from-ncs-2-6-to-2-8&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/515325?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2024 17:04:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37c1bc96-f203-4365-a21b-12b8a8638839</guid><dc:creator>BrianW</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current/514925"]&lt;p&gt;Let me know if you run into any issues, and I will try to help out.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;So many issues.... I will open a new ticket about the migration as its completely broken my project...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/514925?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2024 14:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:153c6ea7-d208-47a0-bf30-18f98a67e555</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;v2.8.0 has the fix that was mentioned here:&lt;/p&gt;
[quote user="hkn"]&lt;p&gt;My apologies for this inconvenience. We have an open PR to fix this in the v2.6.x-branch:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/18790"&gt;https://github.com/nrfconnect/sdk-nrf/pull/18790&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;So in that aspect, yes; you should see stability improvement when running v2.8.0 as compared to v2.6.2.&lt;/p&gt;
[quote user="BrianW"]Any advice on such a migration?[/quote]
&lt;p&gt;We have a migration guide in our documentation on how to go from multi-build to sysbuild:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_sysbuild.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_sysbuild.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me know if you run into any issues, and I will try to help out.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/514767?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2024 14:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79e9b8cc-de9a-454d-a859-c20be9e11ce4</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;Question : would migrating my project from 2.6.x to 2.8 latest help the wifi stability?&lt;/p&gt;
&lt;p&gt;Any advice on such a migration?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/513045?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 16:23:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4e92eb0-a0ab-4814-ae07-17bb5919aa46</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="BrianW"]The heap size is fine, the problem is that each re-try that fails loses about 120-140 bytes! So it doesn&amp;#39;t matter how big the heap is to start with, eventually it ends up in the bad state. What I need is a fix for the memory leak! (presumably in the WPA supplient code...)[/quote]
&lt;p&gt;My deepest apologies for this issue. We have a fix in-place for v2.7-branch and v2.8, but the backport of it to v2.6-branch is yet to be merged.&lt;/p&gt;
[quote user="BrianW"]I&amp;#39;m not sure I signed up as a beta tester for your wifi products.... I&amp;#39;ll take a look...[/quote]
&lt;p&gt;This was not our intention, and I am sorry for the inconvenience this has caused.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="BrianW"]&lt;p&gt;This is not a sample, this is my real application :-) Looking at the sample wifi_sta, the&amp;nbsp;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;wifi_connect_req_params timeout field &lt;/span&gt;&lt;span&gt;is set to&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_STA_CONN_TIMEOUT_SEC &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;MSEC_PER_SEC&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;which implies it should be the timeout for the connection attempt? But the stack always seems to take 10s...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;However, I see in this sample that the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;net_mgmt_event_callback&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;cb &amp;#39;info&amp;#39; field should contan the connection attempt status (although there is both &amp;quot;status&amp;#39; and &amp;#39;conn_status&amp;#39; which seems redundant? The sample just uses &amp;#39;status!=0&amp;#39; as being &amp;#39;failure&amp;#39; and doesnt look at conn_status.)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The possible values for &amp;#39;conn_status&amp;#39; seem more useful: I will try using these to detect the failed connection attempt!&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;Sorry, should have been a bit clearer in my question, and given a bit more background to it. The reason why I am asking is that there are subsystems that override the values, such as setting CONFIG_WIFI_CREDENTIALS_STATIC_SSID=&amp;quot;MySSID&amp;quot; and CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD=&amp;quot;MyPassword&amp;quot;.&lt;/p&gt;
&lt;p&gt;My question is how do you setup your credentials? Is it using a secure storage, directly via the net_mgmt APIs or static in Kconfig?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As an example, if you use the NET_REQUEST_WIFI_CONNECT_STORED type, as wifi/sta does:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/samples/wifi/sta/src/main.c#L225"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/samples/wifi/sta/src/main.c#L225&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will load the default values given here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/subsys/net/lib/wifi_mgmt_ext/wifi_mgmt_ext.c#L74"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/subsys/net/lib/wifi_mgmt_ext/wifi_mgmt_ext.c#L74&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This .timeout value is then given to the WPA supplication (hostap):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/modules/hostap/src/supp_api.c#L542"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/modules/hostap/src/supp_api.c#L542&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and checked against a timer here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/modules/hostap/src/supp_api.c#L125-L135"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.6.2/modules/hostap/src/supp_api.c#L125-L135&lt;/a&gt;&lt;/p&gt;
[quote user="BrianW"]&lt;p&gt;I&amp;#39;ll take a look at the info you reference; although this seems very complex to just get robust long-term wifi operation on the device... Why doesn&amp;#39;t the stack deal with this internally or when I disconnect it?!&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is in general the problem with the samples, they don&amp;#39;t help with creating a &amp;#39;real&amp;#39; application which has to deal with long running operation with connect/disconnect/errors that occur in real-life...&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;If the scenario occurs, where there for some reason gives a locked up state, the process of taking down the interface and booting it up again is handled in the background.&lt;/p&gt;
&lt;p&gt;However, it will require the application to manually re-connect, which is the reason why this is given back as a &amp;quot;wi-fi ready&amp;quot; event. This is then a signal to the application that the wi-fi IF has been taken down and re-initialized, thus the application will need to re-connect over wi-fi and setup any socket based communication as required.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/512822?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2024 20:05:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60b05443-037e-4587-9be4-4a714448e25f</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;Thanks for the responses!&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current/512815"]This is a typical issue if the heap is not large enough. Can you try to increase the heap via CONFIG_HEAP_MEM_POOL_SIZE to see if this helps?[/quote]
&lt;p&gt;The heap size is fine, the problem is that each re-try that fails loses about 120-140 bytes! So it doesn&amp;#39;t matter how big the heap is to start with, eventually it ends up in the bad state. What I need is a fix for the memory leak! (presumably in the WPA supplient code...)&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current/512815"]&lt;blockquote class="quote"&gt;&lt;div class="quote-content"&gt;&lt;p&gt; shouldn&amp;#39;t it use the timeout value?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;Are you using the static configuration? If yes, then it is configured via&amp;nbsp;CONFIG_WIFI_MGMT_EXT_CONNECTION_TIMEOUT.&lt;/p&gt;[/quote]
&lt;p&gt;This is not a sample, this is my real application :-) Looking at the sample wifi_sta, the&amp;nbsp;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;wifi_connect_req_params timeout field &lt;/span&gt;&lt;span&gt;is set to&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_STA_CONN_TIMEOUT_SEC &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;MSEC_PER_SEC&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;which implies it should be the timeout for the connection attempt? But the stack always seems to take 10s...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;However, I see in this sample that the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;net_mgmt_event_callback&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;cb &amp;#39;info&amp;#39; field should contan the connection attempt status (although there is both &amp;quot;status&amp;#39; and &amp;#39;conn_status&amp;#39; which seems redundant? The sample just uses &amp;#39;status!=0&amp;#39; as being &amp;#39;failure&amp;#39; and doesnt look at conn_status.)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The possible values for &amp;#39;conn_status&amp;#39; seem more useful: I will try using these to detect the failed connection attempt!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;For the continual retries:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;[quote userid="2115" url="~/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current/512815"]&lt;p&gt;My apologies for this inconvenience. We have an open PR to fix this in the v2.6.x-branch:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/18790"&gt;https://github.com/nrfconnect/sdk-nrf/pull/18790&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that this is still in review, and is not yet merged, but feel free to test it to see if this helps plug the memleak.&lt;/p&gt;[/quote]&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I&amp;#39;m not sure I signed up as a beta tester for your wifi products.... I&amp;#39;ll take a look...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;As for the badness when I disconnect before its given up:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;[quote userid="2115" url="~/f/nordic-q-a/116831/nrf5340-nrf7002-connecting-to-wifi-ends-up-in-blocked-state-consuming-60ma-current/512815"]You can use the Wifi ready library (which uses the underlying RPU recovery functionality) to detect if such a problem has occurred.[/quote]
&lt;p&gt;I&amp;#39;ll take a look at the info you reference; although this seems very complex to just get robust long-term wifi operation on the device... Why doesn&amp;#39;t the stack deal with this internally or when I disconnect it?!&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is in general the problem with the samples, they don&amp;#39;t help with creating a &amp;#39;real&amp;#39; application which has to deal with long running operation with connect/disconnect/errors that occur in real-life...&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/512815?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2024 16:21:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b5f59dd-923a-4219-9ea3-56148ed0f1fd</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your log indicates that the device is going into a bad state, where it cannot send umac commands to the nRF7002.&lt;/p&gt;
[quote user="BrianW"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[14:23:55.279,052] &amp;lt;err&amp;gt; wifi_nrf: umac_cmd_alloc: Failed to allocate UMAC cmd&lt;br /&gt;[14:23:55.286,895] &amp;lt;err&amp;gt; wifi_nrf: umac_cmd_cfg: umac_cmd_alloc failed&lt;br /&gt;[14:23:55.294,067] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_wpa_set_supp_port: nrf_wifi_fmac_chg_sta failed&lt;br /&gt;[14:23:56.303,741] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_fmac_scan: Unable to allocate memory&lt;br /&gt;[14:23:56.311,737] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_wpa_supp_scan2: Scan trigger failed&lt;/p&gt;
&lt;p&gt;And the memory:&lt;/p&gt;
&lt;p&gt;[14:24:03.500,335] &amp;lt;inf&amp;gt; app: System Stats: Heap now : free 1580, used 67112, max used 68040.&lt;/p&gt;
&lt;p&gt;Just after boot, free is around 13000, and is stable when the wifi is connected.&lt;/p&gt;[/quote]
&lt;p&gt;This is a typical issue if the heap is not large enough. Can you try to increase the heap via CONFIG_HEAP_MEM_POOL_SIZE to see if this helps?&lt;/p&gt;
[quote user=""]&lt;p&gt;When trying to connect to a wifi AP with incorrect credentials, I have several issues:&lt;/p&gt;
&lt;p&gt;1/ the result of the (failed) connect request always returns 10s later, no matter the value of &amp;#39;timeout&amp;#39; in the&amp;nbsp;wifi_connect_req_params structure passed to the net_mgmt request.&lt;/p&gt;
&lt;p&gt;- shouldn&amp;#39;t it use the timeout value?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Are you using the static configuration? If yes, then it is configured via&amp;nbsp;CONFIG_WIFI_MGMT_EXT_CONNECTION_TIMEOUT.&lt;/p&gt;
[quote user=""]&lt;p&gt;2/ the result, returned as event&amp;nbsp;NET_EVENT_WIFI_CONNECT_RESULT in a net_mgmt callback handler, doesn&amp;#39;t give me a &amp;#39;result&amp;#39; I can use?&lt;/p&gt;
&lt;p&gt;How do I find out that the connection&amp;nbsp; attempt failed? I tried checking the &amp;#39;state&amp;#39; of the connection by doing a&amp;nbsp;NET_REQUEST_WIFI_IFACE_STATUS, but it shows the state as being &amp;#39;WIFI_STATE_ASSOCIATED&amp;#39;, which the wifi demo code uses to indicate the wifi is connected!&lt;/p&gt;
&lt;p&gt;(I can clearly see that the attempt has stopped after 10s because the power consumpion drops back to 5-6mA, instead of around 60mA)&lt;/p&gt;[/quote]
&lt;p&gt;In this state, you will be in the 4-way handshake state until a timer has elapsed. Based on your description, it does sound like the sample in question does not handle this scenario gracefully. Which example are you using here?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;3/ if I do not explicltly disconnect after the failed attempt, the stack continually retries the connection every 30s, and appears to have a memory leak of about 120 bytes at eash attempt... leading eventually to a hang because it exhausts the heap...&lt;/p&gt;
&lt;p&gt;To avoid this, I added a &amp;#39;connect timer&amp;#39; in my code, which does an explicit&amp;nbsp;NET_REQUEST_WIFI_DISCONNECT after X seconds. This stops the automatic retry, and lets my code retry the connect at its own pace....&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;My apologies for this inconvenience. We have an open PR to fix this in the v2.6.x-branch:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/18790"&gt;https://github.com/nrfconnect/sdk-nrf/pull/18790&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that this is still in review, and is not yet merged, but feel free to test it to see if this helps plug the memleak.&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4/ After a few attempts (&amp;lt;10, one every 3 minutes), the wifi stack seems to get in a bad state, and the power consumption sticks at 60mA average! (as though it was still trying to connect to the AP)&lt;/p&gt;
&lt;p&gt;I get this log:&lt;/p&gt;
&lt;p&gt;[00:57:24.123,870] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_wpa_supp_scan_abort: Timedout waiting for scan abort response, ret = -11&lt;/p&gt;
&lt;p&gt;Requesting a disconnect operation is accepted by the wifi stack but has no apparent affect on the power consumption. And it doesn&amp;#39;t then accept a connect attempt with valid credentials after getting in this state. Could this be because I force disconnect when its still trying to connect?&lt;/p&gt;
&lt;p&gt;Any pointers on how to get this to be more robust?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;You can use the Wifi ready library (which uses the underlying RPU recovery functionality) to detect if such a problem has occurred.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a guide on how to enable it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To enable the RPU recovery you need to enable this kconfig: &lt;a title="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/drivers/wifi/nrf700x/nrf700x.html#cmdoption-arg-config_nrf_wifi_rpu_recovery" href="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/drivers/wifi/nrf700x/nrf700x.html#cmdoption-arg-CONFIG_NRF_WIFI_RPU_RECOVERY" rel="noopener noreferrer" target="_blank"&gt;https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/drivers/wifi/nrf700x/nrf700x.html#cmdoption-arg-CONFIG_NRF_WIFI_RPU_RECOVERY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;And implement the Wi-Fi Ready library + handle the events in the application itself: &lt;a title="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/libraries/networking/wifi_ready.html" href="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/libraries/networking/wifi_ready.html" rel="noopener noreferrer" target="_blank"&gt;https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/libraries/networking/wifi_ready.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;An example of such an handling is implemented in the wifi/sta sample: &lt;a title="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/samples/wifi/sta/readme.html#rpu_recovery" href="https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/samples/wifi/sta/README.html#rpu_recovery" rel="noopener noreferrer" target="_blank"&gt;https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrf/samples/wifi/sta/README.html#rpu_recovery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;See the implementations guarded with &amp;quot;CONFIG_WIFI_READY_LIB&amp;quot; here: &lt;a title="https://github.com/nrfconnect/sdk-nrf/blob/v2.5-branch/samples/wifi/sta/src/main.c#l56" href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5-branch/samples/wifi/sta/src/main.c#L56" rel="noopener noreferrer" target="_blank"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.5-branch/samples/wifi/sta/src/main.c#L56&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A reset of the nRF7002 will require that the application re-connects to the network and also handle any previous connections as such.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340/nrf7002 Connecting to wifi : ends up in blocked state consuming 60mA current?</title><link>https://devzone.nordicsemi.com/thread/512676?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2024 08:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17163aa2-ab9f-46c7-ab53-de93cc777a1a</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;When it runs out of memory, the logs:&lt;/p&gt;
&lt;p&gt;[14:23:55.279,052] &amp;lt;err&amp;gt; wifi_nrf: umac_cmd_alloc: Failed to allocate UMAC cmd&lt;br /&gt;[14:23:55.286,895] &amp;lt;err&amp;gt; wifi_nrf: umac_cmd_cfg: umac_cmd_alloc failed&lt;br /&gt;[14:23:55.294,067] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_wpa_set_supp_port: nrf_wifi_fmac_chg_sta failed&lt;br /&gt;[14:23:56.303,741] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_fmac_scan: Unable to allocate memory&lt;br /&gt;[14:23:56.311,737] &amp;lt;err&amp;gt; wifi_nrf: nrf_wifi_wpa_supp_scan2: Scan trigger failed&lt;/p&gt;
&lt;p&gt;And the memory:&lt;/p&gt;
&lt;p&gt;[14:24:03.500,335] &amp;lt;inf&amp;gt; app: System Stats: Heap now : free 1580, used 67112, max used 68040.&lt;/p&gt;
&lt;p&gt;Just after boot, free is around 13000, and is stable when the wifi is connected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>