<?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>Dynamically control nPM1300 Load Switch 1 from firmware</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125266/dynamically-control-npm1300-load-switch-1-from-firmware</link><description>I’m working on a project using the nRF54L15 SoC together with the nPM1300 Power Management IC . In my hardware setup: 
 
 
 BUCK2 output from the nPM1300 is connected to the LSIN1 pin. 
 
 
 The LSOUT1 pin powers an I&amp;#178;C sensor. 
 
 
 The goal is to dynamically</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Oct 2025 18:38:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125266/dynamically-control-npm1300-load-switch-1-from-firmware" /><item><title>RE: Dynamically control nPM1300 Load Switch 1 from firmware</title><link>https://devzone.nordicsemi.com/thread/553061?ContentTypeID=1</link><pubDate>Fri, 31 Oct 2025 18:38:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:341dd324-4cf7-4bca-851d-53e91c54fcc7</guid><dc:creator>gc0rreiab</dc:creator><description>&lt;p&gt;I connected an oscilloscope to the LDSW1 output and found the issue. I had the sensor board already connected to the LDSW1 power output, and the board included a large decoupling capacitor. Because of that, when the sensor board was attached,&amp;nbsp;I didn&amp;rsquo;t realize how slowly the LDSW1 was turning on and off&amp;mdash;it gave the impression of a stable power output, since I was enabling the LDSW1 again quickly enough that the voltage level never had time to drop all the way to 0 V. That&amp;rsquo;s when I realized I needed to enable the active-discharge property on my LD1 regulator:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* Load switches */
npm1300_ek_ldo1: LDO1 {
    status = &amp;quot;okay&amp;quot;;
    regulator-min-microvolt = &amp;lt;1000000&amp;gt;;
    regulator-max-microvolt = &amp;lt;3300000&amp;gt;;
    regulator-initial-mode = &amp;lt;NPM13XX_LDSW_MODE_LDSW&amp;gt;;
    active-discharge;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Once I did that, I started seeing the power turn on/off much faster. Thanks for your help!&lt;/p&gt;
&lt;p&gt;Now I&amp;rsquo;m facing another issue: I have an SHT4x sensor powered by the LDSW1. At boot time, the SHT4x isn&amp;rsquo;t powered yet because it&amp;rsquo;s behind the LDSW1 load switch, which is controlled by the PMIC. During system boot, Zephyr automatically tries to probe the SHT4x as part of its device initialization sequence&amp;mdash;this happens before main(). Since the sensor isn&amp;rsquo;t powered yet, the I&amp;sup2;C transactions fail (no ACK from the SHT4x), causing the init function to return a negative value. As a result, Zephyr marks the device as unready:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;device-&amp;gt;state-&amp;gt;initialized = false;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Later in the application, when calling:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;device_is_ready(sht_dev)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It returns false because the initialization previously failed.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s the recommended way to handle this kind of situation, where a sensor is powered on by the PMIC only after the boot sequence?&lt;/p&gt;
&lt;p data-start="638" data-end="679"&gt;&lt;span style="font-size:inherit;"&gt;I wasn&amp;rsquo;t sure whether it was best to continue discussing this issue in the same ticket, since the problem&amp;mdash;although related to the nPM1300 and Load Switch 1&amp;mdash;is quite different. Therefore, I opened a new &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/125345/i2c-sensor-fails-to-initialize-when-powered-by-npm1300-pmic-load-switch-after-zephyr-boot"&gt;ticket&lt;/a&gt; for it.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically control nPM1300 Load Switch 1 from firmware</title><link>https://devzone.nordicsemi.com/thread/553002?ContentTypeID=1</link><pubDate>Fri, 31 Oct 2025 11:48:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:127c7ac1-c7a8-459c-aac6-00cefde28444</guid><dc:creator>SergeiOv</dc:creator><description>&lt;p&gt;Just tried your code without any modifications (only added `bias-pull-up` to the i2c pins configuration and commented out the sensor code since I don&amp;#39;t have it) on 2.8, and I get the expected behavior again...&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/pastedimage1761911034720v2.png" alt=" " /&gt;&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/pastedimage1761911007425v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If you have a logic analyzer, do you think you could examine the I2C lines during your code execution? You should see the writes as on the screenshot above. You will of course have more due to the sensor communication, but these are responsible for enabling and disabling the LDSW1 respectively.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically control nPM1300 Load Switch 1 from firmware</title><link>https://devzone.nordicsemi.com/thread/552799?ContentTypeID=1</link><pubDate>Wed, 29 Oct 2025 15:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a2704bd-094d-4f67-ad5f-13150944c50d</guid><dc:creator>gc0rreiab</dc:creator><description>&lt;p&gt;Thanks for getting back to me! I&amp;rsquo;m using nRF Connect SDK 2.8 &amp;mdash; both the SDK and toolchain are version 2.8. Could you try to reproduce my setup using NCS 2.8 and see if it works on your end?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamically control nPM1300 Load Switch 1 from firmware</title><link>https://devzone.nordicsemi.com/thread/552758?ContentTypeID=1</link><pubDate>Wed, 29 Oct 2025 12:49:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d71b603e-ee67-4161-89d6-3072b0b32ec8</guid><dc:creator>SergeiOv</dc:creator><description>&lt;p&gt;I don&amp;#39;t see a reason why LDSW wouldn&amp;#39;t disable in your situation.&lt;/p&gt;
&lt;p&gt;What version of NCS/Zephyr is this? I tried your code with latest Zephyr (with minor adjustments due to some API changes) just now, and this behaves as expected. Maybe there was a bug in an earlier version, so I can try whichever version you&amp;#39;re developing with.&lt;/p&gt;
&lt;p&gt;One thing I could think of is the fact that according to Zephyr documentation, the `regulator_enable` function is a &amp;quot;Reference-counted request&amp;quot; (&lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__regulator__interface.html#ga06e3109b9607521fe07686c6d601e460"&gt;https://docs.zephyrproject.org/apidoc/latest/group__regulator__interface.html#ga06e3109b9607521fe07686c6d601e460&lt;/a&gt;). This means that if this function is called twice in a row, in order to disable said regulator one would need to call the disable function twice as well. So, maybe this somehow plays a role here, although I see that you check `regulator_is_enabled` each time before enabling or disabling it, so it shouldn&amp;#39;t really happen...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>