<?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>FreeRTOS RTC Lockup with TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96436/freertos-rtc-lockup-with-twi</link><description>Hello, 
 I am having an issue with FreeRTOS (v10.0.0) on the NRF52833 (SDK 17.1.0). The core of the issue is that the xPortSysTickHandler function stops being called if I am also making TWI writes as a TWI master, though it is possible that issue was</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Feb 2023 16:03:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96436/freertos-rtc-lockup-with-twi" /><item><title>RE: FreeRTOS RTC Lockup with TWI</title><link>https://devzone.nordicsemi.com/thread/409214?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2023 16:03:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6a76244-08e7-4710-89a1-5d43f4a2e321</guid><dc:creator>functional_eng</dc:creator><description>&lt;p&gt;Thank you for the quick response Susheel,&lt;/p&gt;
&lt;p&gt;Good news-&amp;nbsp;I resolved the issue. The bad news is that it was a silly one. Apparently we had update the LF_SRC in 2 of 3 places in the sdk_config, so&amp;nbsp;CLOCK_CONFIG_LF_SRC was set to 1 not 0. This seems to have resulted in us occasionally/eventually switching to the external clock, which is not there, but is instead shared with TWI lines. Thus all of the bizarre madness in the behavior. Making that config change seems to have resolved the problem.&lt;/p&gt;
&lt;p&gt;I have no idea how we updated only 2 of the 3 config values...&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS RTC Lockup with TWI</title><link>https://devzone.nordicsemi.com/thread/408981?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 19:04:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69b027a6-9462-4704-adb1-3846736db3f0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;First of all, thanks for writing down details on the behavior of the system when issue happens. You have tried a lot of things that rule out many of my first thoughts. I do not think this is related to Tickless or even TWI driver.&lt;/p&gt;
[quote user=""]In the crash state, &lt;span&gt;vApplicationIdleHook &lt;/span&gt;keeps being called, and the &lt;span&gt;vApplicationMallocFailedHook and vApplicationStackOverflowHook&lt;/span&gt; never get called. The SystemTickHandler simply stops being called[/quote]
&lt;p&gt;&lt;/p&gt;
[quote user="functional_eng"]To add some additional information, if I call &amp;nbsp;nrf_rtc_counter_get(portNRF_RTC_REG); from within the applicationIdleHook I find that it stops incrementing (stops at ~120,000) when the SysTick stops running. If I then reset with the debugger it gets to 1 and then returns the same thing over and over, never increasing&amp;nbsp;[/quote]
&lt;p&gt;These two pieces of your experiment seems interesting. The RTC counter should never stop irrespective of the system being in sleep mode or in wakeup mode. Only the interrupt is disabled for RTC in sleep mode. There are two things I would like to know.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Insert Logs in every thread you see in your application so that we know when every thread resumes. Use RTT instead of UART for the backend of the logs.&lt;/li&gt;
&lt;li&gt;Dump the whole registers of the RTC1 so that we can see if there are any configuration changes happening from any other context.&lt;/li&gt;
&lt;li&gt;If all the RTC1 registers are intact, try writing manually NRF_RTC1-&amp;gt;TASK_START to see if that was enough to kickstart the RTC, if that did not work then it was more than just accidental NRF_RTC1-&amp;gt;TASKS_STOP that I thought was somehow triggered.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If possible, create a minimalistic project for me to reproduce the issue at my desk, so that I can attempt to debug this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS RTC Lockup with TWI</title><link>https://devzone.nordicsemi.com/thread/408702?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 21:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:255ba264-11ff-4331-a1af-ec62cae2468c</guid><dc:creator>functional_eng</dc:creator><description>&lt;p&gt;To add some additional information, if I call &amp;nbsp;nrf_rtc_counter_get(portNRF_RTC_REG); from within the applicationIdleHook I find that it stops incrementing (stops at ~120,000) when the SysTick stops running. If I then reset with the debugger it gets to 1 and then returns the same thing over and over, never increasing&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Perhaps it is related to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/8772/rtc-nrf51-sdk-example-matches-compare0-only-once/32163"&gt;this issue?&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>