<?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>nRF5 FreeRTOS main stack reused</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15709/nrf5-freertos-main-stack-reused</link><description>I am using the FreeRTOS port included in a nRF52832 with nRF5 v11.0.0 + s132. From main() I create a task and I pass it some input data as argument. That data is encapsulated in a struct which I declare in the stack of the main function. When the recover</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Aug 2016 09:15:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15709/nrf5-freertos-main-stack-reused" /><item><title>RE: nRF5 FreeRTOS main stack reused</title><link>https://devzone.nordicsemi.com/thread/59971?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2016 09:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88c2baf8-0c9c-4614-ad6d-8e51d36b8869</guid><dc:creator>genis</dc:creator><description>&lt;p&gt;I think there is a misunderstanding, I am not using the ISR. Anyway I was assuming what I declared in the stack in main() didn&amp;#39;t get modified, which is obviously wrong here. I&amp;#39;ll declare it in the heap, but I wanted to know why that was happening. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5 FreeRTOS main stack reused</title><link>https://devzone.nordicsemi.com/thread/59970?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2016 08:34:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd9021b2-b03d-447b-aecc-32bccdd669b4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This is nothing to do with the Nordic port of UART. The stack of main and the stack of your newly created task are different. You cannot pass stack memory to the created task because now you assume that the main stack remains untouched at the time your task gets to running state. The first chapter of FreeRTOS tells you to declare static if you want to exchange bulk information in between tasks. Also I do not see  anything wrong in declaring your  task_arg_t args as static outside main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>