<?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>Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/129052/zephyr-last-software-timer-expiration-does-not-cause-immediate-transition-into-low-power-sleep</link><description>I&amp;#39;ve noticed weird behavior in the software timer scheduling. I my case, there is one timer handling LED blinking. It is used in single shot mode and rescheduled to time the lit up time and blank time. Once the blinking sequence is finished, the timer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Sep 2026 12:03:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/129052/zephyr-last-software-timer-expiration-does-not-cause-immediate-transition-into-low-power-sleep" /><item><title>RE: Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/thread/570822?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2026 12:03:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe3f6699-2f8f-4d28-95ab-de1a419ec44b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the update and feedback. I agree, having an assert to catch invalid FPU usage inside ISRs sounds like a good idea given the current limitation&amp;nbsp;. I am still trying to understand why the current consumption increases after a FPU exception. Will update the ticket when I know more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/thread/570805?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2026 07:57:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9657455-4d6d-4776-ad2c-956f55c22769</guid><dc:creator>xorly</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;Not related to this specific issue, but the Zephyr also documentation states that use of FPU instructions inside interrupts is not supported:&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is the most important info for me! I completely missed this fact in the docs.&lt;/p&gt;
&lt;p&gt;I tried to create global &lt;code&gt;volatile float sink&lt;/code&gt;&amp;nbsp;variable and write it from timer expiry callback (ISR) and that went fine. Increased power draw in sleep is probably caused by some heavier FPU use in ISR, not just load/store.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;My opinion:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Zephyr should assert in such cases. There are flags in Cortex M cores indicating FPU activity on current stack, so ti is doable. I have the impression, that Zephyr uses asserts mostly for user input validation and not even that extensively. Advanced assumptions like this one are rarely guarded by an assert.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for looking into this!&lt;br /&gt;Your answer resolves the issue for me, but if you find out anything interesting or manage to improve Zephyr quality in this aspect, let me know!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/thread/570783?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2026 14:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8991d2f-4b63-4e2e-82be-09b6e039d669</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for sharing the code and config. This is an interesting find. I was&amp;nbsp;able to reproduce this on my end as well, and it seems like the elevated sleep current&amp;nbsp;may potentially be related to the FPU. I assume you are also not seeing the issue if you don&amp;#39;t enable CONFIG_FPU in your project config?&lt;/p&gt;
&lt;p&gt;Not related to this specific issue, but the Zephyr also documentation states that use of FPU instructions inside interrupts is not supported:&amp;nbsp;&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/pastedimage1788272138329v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/zephyr/kernel/services/other/float.html"&gt;https://nrfconnectdocs.nordicsemi.com/ncs/latest/zephyr/kernel/services/other/float.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will continue to investigate this on my end.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/thread/570746?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2026 14:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53d8c450-b424-487e-88f1-252219e43f4e</guid><dc:creator>xorly</dc:creator><description>&lt;p&gt;So this was interesting adventure, it looks like (some?) float operations in the timer expiry callback cause increased power draw.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve also attached disassembly of each handler.&lt;/p&gt;
&lt;p&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/pastedimage1788187802087v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4048.main.cpp"&gt;devzone.nordicsemi.com/.../4048.main.cpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/13457.prj.conf"&gt;devzone.nordicsemi.com/.../13457.prj.conf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/my_5F00_timer_5F00_expiry_5F00_handler_5F00_float_5F00_disassembly.txt"&gt;devzone.nordicsemi.com/.../my_5F00_timer_5F00_expiry_5F00_handler_5F00_float_5F00_disassembly.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/my_5F00_timer_5F00_expiry_5F00_handler_5F00_raw_5F00_disassembly.txt"&gt;devzone.nordicsemi.com/.../my_5F00_timer_5F00_expiry_5F00_handler_5F00_raw_5F00_disassembly.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/thread/570727?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2026 10:25:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d24b70c-944e-4f37-8d60-6d5ce7ecbed4</guid><dc:creator>xorly</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;these are my C++ wrappers, but nothing special in there, so I did not include them (except the timer callback).&lt;br /&gt;Anyway, when I reduced the example to just directly call zephyr API functions, the issue is gone.&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/pastedimage1788171762313v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;2nd blink sequence is done by calling zephyr API functions directly, rest are though my wrapper.&lt;/p&gt;
&lt;p&gt;I am still looking through the code for the difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr: Last software timer expiration does not cause immediate transition into low power sleep</title><link>https://devzone.nordicsemi.com/thread/570691?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2026 11:19:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:784ce466-c94e-47e4-bc30-571a91c5ea26</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry, I can see you are using C++ but I do not recognise the function and classes you are using. Have you implemented your own timer or is it a wrapper around the Zephyr timer (&lt;a href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/zephyr/kernel/services/timing/timers.html#timers-v2"&gt;https://nrfconnectdocs.nordicsemi.com/ncs/latest/zephyr/kernel/services/timing/timers.html#timers-v2&lt;/a&gt;)? Can you provide a minimal version of your project that would allow me to reproduce the problem here?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>