<?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>7002 power consumption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112160/7002-power-consumption</link><description>I&amp;#39;m using custom board of nrf5340 with nrf7002. 
 Use helloworld sample and have set &amp;quot;config serial=n&amp;quot; and &amp;quot;config device pm =y&amp;quot;. 
 The current is 90 ma when I don&amp;#39;t do anything in the code, so I must initialize wifi interface to let the current be much</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Jun 2024 10:39:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112160/7002-power-consumption" /><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/491286?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2024 10:39:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8567330d-cdc5-49e6-a9a0-a2aefd97e7a0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="allenyang"]I can upload the schematic once you can identify the issues.[/quote]
&lt;p&gt;Have you done Schematic and Gerber&amp;nbsp; review before?&lt;/p&gt;
&lt;p&gt;If not, please create a new, private ticket and ask for this.&lt;br /&gt;Refer to this ticket in the new ticket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/491272?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2024 09:40:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bf382fe-baf0-4a88-aa5a-0febc5120a96</guid><dc:creator>allenyang</dc:creator><description>&lt;p&gt;I&amp;#39;m using nrf5340(host ic) and nrf7002(wifi ic), but it&amp;#39;s custom board designed by our hardware engineer. I&amp;#39;m wondering there are some&amp;nbsp;problems causing the high current.&lt;/p&gt;
&lt;p&gt;I can upload the schematic once you can identify the issues.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Allen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/491267?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2024 09:16:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f2fa97a-59f5-4292-8acf-17371c8084a5</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="allenyang"]Hi, the api which I use&amp;nbsp;to shutdown 7002 is&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/shutdown/README.html"&gt;Wi-Fi shut down sample&lt;/a&gt;, so I had tried this sample, and the current is reduced from 90 ma to 1ma.&amp;nbsp;[/quote]
&lt;p&gt;Which board did ou try this on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/491220?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2024 07:01:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f0795f8-a0d8-494a-971b-f2289528a643</guid><dc:creator>allenyang</dc:creator><description>&lt;p&gt;Hi, the api which I use&amp;nbsp;to shutdown 7002 is&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/shutdown/README.html"&gt;Wi-Fi shut down sample&lt;/a&gt;, so I had tried this sample, and the current is reduced from 90 ma to 1ma.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m wondering it&amp;#39;s our hardware problems.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Allen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/489975?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 13:12:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:306d69b8-c126-46aa-b2ff-7bacce3f83a6</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Can you test our &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/shutdown/README.html"&gt;Wi-Fi shut down sample&lt;/a&gt; and see if that shows expected current consumption?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/489441?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2024 09:00:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42b60a16-d0fc-421e-8f3b-3424232d5f24</guid><dc:creator>allenyang</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;ve disable serial in both cores(include mcuboot, hcirpmsg, b0n), and it&amp;#39;s 1ma for shutdown 7002(wifi interface down).This project enable bluetooth, so it has network core image.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/S_5F005F00_250601475.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;////wifi////
static void handle_wifi_scan_result(struct net_mgmt_event_callback *cb)
{
	const struct wifi_scan_result *entry =
		(const struct wifi_scan_result *)cb-&amp;gt;info;
	uint8_t mac_string_buf[sizeof(&amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;)];

	scan_result++;

	if (scan_result == 1U)
	{
		printk(&amp;quot;%-4s | %-32s %-5s | %-4s | %-4s | %-5s | %s\n&amp;quot;,
			   &amp;quot;Num&amp;quot;, &amp;quot;SSID&amp;quot;, &amp;quot;(len)&amp;quot;, &amp;quot;Chan&amp;quot;, &amp;quot;RSSI&amp;quot;, &amp;quot;Security&amp;quot;, &amp;quot;BSSID&amp;quot;);
	}

	printk(&amp;quot;%-4d | %-32s %-5u | %-4u | %-4d | %-5s | %s\n&amp;quot;,
		   scan_result, entry-&amp;gt;ssid, entry-&amp;gt;ssid_length,
		   entry-&amp;gt;channel, entry-&amp;gt;rssi,
		   (entry-&amp;gt;security == WIFI_SECURITY_TYPE_PSK ? &amp;quot;WPA/WPA2&amp;quot; : &amp;quot;Open    &amp;quot;),
		   ((entry-&amp;gt;mac_length) ? net_sprint_ll_addr_buf(entry-&amp;gt;mac, WIFI_MAC_ADDR_LEN, mac_string_buf,
														 sizeof(mac_string_buf))
								: &amp;quot;&amp;quot;));
}

static void handle_wifi_scan_done(struct net_mgmt_event_callback *cb)
{
	const struct wifi_status *status =
		(const struct wifi_status *)cb-&amp;gt;info;

	if (status-&amp;gt;status)
	{
		LOG_ERR(&amp;quot;Scan request failed (%d)&amp;quot;, status-&amp;gt;status);
	}
	else
	{
		LOG_INF(&amp;quot;Scan request done\n&amp;quot;);
	}

	scan_result = 0U;
	k_sem_give(&amp;amp;scan_sem);
}

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_SCAN_RESULT:
		handle_wifi_scan_result(cb);
		break;
	case NET_EVENT_WIFI_SCAN_DONE:
		handle_wifi_scan_done(cb);
		break;
	default:
		break;
	}
}

static int wifi_scan(void)
{
	struct net_if *iface = net_if_get_default();

	if (net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0))
	{
		LOG_ERR(&amp;quot;Scan request failed&amp;quot;);

		return -ENOEXEC;
	}

	LOG_INF(&amp;quot;Scan requested\n&amp;quot;);

	k_sem_take(&amp;amp;scan_sem, K_MSEC(SCAN_TIMEOUT_MS));

	return 0;
}

static bool is_mac_addr_set(struct net_if *iface)
{
	struct net_linkaddr *linkaddr = net_if_get_link_addr(iface);
	struct net_eth_addr wifi_addr;

	if (!linkaddr || linkaddr-&amp;gt;len != WIFI_MAC_ADDR_LEN)
	{
		return false;
	}

	memcpy(wifi_addr.addr, linkaddr-&amp;gt;addr, WIFI_MAC_ADDR_LEN);

	return net_eth_is_addr_valid(&amp;amp;wifi_addr);
}

// static void button_handler_cb(uint32_t button_state, uint32_t has_changed)
// {
//         if ((has_changed &amp;amp; DK_BTN1_MSK) &amp;amp;&amp;amp; (button_state &amp;amp; DK_BTN1_MSK))
//         {
//                 exit_shutdown_mode();
//         }
//         else if ((has_changed &amp;amp; DK_BTN2_MSK) &amp;amp;&amp;amp; (button_state &amp;amp; DK_BTN2_MSK))
//         {
//                 enter_shutdown_mode();
//         }
// }

// static void buttons_init(void)
// {
//         int err;

//         err = dk_buttons_init(button_handler_cb);
//         if (err)
//         {
//                 LOG_ERR(&amp;quot;Buttons initialization failed.\n&amp;quot;);
//                 return;
//         }
// }

int shutdown_wifi(struct net_if *iface)
{
	int ret;

	if (!net_if_is_admin_up(iface))
	{
		return 0;
	}

	ret = net_if_down(iface);
	if (ret)
	{
		LOG_ERR(&amp;quot;Cannot bring down iface (%d)&amp;quot;, ret);
		return ret;
	}

	LOG_INF(&amp;quot;Interface down&amp;quot;);

	return 0;
}

int startup_wifi(struct net_if *iface)
{
	int ret;

	if (!net_if_is_admin_up(iface))
	{
		ret = net_if_up(iface);
		if (ret)
		{
			LOG_ERR(&amp;quot;Cannot bring up iface (%d)&amp;quot;, ret);
			return ret;
		}

		LOG_INF(&amp;quot;Interface up&amp;quot;);
	}

	wifi_scan();

	return 0;
}

void enter_shutdown_mode(void)
{
	struct net_if *iface = net_if_get_default();

	shutdown_wifi(iface);
}

void exit_shutdown_mode(void)
{
	struct net_if *iface = net_if_get_default();

	startup_wifi(iface);
}
void wifi_init_and_shutdown(void)
{
	scan_result = 0U;

	net_mgmt_init_event_callback(&amp;amp;wifi_shell_mgmt_cb,
								 wifi_mgmt_event_handler,
								 WIFI_SHELL_MGMT_EVENTS);

	net_mgmt_add_event_callback(&amp;amp;wifi_shell_mgmt_cb);

	printk(&amp;quot;Starting %s with CPU frequency: %d MHz\n&amp;quot;, CONFIG_BOARD, SystemCoreClock / MHZ(1));

	if (!is_mac_addr_set(net_if_get_default()))
	{
		struct net_if *iface = net_if_get_default();
		int ret;
		struct ethernet_req_params params;

		if (net_if_is_up(iface))
		{
			/* Set a local MAC address with Nordic OUI */
			ret = net_if_down(iface);
			if (ret)
			{
				printk(&amp;quot;Cannot bring down iface (%d)\n&amp;quot;, ret);
				return ret;
			}
		}

		ret = net_bytes_from_str(params.mac_address.addr, sizeof(CONFIG_WIFI_MAC_ADDRESS), CONFIG_WIFI_MAC_ADDRESS);
		if (ret)
		{
			printk(&amp;quot;Failed to parse MAC address: %s (%d)\n&amp;quot;,
				   CONFIG_WIFI_MAC_ADDRESS, ret);
			return ret;
		}

		net_mgmt(NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, iface,
				 &amp;amp;params, sizeof(params));
		// net_mgmt(NET_REQUEST_WIFI_PS, iface, &amp;amp;params, sizeof(params)); // test
		ret = net_if_up(iface);
		if (ret)
		{
			printk(&amp;quot;Cannot bring up iface (%d)\n&amp;quot;, ret);
			return ret;
		}

		LOG_INF(&amp;quot;OTP not programmed, proceeding with local MAC: %s\n&amp;quot;, net_sprint_ll_addr(
																		   net_if_get_link_addr(iface)-&amp;gt;addr,
																		   net_if_get_link_addr(iface)-&amp;gt;len));
	}

	// buttons_init();

	// exit_shutdown_mode();

	enter_shutdown_mode();
}
////wifi////
// const struct device *uart_dev = DEVICE_DT_GET(DT_NODELABEL(nrf7002));

int main(void)
{
	wifi_init_and_shutdown();
	NRF_POWER-&amp;gt;TASKS_LOWPWR = 1;
	power_down_unused_ram();
	while (1)
	{
		/* code */
		// k_msleep(1000);
		k_cpu_idle();
	}

	return 0;
}	&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also have tried another project which only print helloworld and shutdown 7002, and it only has app core image, don&amp;#39;t have bootloader and network core image, it&amp;#39;s 1 ma.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/S_5F005F00_250601476.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;And also I tried the project which only print helloworld with disconnecting the iovdd line on the nrf7002 ic, it&amp;#39;s 0.36ma&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
LOG_MODULE_REGISTER(ctrl, LOG_LEVEL_INF);
struct gpio_dt_spec PWR_UP = GPIO_DT_SPEC_GET(DT_NODELABEL(pwrup), gpios);

int main(void)
{
	printk(&amp;quot;Starting %s with CPU frequency:% d MHz\n&amp;quot;, CONFIG_BOARD, SystemCoreClock / MHZ(1));
	gpio_pin_configure_dt(&amp;amp;PWR_UP, GPIO_OUTPUT);
	gpio_pin_set_dt(&amp;amp;PWR_UP, 1);
	printf(&amp;quot;Hello World! %s\n&amp;quot;, CONFIG_BOARD);
	// NRF_POWER-&amp;gt;TASKS_LOWPWR = 1;
	// power_down_unused_ram();
	while (1)
	{
		/* code */
		// k_msleep(1000);
		k_cpu_idle();
	}
	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I don&amp;#39;t know what is the normal current consumption, can it be 2 micro Amp according to the article says?Or it means only 7002 ic, not include the current of nrf5340?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/S_5F005F00_250617858.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Allen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 7002 power consumption</title><link>https://devzone.nordicsemi.com/thread/489184?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2024 06:43:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab08941a-b332-47b7-95ca-a2192431deb1</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Since the nRF5340, you need to disable serial on both cores. What do you run on the network core?&lt;/p&gt;
&lt;p&gt;The same would be true for other child images as well. Do you run a bootloader?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>