<?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>How to enter System ON sleep in zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65959/how-to-enter-system-on-sleep-in-zephyr</link><description>Hi, I wanna enter the system on sleep to save the power up to 10uA(about tens of A). I am using nrf52840-dk with SPI LCD and some GPIOs in zephyr. Also I want to do DEVICE_POWER_MANAGEMENT. I can turn off the power of LCD when calls device_set_power_state</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Sep 2020 00:42:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65959/how-to-enter-system-on-sleep-in-zephyr" /><item><title>RE: How to enter System ON sleep in zephyr</title><link>https://devzone.nordicsemi.com/thread/270704?ContentTypeID=1</link><pubDate>Tue, 22 Sep 2020 00:42:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f80bd94b-f6c4-426f-baf3-bdbe143ddeea</guid><dc:creator>honestech74</dc:creator><description>&lt;p&gt;Thanks, Simon&lt;br /&gt;&lt;br /&gt;I have fixed that issue by adding some thread-safe stuff. It was not related to DEVICE PM.&lt;br /&gt;&lt;br /&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter System ON sleep in zephyr</title><link>https://devzone.nordicsemi.com/thread/270530?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 09:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:771a8b35-1a7d-442b-b231-4d61dc7d1a6b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;You could use the Nordic layer directly. If you look inside the driver&lt;em&gt;&amp;nbsp;zephyr\drivers\spi\spi_nrfx_spim.c&lt;/em&gt; and in the case DEVICE_PM_OFF_STATE, the following will happen:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int spim_nrfx_pm_control(struct device *dev, u32_t ctrl_command,
				void *context, device_pm_cb cb, void *arg)
{
    .
    .
    if (ctrl_command == DEVICE_PM_SET_POWER_STATE) {
        .
        .
        case DEVICE_PM_OFF_STATE:
				if (data-&amp;gt;pm_state == DEVICE_PM_ACTIVE_STATE) {
					nrfx_spim_uninit(&amp;amp;config-&amp;gt;spim);
				}
				break;
    .
    .
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Try calling&amp;nbsp;nrfx_spim_uninit directly. If you&amp;#39;re using&amp;nbsp;&lt;span&gt;&lt;em&gt;nordic,nrf-spi&lt;/em&gt; instead of&amp;nbsp;&lt;/span&gt;&lt;em&gt;nordic,nrf-spi&lt;span style="text-decoration:underline;"&gt;m&lt;/span&gt;&lt;/em&gt; in the overlay file, call&amp;nbsp;&lt;em&gt;spi_nrfx_pm_control(..)&amp;nbsp;&lt;/em&gt;instead.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter System ON sleep in zephyr</title><link>https://devzone.nordicsemi.com/thread/269981?ContentTypeID=1</link><pubDate>Thu, 17 Sep 2020 05:32:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85b24eb3-4e37-442e-8a55-ce354a10634c</guid><dc:creator>honestech74</dc:creator><description>&lt;p&gt;Thanks, Simon&lt;br /&gt;I got the correct intend from you. I really didn&amp;#39;t understand that I haven&amp;#39;t to use the main loop to save power. After created a thread for me, I&amp;#39;ve checked that the idle thread is working.&lt;br /&gt;&lt;br /&gt;Followed question: I am using the SPI LCD on my board and want to sleep or power off the SPI if needed. I thought it can be called &lt;strong&gt;device_set_power_state(dev-&amp;gt;spi_dev, DEVICE_PM_OFF_STATE, NULL, NULL)&lt;/strong&gt; in display_&lt;em&gt;lcdname&lt;/em&gt;.c. But I got the OS thread error. Do you have any idea to power off/on the SPI safely in the LCD driver? or any special way(example)?&lt;br /&gt;&lt;br /&gt;Best regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter System ON sleep in zephyr</title><link>https://devzone.nordicsemi.com/thread/269893?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 13:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba08525b-2b94-49a6-bc77-8155c1299772</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;You dont need to do anything to put the nRF52840 into System ON sleep, this will happen by default. Take a look at &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kernel/threads/system_threads.html"&gt;System Threads&lt;/a&gt;&amp;nbsp;in the Zephyr documentation and read about the idle thread:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;If possible, the idle thread activates the board’s power management support to save power&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The idle thread has the lowest priority and will run when nothing else is happening. Just make sure you&amp;#39;re not using a loop in main(), or calling &lt;em&gt;k_cpu_idle()&lt;/em&gt; directly (read&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/include/kernel.h#L5207-L5210"&gt;this text&lt;/a&gt;). The idle thread will put the system to sleep &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/kernel/idle.c#L160"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Bes regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enter System ON sleep in zephyr</title><link>https://devzone.nordicsemi.com/thread/269736?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 17:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3360f04-a512-47ec-84cc-2d96724f4b67</guid><dc:creator>honestech74</dc:creator><description>&lt;p&gt;I found that Zephyr doesn&amp;#39;t support the SLEEP state for nrf52.&lt;br /&gt;These are the supported SoC list for SYS_POWER_STATE_SLEEP_1 in zephyr.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;code class="xref std std-option docutils literal notranslate"&gt;&lt;span class="pre"&gt;SOC_SERIES_EFM32GG11B&lt;br /&gt;SOC_SERIES_EFM32JG12B&lt;br /&gt;SOC_SERIES_EFM32PG12B&lt;br /&gt;SOC_SERIES_EFR32BG13P&lt;br /&gt;SOC_SERIES_EFR32FG1P&lt;br /&gt;SOC_SERIES_EFR32MG12P&lt;br /&gt;SOC_SERIES_EFR32MG21&lt;br /&gt;SOC_SERIES_STM32L4X&lt;br /&gt;SOC_SERIES_STM32WBX&lt;br /&gt;SOC_SERIES_CC13X2_CC26X2&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I am weird how to enter sleep mode in&amp;nbsp;nrf52840. I saw the function _sys_suspend(), but have no idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>