<?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>SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100274/spi-peripheral-power-consumption-much-higher-than-nrf5-sdk</link><description>Hi, We are currently migrating our nrf5 SDK code to NCS 2.2.0 on a custom nrf52833 board (using a .overlay file on the DK). 
 Our power consumption for the same peripheral is ~6.1 uA average, as opposed to our expected ~3.5 uA average on nrf5SDK - but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 04 Jun 2023 07:52:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100274/spi-peripheral-power-consumption-much-higher-than-nrf5-sdk" /><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/429115?ContentTypeID=1</link><pubDate>Sun, 04 Jun 2023 07:52:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19716702-eda5-4797-b166-9bd758a4bb34</guid><dc:creator>S_C</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;we are not setting the SPI to high we just using spi_transceive with the device that configure to spi1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428669?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2023 09:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:119a3b40-9dc9-4c5e-8992-aacca1cdac13</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I suggest connect a logic analyzer to find what has changed: look at level of csn pins and spi pins.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428622?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2023 07:43:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d23f409-af00-4a24-a137-cb5e8306cee7</guid><dc:creator>S_C</dc:creator><description>&lt;p&gt;No, I just control spi1 , spi0 configure in the overlay as you can see in the overlay file above.&lt;/p&gt;
&lt;p&gt;I control spi1 using&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;peripherals_1.c file
const struct device *peripherals_1 =  DEVICE_DT_GET(DT_NODELABEL(spi1));

peripherals_2.c file
const struct device *peripherals_2 =  DEVICE_DT_GET(DT_NODELABEL(spi1));

main.c

get_peripherals_1_device....
get_peripherals_2_devie....&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428615?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2023 07:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb64f54-8518-46e8-8a7a-b71e30945dd5</guid><dc:creator>Kenneth</dc:creator><description>[quote user="S_C"]Our only question is that we cannot remove the unused spi0 (by disabling in overlay) or remove it&amp;#39;s pinctrl without harming the &amp;quot;spi0&amp;quot; peripheral functionality, even though it is now pointing to spi1. Do you happen to know why this is?[/quote]
&lt;p&gt;Are you controlling both csn pins (e.g. set them high at startup)?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428529?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 15:12:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e7e4543-df74-4b31-b3fe-894e7f73c2a5</guid><dc:creator>S_C</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;br /&gt;We were able to use your suggestion on spi1 without having to turn off the CS pins manually - which enabled us to use the correct mode (CPOL | CPHA) on the second SPI peripheral which we were unable to do before. Thanks!&lt;/p&gt;
&lt;p&gt;Our only question is that we cannot remove the unused spi0 (by disabling in overlay) or remove it&amp;#39;s pinctrl without harming the &amp;quot;spi0&amp;quot; peripheral functionality, even though it is now pointing to spi1. Do you happen to know why this is?&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Shahar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428484?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 13:19:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb4ce259-7101-4524-8ca9-76b9a277bf9d</guid><dc:creator>Kenneth</dc:creator><description>[quote user="S_C"]from my understanding there is no problem to share the SPI pins except&amp;nbsp;&lt;span&gt;Chip/Slave Select&lt;br /&gt;&lt;/span&gt;if&amp;nbsp;you manage to not use both of them at the same time.&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;True, but from your code it looks like you are using both spi0 and spi1, and they use the pins? This will be problematic, since you are using two hardware peripherals with the same pins.&lt;/p&gt;
&lt;p&gt;If you only have different spi chip select pin, then why not just do something like:&lt;/p&gt;
&lt;p&gt;csn_1 = 0;&lt;br /&gt;spi_transceive(spi0,...)&lt;br /&gt;csn_1= 1;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;csn_2 = 0;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;spi_transceive(spi0,...)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;csn_2= 1;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428472?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 12:53:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdf6a669-8c5f-4a13-93f0-52a8e160dc60</guid><dc:creator>S_C</dc:creator><description>&lt;p&gt;Hi ,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;from my understanding there is no problem to share the SPI pins except&amp;nbsp;&lt;span&gt;Chip/Slave Select&lt;br /&gt;&lt;/span&gt;if&amp;nbsp;you manage to not use both of them at the same time.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After I use&amp;nbsp;&lt;span&gt;CONFIG_PM_DEVICE=y, both of&amp;nbsp;my&amp;nbsp;peripherals&amp;nbsp;are not working and the RTT is not working as well, there is an example with similar case in zephyr?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Peripheral Power Consumption much higher than nrf5 SDK</title><link>https://devzone.nordicsemi.com/thread/428440?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 11:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c255fdd9-e7f6-485b-923b-b0a1d41665e6</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not entirely sure I understand how you solved this in the old nRF5 SDK&amp;nbsp;and how you are planning to do this on the new nRF Connect SDK, and what the problem may be. Dynamic switching / sharing of pins is not straight forward, you need to ensure that two peripherals trying to use the same pin(s) are not enabled at the same time at any given time. In your case you might also want to measure the pins in question using a logic analyzer to ensure that the pin level and mode is the same between old and new SDK.&lt;/p&gt;
&lt;p&gt;Today it can be possible to use the device power management to achieve pin sharing. If you use CONFIG_PM_DEVICE=y, then you have the option to call for instance pm_device_action_run(peripheral_dev, PM_DEVICE_ACTION_RESUME); and pm_device_action_run(peripheral_dev, PM_DEVICE_ACTION_SUSPEND); to control which configuration is used. It should be possible to switch between usage that way, as long as only one peripheral_dev is active (&amp;quot;RESUME&amp;quot;) at any given time.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>