<?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>nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122509/nrf5340-spi-power-consumption</link><description>I am using the nrf5340 on a nrf7002fk dev kit. I am interested in low power operation so I am measuring the power consumed. 
 I am running a simple app: 
 int main(void) { while(1) { k_msleep(1000); } 
 return 0; } 
 when I compile with this simple prj</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Jul 2025 20:08:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122509/nrf5340-spi-power-consumption" /><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/542808?ContentTypeID=1</link><pubDate>Thu, 17 Jul 2025 20:08:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c318586-e9e8-42f4-9f7c-2991d6890238</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Glad to hear that it resolved your issue and thank you for sharing the solution here.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/542800?ContentTypeID=1</link><pubDate>Thu, 17 Jul 2025 17:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:624f1864-688b-48d1-b04e-5ac32e00e6c8</guid><dc:creator>th8d</dc:creator><description>&lt;p&gt;The pin that is drawing the current is p0.0b which is the chip select line for the mx25r64 external flash on the nrf7002dk board. Configuring this pin as an input is useful for tracking down the problem. However it is problematic for a long term solution. Is there a way to configure zephyr to put this pin into low power mode using the existing drivers ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/542795?ContentTypeID=1</link><pubDate>Thu, 17 Jul 2025 15:48:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8aa9f05-ee4b-4530-942c-eef6d972cf25</guid><dc:creator>th8d</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;&lt;span&gt;Abhijith that was a useful suggestion.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;configuring the gpio0 pin11 (chip select for mx25r64) as an input reduced the current down to 3 uA. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;this was achieved with this overlay:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/{&lt;br /&gt; inputs {&lt;br /&gt; compatible = &amp;quot;gpio-keys&amp;quot;;&lt;br /&gt; mx_cs: mx_cs {&lt;br /&gt; gpios = &amp;lt;&amp;amp;gpio0 11 (GPIO_ACTIVE_LOW)&amp;gt;;&lt;br /&gt; label = &amp;quot;mx cs&amp;quot;;&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;};&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and this code:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;static const struct gpio_dt_spec mx_cs = GPIO_DT_SPEC_GET(DT_NODELABEL(mx_cs), gpios);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;gpio_pin_configure_dt(&amp;amp;mx_cs, GPIO_INPUT);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;changing the sck, mosi or miso pins did not make any difference to the current&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/542784?ContentTypeID=1</link><pubDate>Thu, 17 Jul 2025 14:09:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd2b8d97-f0e5-478f-80e8-4961b2e56fde</guid><dc:creator>th8d</dc:creator><description>&lt;p&gt;can you provide an example of configuring a GPIO pin to low-power state&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/542776?ContentTypeID=1</link><pubDate>Thu, 17 Jul 2025 13:39:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a15caf56-357b-483a-998a-ea4b73af433f</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you check if its associated with GPIO pins&amp;nbsp; (SCK, MOSI, MISO, CS) remaining in an active state though you have suspended the SPI. Try reconfiguring these GPIOs to low-power states to confirm if they are the sources of the excess current you are seeing.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/542491?ContentTypeID=1</link><pubDate>Tue, 15 Jul 2025 09:17:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:324e7032-9716-4596-81bb-299f5ade5476</guid><dc:creator>th8d</dc:creator><description>&lt;p&gt;Hi Menon&lt;/p&gt;
&lt;p&gt;Thankyou for your response.&lt;/p&gt;
&lt;p&gt;The academy link you provided uses driver level code. If possible, I would like to resolve the problem using my simple application level example before I move into drivers.&lt;/p&gt;
&lt;p&gt;I updated my code to create a pointer to the SPI device and then called&amp;nbsp;&lt;span&gt;pm_device_action_run() with&amp;nbsp;PM_DEVICE_ACTION_SUSPEND. I expected this to suspend the SPI device.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;I confirmed that the spim_suspend function was getting called inside the spi_nrfx_spim.c driver.&amp;nbsp;However the current remained at 130 uA.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am not sure why the current is at 130 uA if the spi is suspended. Is there a step I am missing ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the updated code and prj.conf files:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;static const struct device* const SpiDev = DEVICE_DT_GET(DT_NODELABEL(spi4));&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;pm_device_action_run(SpiDev, PM_DEVICE_ACTION_SUSPEND);&lt;br /&gt; while(1) {&amp;nbsp;k_msleep(1000);&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;return 0;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;CONFIG_SERIAL=n&lt;br /&gt;CONFIG_SPI=y&lt;/p&gt;
&lt;p&gt;CONFIG_PM=y&lt;br /&gt;CONFIG_PM_DEVICE=y&lt;br /&gt;CONFIG_PM_DEVICE_RUNTIME=y&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 spi power consumption</title><link>https://devzone.nordicsemi.com/thread/540736?ContentTypeID=1</link><pubDate>Fri, 27 Jun 2025 14:05:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e057b7dc-1df9-465c-a53b-407bf18c4453</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, this could be because the peripheral remains active. I recommend suspending the SPI device when it&amp;#39;s not needed. See the&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-7-device-driver-dev/topic/device-power-management-2/"&gt; Device Power Management section&lt;/a&gt; from the Academy.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>