<?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>Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104714/unknown-function-0xa60-seems-to-happen-while-calling-a-particular-application-api-only</link><description>OK I&amp;#39;m seeing this weird behavior that I&amp;#39;m trying to understand 
 I have a sensor task that reads sensor data continuously every 4 seconds. The value is then notified to the subscriber (NotificationManager) which then sends the data to UART, (and later</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Nov 2023 15:21:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104714/unknown-function-0xa60-seems-to-happen-while-calling-a-particular-application-api-only" /><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/454524?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 15:21:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e5d09f7-feaf-46fd-8bce-8d448e49a0ca</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="morpho"]Though how&amp;#39;s it even failing before main starts?&amp;nbsp;[/quote]
&lt;p&gt;You will be able to set a breakpoint at the&amp;nbsp;&lt;span&gt; OnSubscribeChange(true); in the above code you showed and start the program in debugger. When the program runs and the breakpoint hits, you will be able to see the function call history on how you reached here before the scheduler has started. Seems like there is some logical error in the state machine of your application.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/454297?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2023 19:11:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:affc989b-0595-497f-be46-6af4949b3478</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;That was it seemingly - the scheduler wasn&amp;#39;t started&amp;nbsp;while&amp;nbsp;&lt;span&gt;OnSubscribeChange was called.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The caller is now calling it like&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;	  if (xTaskGetSchedulerState() == taskSCHEDULER_RUNNING)
	  {
	      OnSubscribeChange(true);
	  }&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;Though how&amp;#39;s it even failing before main starts?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/454133?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2023 09:23:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc6ade72-991a-4461-8fa5-267d03bf4aa5</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="morpho"]Commenting out the contents of OnSubscribeChange doesn&amp;#39;t lead to any crash but curious as to why[/quote]
&lt;p&gt;Is the scheduler started when you call vTaskREsume or vTaskSuspend?&amp;nbsp;&lt;br /&gt;I have seen that sometimes trying to do these things before the scheduler started causes hardfault.&lt;/p&gt;
&lt;p&gt;What is the context in which&amp;nbsp;&lt;span&gt;OnSubscribeChange&amp;nbsp;is called? Is it running in ISR context or the RTOS thread context? Since you know exactly where it crashes, you can step into the code in the debugger mode and see if it is crashing everytime it runs&amp;nbsp;OnSubscribeChange&amp;nbsp; or it happens once over many calls to&amp;nbsp;OnSubscribeChange&amp;nbsp;?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/454099?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2023 01:41:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d802fd4f-63d2-428b-88e9-14f1e445c4c7</guid><dc:creator>morpho</dc:creator><description>[quote userid="6207" url="~/f/nordic-q-a/104714/unknown-function-0xa60-seems-to-happen-while-calling-a-particular-application-api-only/451904"]For the second point, you can enable some configs and run some tests as mentioned &lt;a href="https://www.freertos.org/Stacks-and-stack-overflow-checking.html"&gt;here&lt;/a&gt;&amp;nbsp;to catch any stack overflows in your app.[/quote]
&lt;p&gt;I already have the&amp;nbsp;configCHECK_FOR_STACK_OVERFLOW set to 1 in addition to the hook function.&lt;/p&gt;
&lt;p&gt;Note that the application &amp;#39;crashes&amp;#39; before even executing the main.&lt;/p&gt;
&lt;pre&gt;extern &amp;quot;C&amp;quot;
 {
    void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
    {
        ( void ) pcTaskName;
        ( void ) xTask;

        char buff[100] = {0};
        strncpy(buff, (const char *)pcTaskName, configMAX_TASK_NAME_LEN);

        UBaseType_t uxHighWaterMark = uxTaskGetStackHighWaterMark(NULL);
    
        while(1);
    }
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Commenting out the contents of OnSubscribeChange doesn&amp;#39;t lead to any crash but curious as to why&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451904?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 08:22:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6d65a4e-78b9-4ba0-b8e7-55e520962e42</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;&lt;strong&gt;&amp;quot;Unknown function at 0x87201846&amp;quot;&lt;/strong&gt; does not look like a valid code address. This is either that&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;your applicaiton is dereference as corrupt function pointer or&lt;/li&gt;
&lt;li&gt;still some stack overflow in some task somewhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the second point, you can enable some configs and run some tests as mentioned &lt;a href="https://www.freertos.org/Stacks-and-stack-overflow-checking.html"&gt;here&lt;/a&gt;&amp;nbsp;to catch any stack overflows in your app.&lt;/p&gt;
&lt;p&gt;If you have tried increasing task stack size for every task that the application created, then try to see if you need to increase the stack size of the main or timer task.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451610?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 04:12:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c5d86a3-ccee-47da-9fc7-bfad66c7329f</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;OK so as I continued to add more stuff (including a single virtual method as shown below), I now see the app crashing at the startup. When however I comment out the function body, it runs fine.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
void MCP9808::OnSubscribeChange(bool subscribeRequest) 
{
    if (subscribeRequest)
    {
        vTaskResume(mTaskHandle);
    }
    else
    {
        vTaskSuspend(mTaskHandle);
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2023_2D00_10_2D00_22-at-9.11.19_2F20_PM.png" /&gt;&lt;br /&gt;&lt;br /&gt;I tried increasing the heap size to 8192 and stack size to 300 to no avail&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451388?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 20:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb2a2a61-605c-48a0-a19b-2bbc2249694f</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;The problem was&amp;nbsp;&lt;span&gt;configMAX_TASK_NAME_LEN inFreeRTOSConfig.h was set to 4.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451373?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 16:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f110d5f9-6d56-4f38-9a59-6a73e1c90b3d</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;Copying&amp;nbsp;configMAX_TASK_NAME_LEN bytes still produces Pro.&lt;br /&gt;&lt;br /&gt; What memory view would you look into?&amp;nbsp;&lt;br /&gt;No way anyone can decode this&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2023_2D00_10_2D00_19-at-9.39.54_2F20_AM.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451207?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 07:57:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31b57fe8-eb77-40ad-a9fd-61bc91873b9d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;maybe do a strncpy like below instead&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;strncpy(buff, (const char *)pcTaskName, configMAX_TASK_NAME_LEN); &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or check in the memory if there is only Pro in the sequential address of the memory of if it has the whole &amp;quot;Process&amp;quot; name and it is just the matter of using the right size in the API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451179?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 05:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7e30062-8b01-4c5b-9f8a-71414ecc5dbc</guid><dc:creator>morpho</dc:creator><description>[quote userid="6207" url="~/f/nordic-q-a/104714/unknown-function-0xa60-seems-to-happen-while-calling-a-particular-application-api-only/451176"]While debugging I normally change the heap size to 4096 and the stack size of every task to atleast 512 bytes. But on application with tight available memory, this might be too much.&amp;nbsp;[/quote]
&lt;p&gt;I already am on 4096 heap and 400 bytes of stack for a task.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Anyways, there&amp;#39;s one task named &amp;quot;Process&amp;quot; but here, buff contains &amp;quot;Pro&amp;quot;. Do you see why it could be?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;extern &amp;quot;C&amp;quot;
 {
    void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
    {
        ( void ) pcTaskName;
        ( void ) xTask;

        char buff[100] = {0};
        strncpy(buff, (const char *)pcTaskName, sizeof(buff) - 1); // buff = &amp;quot;Pro&amp;quot;

        UBaseType_t uxHighWaterMark = uxTaskGetStackHighWaterMark(NULL);
    
        while(1);
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451176?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 04:30:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ac048f5-fc89-4004-b924-44feb83349be</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="morpho"]But why do you think increasing the heap size is a temporary solution? I changed the heap size back to 4096 with 200 stack depth and it still works. Previously just increasing the stack depth resulted in&amp;nbsp; NRF_ERROR_NO_MEM.[/quote]
&lt;p&gt;I might have confused you there. What I meant to say is that increase the HEAP size to a large number temporarily and when we know which task stack was overflowing, then you can calibrate the increase in heap size and increase in the stack size of that task to a value that is not too big.&lt;/p&gt;
&lt;p&gt;While debugging I normally change the heap size to 4096 and the stack size of every task to atleast 512 bytes. But on application with tight available memory, this might be too much.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So my use of temporary was only to temporarily increase the heap size to a very big number and the temporarily increase to the task size to a very big number just to&amp;nbsp;pinpoint&amp;nbsp; the rogue task that is using more stack than ancipated. And then for release version of your application you can fine tune the the heap and stack size (hence moving away from the temporary high values)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/451118?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 16:55:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6c6ac05-b113-4fe0-8cb4-ef0654b37079</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;I increased&amp;nbsp;configTOTAL_HEAP_SIZE to&amp;nbsp;8192 and the tasks&amp;#39; stack depth to 200 and I no longer see the issue.&lt;/p&gt;
&lt;p&gt;But why do you think increasing the heap size is a temporary solution? I changed the heap size back to 4096 with 200 stack depth and it still works. Previously just increasing the stack depth resulted in&amp;nbsp; NRF_ERROR_NO_MEM.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Can you make up a conclusion?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/450947?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 05:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f80cb164-c5a7-4196-8838-a076b9ecfa1f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Forgot to answer this question.&lt;/p&gt;
[quote user="morpho"]What&amp;#39;s the actual stack size of nRF52840? It&amp;#39;s set to 2KB in Segger config[/quote]
&lt;p&gt;Stack size is compiler language. With nRF52840 we should talk about RAM and Flash size. You can set the whole RAM as stack but that depends on the architecture of the solution. If you are using BLE, then the softdevice uses some stack space in the RAM. On top of that the FreeRTOS kernel and tasks uses some stack space in the RAM and on top of that your application&amp;nbsp; needs stack space in RAM.&lt;/p&gt;
&lt;p&gt;The main stack size you are seeing there is the stack size of the main thread (typically the main() function), You might know this already but if you don&amp;#39;t then please read about &lt;a href="https://www.linkedin.com/pulse/interrupt-processing-arm-cortex-m4-ahmed-abd-el-ghafar-mohammed/"&gt;ARM Cortex M4 interrupt and Main thread&lt;/a&gt; contexts which are hardware related. Linked one of those threads for your convinience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/450946?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 05:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e745fa8-292f-4d62-8464-467233fc23e6</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="morpho"]OK I see the execution does indeed hit the following function in runtime. Hence stackoverflow is happening?[/quote]
&lt;p&gt;Yes, this means that the RTOS has detected a stack overflow. Then we know that we are in the right direction of debugging.&lt;/p&gt;
[quote user="morpho"]I tried increasing the tasks&amp;#39; stack size but that resulted in&amp;nbsp;&lt;strong&gt;NRF_ERROR_NO_MEM&lt;/strong&gt;[/quote]
&lt;p&gt;You have to first (temporarily) increase&amp;nbsp;&lt;strong&gt;configTOTAL_HEAP_SIZE&lt;/strong&gt;&amp;nbsp;by a decent size because all tasks initial stack is allocated from heap. One you have enough heap size, try to increase stack size of one task, recompile, flash and see if you again hit the&amp;nbsp;&lt;span&gt;vApplicationStackOverflowHook. Repeat this process until you stop hitting the overflowHook function. When that happens you know which task size you increased which solved the stack overflow issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Remember that there are many tasks apart from the tasks that you create in your applicaiton. For example, if your application using RTOS timers and doing a bit of processing in the timer callback, then the default value of&amp;nbsp;&lt;/span&gt;configTIMER_TASK_STACK_DEPTH might be too less in your case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to review all the default values in FreeRTOSConfig.h file to see if there is any calibration you need to do there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/450899?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 16:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:997d2449-44a2-4f44-b1d9-168be6aee495</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;OK I see the execution does indeed hit the following function in runtime. Hence stackoverflow is happening? What could be ways to avoid?&amp;nbsp;I tried increasing the tasks&amp;#39; stack size but that resulted in&amp;nbsp;&lt;strong&gt;NRF_ERROR_NO_MEM&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;extern &amp;quot;C&amp;quot;
 {
    void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
    {
        ( void ) pcTaskName;
        ( void ) xTask;
  
    
        for( ;; ); 
    }
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Currently, I only have 2 tasks each occupying 4 * 100 bytes in the stack&lt;/p&gt;
&lt;div class="codeblock-button-wrapper"&gt;
&lt;pre class="codeblock-buttons"&gt;&lt;code class="hljs language-kotlin"&gt;xTaskCreate(SystemTask::Process, &lt;span class="hljs-string"&gt;&amp;quot;Run&amp;quot;&lt;/span&gt;, &lt;span class="hljs-number"&gt;100&lt;/span&gt;, &lt;span class="hljs-keyword"&gt;this&lt;/span&gt;, &lt;span class="hljs-number"&gt;0&lt;/span&gt;, &amp;amp;mTaskHandle&lt;br /&gt;xTaskCreate(MCP9808::Process, &lt;span class="hljs-string"&gt;&amp;quot;Process&amp;quot;&lt;/span&gt;, &lt;span class="hljs-number"&gt;100&lt;/span&gt;, &lt;span class="hljs-keyword"&gt;this&lt;/span&gt;, &lt;span class="hljs-number"&gt;0&lt;/span&gt;, &amp;amp;mTaskHandle&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="codeblock-button-wrapper"&gt;&lt;/div&gt;
&lt;div class="codeblock-button-wrapper"&gt;&lt;/div&gt;
&lt;div class="codeblock-button-wrapper"&gt;What&amp;#39;s the actual stack size of nRF52840? It&amp;#39;s set to 2KB in Segger config&lt;code class="hljs language-kotlin"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2023_2D00_10_2D00_17-at-10.34.14_2F20_AM.png" /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/450811?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 11:08:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cadbcb14-e054-4406-b563-94fda27756de</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;it is best to enable the &lt;a href="https://www.freertos.org/Stacks-and-stack-overflow-checking.html"&gt;native stack overflow&lt;/a&gt; detection in the RTOS and implement the hook function to know if there are any stack overflow in any of the tasks (not necessarily in the task that you created in the application.&lt;/p&gt;
&lt;p&gt;If we can rule out stack overflow and if you can review the interrupt priorities of the driver handlers of the peripheral you are using (priorities of ISR of peripheral from sdk_config.h file and not the priorities of the RTOS task). then we can rule out hardfault due to this aswell.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are other ways to get the context of the &lt;a href="https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html"&gt;hardfault&lt;/a&gt;&amp;nbsp;by reading the registers or ARM. We can try that aswell to understand the nature of the hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/450683?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 19:29:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c8a3a95-1734-4462-b2e4-af8f2a7c9ccb</guid><dc:creator>morpho</dc:creator><description>&lt;p&gt;The stack size is 2048 bytes, yes?&lt;br /&gt;&lt;br /&gt;I filled it in with 0xAA and I still see 0xAA during runtime (doesn&amp;#39;t get overwritten) so probably no stack overflow.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define STACK_PATTERN 0xAA  // Use the byte pattern 0xAA for the stack initialization
#define STACK_SIZE    2048  // Assuming a stack size of 2048 bytes for demonstration
#define STACK_LIMIT   128   // The limit in bytes that we don&amp;#39;t want the stack to approach

uint8_t stack[STACK_SIZE];

void initializeStackWithPattern() 
{
    for (int i = 0; i &amp;lt; STACK_SIZE; i++) {
        stack[i] = STACK_PATTERN;
    }
}

/**@brief Function for application main entry.
 */
int main(void)
{
    initializeStackWithPattern();
    // ...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the same priority for the two tasks I have i.e, 0.&lt;br /&gt;&lt;br /&gt;I can certainly attach a project once you make this thread private. Appreciate it a lot, Susheel&lt;br /&gt;&lt;br /&gt;Looking forward to solving this together&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unknown function 0xA60: seems to happen while calling a particular application API only</title><link>https://devzone.nordicsemi.com/thread/450678?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 19:02:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17629b73-4e6f-4624-9faa-5dfcfeb7e9b3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;0XA60 is a halt instruction in the MBR hardfault handler, which means that your application somehow hardfaulted.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It could be many reasons but most likely are stack overflow or your tried to call an SVC (sd_xxx) call from a higher priority.&lt;/p&gt;
&lt;p&gt;Can I get your project to replicate the issue? Have your reviewed all the priorities of tasks from which you call softdevice API?&lt;/p&gt;
&lt;p&gt;Have you checked if your have any stack overflow?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>