<?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>nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64532/nrf52840-peripheral_uart-low-power-ncs-1-3-0</link><description>Hi, 
 I am working with nrf52840dk and using a peripheral _uart example from NCS v1.3.0. and the problem that I am currently having is that I cannot get it to low power. At the moment I have power consumption ~500nA and I suppose this is from UART and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Nov 2020 14:26:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64532/nrf52840-peripheral_uart-low-power-ncs-1-3-0" /><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/279301?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 14:26:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ebd8218-d9e0-41ac-9983-920b6213242f</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Dear Stian,&lt;br /&gt;&lt;br /&gt;Thanks for your reply, the issue is now solved! While focusing on configuration and UART0 I did not check other peripherals.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Vojislav.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/279199?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 11:03:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff22daa0-ceb2-4a77-84aa-060aeee9264c</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, so you were able to turn on and off UART in NCS 1.2.0 but when using NCS 1.3.0 you still see high current consumption after turning off the UART. I think one change they made in NCS 1.3.0 is that &lt;em&gt;all&lt;/em&gt; UART peripherals are turned on by default. So maybe the current consumption you are seeing is because of UART1 being active (assuming you are using UART0 for NUS and logging).&lt;/p&gt;
&lt;p&gt;Try to add an overlay file (&lt;strong&gt;nrf52840dk_nrf52840.overlay&lt;/strong&gt;) to the project root folder which completely disables the UART1 peripheral:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart1 {
   status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You might have to clean/delete the build folder before recompiling.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/279086?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 16:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c76926f5-9fdd-4897-a13c-6a472898541f</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Vojislav,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for the delay. This case is just reassigned back to me today.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I need time to check with the internal. Sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/278947?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 09:41:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35491669-23a5-4a5b-a55c-6a3c32ccf416</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/heidi"&gt;Heidi&lt;/a&gt; what is the status of this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/276561?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 08:04:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2c789dc-abaf-43b6-9b54-b6331b02f70d</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi! I&amp;#39;m sorry, not yet. I&amp;#39;ll have someone take a look at it today.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/276342?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 07:09:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f98195f6-5295-481b-9534-8eb8389e1988</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/heidi"&gt;Heidi&lt;/a&gt; any news?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/275519?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 08:45:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f47bdc83-824c-49eb-bdd3-e751c4a4f289</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Ok, thanks. Let me know when you have some new information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/275517?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 08:44:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19c6f266-8155-4f5f-b70d-dec9132ae6b1</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Sorry about the delay! Amanda is currently on vacation so I&amp;#39;ll be taking over the case. I will have to talk to some people and get back to you. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/275401?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 13:48:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab23b72b-8567-4a85-a69b-fd688e4afef7</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;ping, have you think of what could be an issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/274056?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 13:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a1d0810-42e1-4e9d-97bc-7569ac94515b</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;br /&gt;&lt;br /&gt;I am back on this issue and still having problems with power consumption. My current&amp;nbsp;setup&amp;nbsp;is nrf52840dk and PPK on top. SB40 is cut and I am measuring current with nRF Connect Power Profiler APP.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My current profile looks like this:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1602250918483v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;As you can see from the picture the average current between advertising packets is ~530uA.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My main file has:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void led_blink_thread(void)
{
	int    blink_status       = 0;
	int    err                = 0;

	LOG_INF(&amp;quot;Starting Nordic UART service example\n&amp;quot;);

	// err = init_uart();
	// if (err) {
	// 	error();
	// }
	
	int rc = STATS_INIT_AND_REG(smp_svr_stats, STATS_SIZE_32,
	    &amp;quot;smp_svr_stats&amp;quot;);

	if (rc &amp;lt; 0) {
		LOG_ERR(&amp;quot;Error initializing stats system [%d]&amp;quot;, rc);
	}

	/* Register the built-in mcumgr command handlers. */
#ifdef CONFIG_MCUMGR_CMD_FS_MGMT
	rc = fs_mount(&amp;amp;littlefs_mnt);
	if (rc &amp;lt; 0) {
		LOG_ERR(&amp;quot;Error mounting littlefs [%d]&amp;quot;, rc);
	}

	fs_mgmt_register_group();
#endif
#ifdef CONFIG_MCUMGR_CMD_OS_MGMT
	os_mgmt_register_group();
#endif
#ifdef CONFIG_MCUMGR_CMD_IMG_MGMT
	img_mgmt_register_group();
#endif
#ifdef CONFIG_MCUMGR_CMD_STAT_MGMT
	stat_mgmt_register_group();
#endif
#ifdef CONFIG_MCUMGR_SMP_BT
	//start_smp_bluetooth();
#endif
#ifdef CONFIG_MCUMGR_SMP_UDP
	start_smp_udp();
#endif


	configure_gpio();

	bt_conn_cb_register(&amp;amp;conn_callbacks);

	if (IS_ENABLED(CONFIG_BT_GATT_NUS_SECURITY_ENABLED)) {
		bt_conn_auth_cb_register(&amp;amp;conn_auth_callbacks);
	}

	err = bt_enable(NULL);
	if (err) {
		error();
	}

	LOG_INF(&amp;quot;Bluetooth initialized\n&amp;quot;);
	k_sem_give(&amp;amp;ble_init_ok);

	if (IS_ENABLED(CONFIG_SETTINGS)) {
		settings_load();
	}

	err = bt_gatt_nus_init(&amp;amp;nus_cb);
	if (err) {
		LOG_ERR(&amp;quot;Failed to initialize UART service (err: %d)\n&amp;quot;, err);
		return;
	}
	
	/* Initialize the Bluetooth mcumgr transport. */
	smp_bt_register();

	err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), sd,
			      ARRAY_SIZE(sd));
	if (err) {
		LOG_ERR(&amp;quot;Advertising failed to start (err %d)\n&amp;quot;, err);
	}

	/* using __TIME__ ensure that a new binary will be built on every
	 * compile which is convient when testing firmware upgrade.
	 */
	LOG_INF(&amp;quot;build time: &amp;quot; __DATE__ &amp;quot; &amp;quot; __TIME__);

	// uart_irq_rx_disable(uart);
	// device_set_power_state(uart, DEVICE_PM_OFF_STATE, NULL, NULL);


	for (;;) {
		dk_set_led(RUN_STATUS_LED, (++blink_status) % 2);
		k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL));
	}
}

void ble_write_thread(void)
{
	/* Don&amp;#39;t go any further until BLE is initailized */
	k_sem_take(&amp;amp;ble_init_ok, K_FOREVER);

	for (;;) {
		/* Wait indefinitely for data to be sent over bluetooth */
		struct uart_data_t *buf = k_fifo_get(&amp;amp;fifo_uart_rx_data,
						     K_FOREVER);

		if (bt_gatt_nus_send(NULL, buf-&amp;gt;data, buf-&amp;gt;len)) {
			LOG_ERR(&amp;quot;Failed to send data over BLE connection\n&amp;quot;);
		}

		k_free(buf);

		if (rx_disabled) {
			rx_disabled = false;
			uart_irq_rx_enable(uart);
		}
	}
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And my prj.conf:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_0_NRF_FLOW_CONTROL=y
CONFIG_SERIAL=n
CONFIG_GPIO=y

# Make sure printk is not printing to the UART console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_HEAP_MEM_POOL_SIZE=2048

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

# Enable the NUS service
CONFIG_BT_GATT_NUS=y

# Enable bonding if one of this four is enabled the application wont build with mcuboot
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Enable mcumgr.
CONFIG_MCUMGR=y

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

# Required by the `taskstat` command.
#CONFIG_THREAD_MONITOR=y

# Enable statistics and statistic names.
CONFIG_STATS=y
CONFIG_STATS_NAMES=y

# Enable most core commands.
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_STAT_MGMT=y

# Enable logging
CONFIG_LOG=n

# Low power
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
CONFIG_SYS_PM_STATE_LOCK=y&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So I think I disabled uart and consumption&amp;nbsp;is still high... Do you have an idea what to do?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/265035?ContentTypeID=1</link><pubDate>Tue, 18 Aug 2020 09:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3c6ff74-595a-4900-8ec7-0ae09b27092e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Vojislav,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for the delay. I was not able to contact that engineer until today.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When using asynchronous UART API, RX has to be disabled before the peripheral is disabled. So if we want to modify that example to turn of UART completely, first call uart_rx_disable, wait for UART_RX_DISABLED event and then turn of peripheral using power management API&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/commit/4d0745b7df3885df5fd005ba1d89883f12383bc0#diff-49065e7b9505e965d6c45b371c82d3b6R146"&gt;https://github.com/nrfconnect/sdk-nrf/commit/4d0745b7df3885df5fd005ba1d89883f12383bc0#diff-49065e7b9505e965d6c45b371c82d3b6R146&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the NCS v1.3&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/master/samples/bluetooth/peripheral_uart"&gt;peripheral_uart&lt;/a&gt;&amp;nbsp;example, UART is reenabled immediately after disabling, for continuous transmission so this line would have to be modified.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/264179?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 08:09:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57b792fc-f80e-4b91-9ba8-3d93b88bd126</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;br /&gt;&lt;br /&gt;Thank you for your feedback. Regarding UART what is your advice, should I switch to UARTE instead of UART?&amp;nbsp;&lt;br /&gt;When you get a response from Zephyr engineer, please let me know.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Vojislav&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/263964?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 08:50:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:726191c8-77e7-40de-8289-93e880fee2e6</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Vojislav,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I got the information from the UART engineer:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We changed it a lot because we want to simplify it a little and we switch from the UART to asynchonous UARTE, and there was a small change in UART driver but it seems like he disabled it.&amp;nbsp;So it might be the Power Manager in Zephyr was modified.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;--&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have to check with Zephyr engineer, but he is out of the office.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Please note that we are in the summer vacation period here in Norway, so it might take a bit longer to get to the bottom of this than expected, as staff during the month of July will be reduced. I&amp;#39;m sorry about the inconvenience, but please be patient. And I&amp;#39;ll get back to you as soon as I hear something from the devs.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/263846?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 13:19:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7a330cc-4db5-44b9-a05f-ac40fde5b46d</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;br /&gt;&lt;br /&gt;Please let me as soon as you know.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Vojislav&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 peripheral_uart low power NCS 1.3.0</title><link>https://devzone.nordicsemi.com/thread/263554?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 08:56:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c0e5eee-6ecf-4261-b5da-682c5f3d13dc</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Vojislav,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am investigating the issue and need more time to answer. The support staff is reduced during the summer holidays, and you may experience delayed answers. &lt;br /&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>