<?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 Warm-reset after propietary freeRTOS enabled bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111527/zephyr-warm-reset-after-propietary-freertos-enabled-bootloader</link><description>Hi, 
 So I have seen there is a clean -up option to set the architecture core HW registers to their warm -reset values as specified by the architecture before running the app from MCUBOOT (config MCUBOOT _CLEANUP _ARM _CORE ) . 
 Now I wonder if there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 May 2024 12:46:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111527/zephyr-warm-reset-after-propietary-freertos-enabled-bootloader" /><item><title>RE: Zephyr Warm-reset after propietary freeRTOS enabled bootloader</title><link>https://devzone.nordicsemi.com/thread/486027?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 12:46:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca95883d-b950-4b86-b86d-6497b8c0190b</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Armand La Flent"]What I can see is that I need to stop the RTC on a SYS_INIT operation before any other Zephyr core initialization to get k_sleep to work fine.[/quote]
&lt;p&gt;That is strange, can you show me the code snippet and the context of this change? Can you connect a debugger and put a breakpoint early in your application at SYS_INIT and view the RTC registers to see if you see the values cleared as expected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Warm-reset after propietary freeRTOS enabled bootloader</title><link>https://devzone.nordicsemi.com/thread/486014?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 11:52:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c3f6130-de81-432a-bb14-10a5dde9554a</guid><dc:creator>Ignacio</dc:creator><description>&lt;p&gt;Hi Susheel&lt;/p&gt;
&lt;p&gt;Thanks for your reply. Are the RTC register clear when you jump from a proprietary bootloader? What I can see is that I need to stop the RTC on a SYS_INIT operation before any other Zephyr core initialization to get k_sleep to work fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Warm-reset after propietary freeRTOS enabled bootloader</title><link>https://devzone.nordicsemi.com/thread/486009?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 11:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97a6d06a-62c9-4161-83c5-77db9bbb2981</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I thought that&amp;nbsp;&lt;span&gt;MCUBOOT&lt;/span&gt;&lt;span&gt;_CLEANUP&lt;/span&gt;&lt;span&gt;_ARM&lt;/span&gt;&lt;span&gt;_CORE is deprecated as my understanding was that this needed to be true for latest MCUBoot builds and I do not see any such option on the application side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In Zephyr, the Real-Time Counter (RTC) is typically used for timing services of the kernel, such as k_sleep() and the kernel timer API. This is usually a Real-time counter peripheral (RTC1) on Nordic SoCs and SiPs (nRF91, nRF53, nRF52 Series).&lt;br /&gt;The Zephyr kernel timer, used when you are using functions like k_cycle_get_32, is also based on the same&amp;nbsp; RTC&amp;nbsp;as discussed in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/111063/timer-accuracy-on-nrf5340/483128"&gt;this&lt;/a&gt; thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Warm-reset after propietary freeRTOS enabled bootloader</title><link>https://devzone.nordicsemi.com/thread/485910?ContentTypeID=1</link><pubDate>Sat, 25 May 2024 16:22:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2a026ea-e887-4392-988b-d11b25aed0ec</guid><dc:creator>Ignacio</dc:creator><description>&lt;p&gt;&lt;span&gt;I added the below code on the main to eliminate the timing conflict&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;div class="blockquoteContainer__66aaa"&gt;
&lt;blockquote&gt;&lt;code class="inline"&gt;static int nrf52_sys_init(void)
{&lt;/code&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;code class="inline"&gt;&amp;nbsp; &amp;nbsp;// Stop RTC1 to avoid conflit with
&lt;/code&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;code class="inline"&gt;&amp;nbsp; &amp;nbsp;// propietary bootloader RTC1 config&lt;/code&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;code class="inline"&gt;&amp;nbsp; &amp;nbsp;NRF_RTC1-&amp;gt;TASKS_STOP=1;
    
    return 0;&lt;/code&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;code class="inline"&gt;}&lt;/code&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;code class="inline"&gt;SYS_INIT(nrf52_sys_init, EARLY, 0);&lt;/code&gt;&lt;span&gt; &lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;p&gt;My observation is that if a proprietary code fiddles with RTC1 configuration will affect the normal running of k_sleep on Zephyr. I am currently working under NCS v2.6.0. Is that the expected behaviour?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>