<?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>power consumption of I2C and bootloader?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107209/power-consumption-of-i2c-and-bootloader</link><description>Hello, 
 Im trying to get my system on idle current as low as possible on my nRF52840. 
 I am testing this with a program with just k_sleep() in the main function, nothing else. 
 I noticed that when I add CONFIG_I2C=y, the idle current rises by about</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Jan 2024 14:19:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107209/power-consumption-of-i2c-and-bootloader" /><item><title>RE: power consumption of I2C and bootloader?</title><link>https://devzone.nordicsemi.com/thread/463577?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 14:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16ff82e3-a59c-4d69-bdfa-1fdbe1ecac82</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello Jonas,&lt;/p&gt;
[quote user="jonas.woerner"] am wondering, why do you have 2-3mA of current while sleeping? [/quote]
&lt;p&gt;I had the infinite empty for loop still there. Can you check with and without the loop?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="jonas.woerner"]Do you know if its possible to deactivate the I2C peripheral at runtime?[/quote]
&lt;p&gt;I think you can use zephyr power management api given that the device driver supports it. Please have a look at zephyr samples like:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/doc/services/pm/system.rst#:~:text=Some%20handful%20examples%20using%20different%20power%20management%20features%3A"&gt;Zephyr Power Management&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This ticket also discusses the same regarding the use of PM API:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72145/dynamically-disable-i2c"&gt;Dynamically-Disable-i2c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: power consumption of I2C and bootloader?</title><link>https://devzone.nordicsemi.com/thread/463466?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 08:34:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:807b28d4-e2b0-40cd-b328-dbb3201ac36d</guid><dc:creator>jonas.woerner</dc:creator><description>&lt;p&gt;Hello Naeem,&lt;/p&gt;
&lt;p&gt;thanks for your detailed reply!&lt;/p&gt;
&lt;p&gt;I am wondering, why do you have 2-3mA of current while sleeping? is that because its the nRF52832 instead of 40? I only get &amp;lt;10uA even with I2C on.&lt;/p&gt;
&lt;p&gt;But your tests are Interesting nontheless! Do you know if its possible to deactivate the I2C peripheral at runtime? I am using it, but it would be nice to be able to disable it while sleeping.&lt;/p&gt;
&lt;p&gt;EDIT: I just tried this using the runtime_pm API, but nothing has changed. I am using the lm75 sensor driver and saw that in the driver, the runtime_pm functions are basically no-ops. I then tried to put I2C directly to sleep with pm_device_runtime_put, but that did nothing. Im guessing because the usage count is still &amp;gt;0 because of the sensor? how can I get this to work?&lt;/p&gt;
&lt;p&gt;Regarding MCUboot, I know that the bootloader enables its own peripherals, but shouldnt it also disable them when starting the main application? The way it is now, we cant use the bootloader because of this high current consumption..&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Jonas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: power consumption of I2C and bootloader?</title><link>https://devzone.nordicsemi.com/thread/463367?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2024 13:56:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c09836b-f8d0-4bdb-8d4d-6271e4f4cc89</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am using NCS 2.4.2, NRF52DK (nrf52832 SoC)&lt;/p&gt;
&lt;p&gt;Using the system off demo&lt;/p&gt;
&lt;p&gt;As per your case, removing everything but the k_sleep and the empty loop:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With CONFIG_I2C=y in the prj.conf and measuring using PPK2.&lt;/p&gt;
&lt;p&gt;The average current is 3.23mA&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1704805816642v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Without CONFIG_I2C, the average current is 2.96mA&lt;/p&gt;
&lt;p&gt;The difference of using I2C Config is +270uA average current.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now, because when the CONFIG_I2C is not used, still the I2c0 is enabled. So, here I disabled I2c0 using the overlay as well, and measured for the peripheral and config enabled and disabled:&lt;/p&gt;
&lt;p&gt;(Average current in mA measured using PPK2)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1704807575187v6.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If you want to use the I2c, then both the config and peripheral should be enabled.&lt;/p&gt;
&lt;p&gt;If you plan not to use the i2c, then both should be disabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding the&amp;nbsp;&lt;span&gt;CONFIG_BOOTLOADER_MCUBOOT, I believe it would have different dependencies and bootloader would have its own configs that would enable different peripherals or parts. For example, it selects &amp;quot;USE_DT_CODE_PARTITION&amp;quot;, which would depend on the FLASH.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You may compile the project with and without this config and check the resultant configuration in the ./zephyr/.config.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;/BR, Naeem&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>