<?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>Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111292/timer-during-zephyr-sleep</link><description>We are going into sleep mode for the processor. We are using Zephyr and sdk 2.3. We also are keeping a running count of seconds and synching that once a day with a modem. Is there a timer or counter that is used by Zephyr so that we can get a count of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 May 2024 15:48:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111292/timer-during-zephyr-sleep" /><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/486252?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 15:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea2ca80-abd0-4f6b-9e11-3c6de9727866</guid><dc:creator>Sigurd</dc:creator><description>[quote user="rmartin92"]&amp;nbsp; So is there a callback function to notify us of a System Idle wakeup from sleep?[/quote]
&lt;p&gt;I don&amp;#39;t see why that would be useful in this context. It would trigger each time there is a interrupt the CPU need to process.&lt;/p&gt;
[quote user=""]We also are keeping a running count of seconds and synching that once a day with a modem.[/quote]
&lt;p&gt;Maybe you could&amp;nbsp;use a kernel timer,&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/kernel/services/timing/timers.html"&gt;https://docs.zephyrproject.org/latest/kernel/services/timing/timers.html&lt;/a&gt;&amp;nbsp;, that triggers every 24 hours, and in the timer callback, call&amp;nbsp;&lt;span&gt;k_uptime_get&amp;nbsp;() and update your modem with that.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/486064?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 21:31:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4696c303-d15d-4efd-b15a-b75cda28fa0e</guid><dc:creator>rmartin92</dc:creator><description>&lt;p&gt;yes,&amp;nbsp; We are not turn off, but using the Zephyr automatic sleep. System on Idle mention by Helmut Lord above.&amp;nbsp; So is there a callback function to notify us of a System Idle wakeup from sleep?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/485969?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 08:28:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fbf1918-be7b-4f49-a036-62ac165acf3f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user="rmartin92"]Is there any callback funtion that we can use that tells us when zephyr exists sleep?[/quote]
&lt;p&gt;What sleep are you referring to here? System OFF sleep, or System ON idle sleep?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/485928?ContentTypeID=1</link><pubDate>Sun, 26 May 2024 19:11:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c64b40a-4d63-40ce-9bee-d05a4c81ddbe</guid><dc:creator>rmartin92</dc:creator><description>&lt;p&gt;Is there any callback funtion that we can use that tells us when zephyr exists sleep?&amp;nbsp; If so we can update our clock with a call k_uptime_get.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/485053?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 11:04:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35e51df5-1e09-49e2-a839-796b6471621a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;If you are not entering system off, then&amp;nbsp;&lt;span&gt;k_uptime_get should&amp;nbsp;not stop either.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/484939?ContentTypeID=1</link><pubDate>Mon, 20 May 2024 17:27:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33d3d8d0-b5b7-4478-a32a-cc2a67bd4310</guid><dc:creator>rmartin92</dc:creator><description>&lt;p&gt;We are using&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;k_uptime_get&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;And associating this with the calendar time being set by the network or a cli.&amp;nbsp; &amp;nbsp;The sleep is the zephyr thread sleep.&amp;nbsp; We are never entering system off.&amp;nbsp; When we wake from this sleep we need to be sure that time is updated correctly.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/484938?ContentTypeID=1</link><pubDate>Mon, 20 May 2024 17:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e477971f-acc5-44c9-96eb-1ecbc47f46a1</guid><dc:creator>khelmutlord</dc:creator><description>&lt;p&gt;Hello Roger,&lt;/p&gt;
&lt;p&gt;Could you share what function call you are using to get the time? Are you using the CMSIS osTimer? There are a number of different kernel timing functions you can use, but it will depend on what power mode the part is in (I believe).&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/kernel/services/timing/clocks.html"&gt;docs.zephyrproject.org/.../clocks.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also, are you entering system off sleep or yielding/sleeping all possible threads to enter sleep?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Helmut Lord&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer during Zephyr Sleep</title><link>https://devzone.nordicsemi.com/thread/484848?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 21:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7644005-0477-43d5-83e9-17b93e0d15e5</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Most of the staff is away for a long weekend in Norway, so there will be some delays in response time.&amp;nbsp;Thanks for your patience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>