<?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>nRF52810 Power Saving Example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97987/nrf52810-power-saving-example</link><description>Hi, 
 
 I&amp;#39;m developing a software based on peripheral UART example (NUS service) and would like to know the best way to save power(switching to sleep mode). 
 Please let me know if there is a good example of power saving in IDLE mode on nRFConnect SDK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Mar 2023 04:22:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97987/nrf52810-power-saving-example" /><item><title>RE: nRF52810 Power Saving Example</title><link>https://devzone.nordicsemi.com/thread/417553?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2023 04:22:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce7d7fef-f043-4859-80c5-0d6cf614587e</guid><dc:creator>choseuna@hotmail.com</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the response.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There are a couple of reasons of high current consumption in my case, unlike other use case scenario,&lt;/p&gt;
&lt;p&gt;the chip advertises always and the power should be minimized in that mode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Firstly, calling uart_rx_enable() in uart_init() and uart_rx_enable() always consumes around 2mA.&lt;/p&gt;
&lt;p&gt;Secondly, maintaining a JTAG interface used about 15 uA.&lt;/p&gt;
&lt;p&gt;Lastly, GPIO Edge triggered interrupt consumes around 10 uA.&lt;/p&gt;
&lt;p&gt;At the moment, I&amp;#39;m getting about 25 uA on average for advertising every 3 seconds.&lt;/p&gt;
&lt;p&gt;Thank you for your support.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kevin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 Power Saving Example</title><link>https://devzone.nordicsemi.com/thread/417289?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2023 06:16:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe4c47d8-51a4-4ff6-9651-71be9e185f59</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It depends on your advertising interval, Kevin.&lt;/p&gt;
&lt;p&gt;The whole point is to keep the RADIO and CPU activity to as low as possible. And if you have configured your peripherals right, then in idle time, the HFCLK should be turned off. That is the key to save power as this voltage regulator supplying power to hfclk can be in power save mode during RADIO/CPU/Peripheral idle time.&lt;/p&gt;
&lt;p&gt;Did you check with the &lt;a href="https://devzone.nordicsemi.com/power/w/opp/2/online-power-profiler-for-bluetooth-le"&gt;online power profiler&lt;/a&gt;&amp;nbsp;with the advertising interval settings and configuring all other settings matching yours to see how much&amp;nbsp; average current to expect? If it is more than what you see, then we can try to debug getting your setup (not just proj.conf)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 Power Saving Example</title><link>https://devzone.nordicsemi.com/thread/417285?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2023 05:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2779f2f9-52ed-4b81-aa2a-2be043662c05</guid><dc:creator>choseuna@hotmail.com</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the response.&lt;/p&gt;
&lt;p&gt;I need your advice in optimizing power consumption of nRF52810 chip.&lt;/p&gt;
&lt;p&gt;I looked at the system_off sample, however I&amp;#39;m not able to apply the example since the chip(nRF52810) should turn on Bluetooth radio and advertise always in any circumstances.&lt;/p&gt;
&lt;p&gt;So I modified my code to turn off UART(&lt;span&gt;pm_device_action_run())&lt;/span&gt; when a bluetooth connection is closed and turn it on when a user is connected to the chip.&lt;/p&gt;
&lt;p&gt;However, the chip consumes around 2 mA (used FLUKE multimeter) when advertising is going on.&lt;/p&gt;
&lt;p&gt;Is there a way to minimize the power consumption ?&lt;/p&gt;
&lt;p&gt;For example, by changing prj.conf ? (Following prj.conf is from my project.)&lt;/p&gt;
&lt;p&gt;or changing nRF52810 micro chip&amp;#39;s clock rate dynamically ?&lt;/p&gt;
&lt;p&gt;Any suggestion would be much appreciated.&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kevin&lt;/p&gt;
&lt;p&gt;So I&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2021 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
CONFIG_SERIAL=y

CONFIG_HEAP_MEM_POOL_SIZE=1024

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1
CONFIG_BT_NUS_UART_BUFFER_SIZE=120

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
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=n

# Drivers and peripherals
CONFIG_I2C=n
CONFIG_WATCHDOG=y
CONFIG_PINMUX=n
CONFIG_SPI=n
CONFIG_GPIO=y

# Power management
CONFIG_PM=y
CONFIG_PM_DEVICE=y

# Interrupts
CONFIG_DYNAMIC_INTERRUPTS=n
CONFIG_IRQ_OFFLOAD=n

# Memory protection
CONFIG_THREAD_STACK_INFO=n
CONFIG_THREAD_CUSTOM_DATA=n
CONFIG_FPU=n

# Boot
CONFIG_BOOT_BANNER=n
CONFIG_BOOT_DELAY=0

# Console
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_STDOUT_CONSOLE=n
CONFIG_PRINTK=n
CONFIG_EARLY_CONSOLE=n

# Build
CONFIG_SIZE_OPTIMIZATIONS=y

# ARM
CONFIG_ARM_MPU=n

# In order to correctly tune the stack sizes for the threads the following
# Configurations can enabled to print the current use:
#CONFIG_THREAD_NAME=y
#CONFIG_THREAD_ANALYZER=y
#CONFIG_THREAD_ANALYZER_AUTO=y
#CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
#CONFIG_THREAD_ANALYZER_USE_PRINTK=y
#CONFIG_CONSOLE=y
#CONFIG_UART_CONSOLE=y
#CONFIG_SERIAL=y
#CONFIG_PRINTK=y

# Example output of thread analyzer
#SDC RX              : unused 800 usage 224 / 1024 (21 %)
#BT ECC              : unused 216 usage 888 / 1104 (80 %)
#BT RX               : unused 1736 usage 464 / 2200 (21 %)
#BT TX               : unused 1008 usage 528 / 1536 (34 %)
#ble_write_thread_id : unused 688 usage 336 / 1024 (32 %)
#sysworkq            : unused 1912 usage 136 / 2048 (6 %)
#MPSL signal         : unused 928 usage 96 / 1024 (9 %)
#idle 00             : unused 224 usage 96 / 320 (30 %)
#main                : unused 568 usage 456 / 1024 (44 %)
CONFIG_BT_RX_STACK_SIZE=1024
CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
CONFIG_BT_HCI_TX_STACK_SIZE=640
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_MPSL_WORK_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=128
CONFIG_ISR_STACK_SIZE=1024
CONFIG_BT_NUS_THREAD_STACK_SIZE=1024

# Disable features not needed
CONFIG_TIMESLICING=n
CONFIG_MINIMAL_LIBC_MALLOC=n
CONFIG_LOG=n
CONFIG_ASSERT=n

# Disable Bluetooth features not needed
CONFIG_BT_DEBUG_NONE=y
CONFIG_BT_ASSERT=n
CONFIG_BT_DATA_LEN_UPDATE=n
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_GATT_CACHING=n
CONFIG_BT_GATT_SERVICE_CHANGED=n
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y
CONFIG_BT_HCI_VS_EXT=n

# Disable Bluetooth controller features not needed
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_BT_CTLR_PHY_2M=n

# Reduce Bluetooth buffers
CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT=1
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=43
CONFIG_BT_BUF_EVT_RX_COUNT=2

CONFIG_BT_CONN_TX_MAX=2
CONFIG_BT_L2CAP_TX_BUF_COUNT=2
CONFIG_BT_CTLR_RX_BUFFERS=1
CONFIG_BT_BUF_ACL_TX_COUNT=3
CONFIG_BT_BUF_ACL_TX_SIZE=27

# No external Low Frequency Clock(32 KHz) on PCA2215 (nRF52810)
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

# MPSL requires RC clock calibration to be enabled when the RC clock is used as the Low Frequency clock source.
# DRGN-15979: CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION must be set when CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC is set
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/known_issues.html?v=v2-3-0#bluetooth-le
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 Power Saving Example</title><link>https://devzone.nordicsemi.com/thread/416959?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2023 05:38:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5c8723b-6e8c-47f1-aa59-8ffc61cc8208</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;All the Zephyr samples go to IDLE state when there no other thread to run and hence should consume less power in this IDLE state. Peruipheral UART is also one of those examples, which when not connected uses only IDLE current.&lt;/p&gt;
[quote user=""]Actually, I already tried following options in prj.conf, however, nRF52810 consumes around 3~4 mA in peripheral mode(adversement enabled.).[/quote]
&lt;p&gt;When are you measuring the average current? Is it while the device is in connection state? If so, This can be understandable based on your connection interval, the RADIO and CPU keep the HFCLK active for big pecentage of time spiking up the average power consumption.&lt;/p&gt;
&lt;p&gt;When using PM, make sure that you also use PM API to make device go to suspend modes as demonstrated in&amp;nbsp;\v2.2.0\zephyr\samples\boards\nrf\&lt;a href="https://docs.zephyrproject.org/3.1.0/samples/boards/nrf/system_off/README.html"&gt;system_off sample&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>