<?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>Segger Embedded Studio - FDS - warning .stack and hardfault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17731/segger-embedded-studio---fds---warning-stack-and-hardfault</link><description>Hello everyone, 
 I am trying to use Segger Embedded Studio for a simple explerimental project.
I started from the sample FDS example from github and build something on it. Now I create some file/records and try to remove them. 
 I followed the instructions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Nov 2016 17:37:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17731/segger-embedded-studio---fds---warning-stack-and-hardfault" /><item><title>RE: Segger Embedded Studio - FDS - warning .stack and hardfault</title><link>https://devzone.nordicsemi.com/thread/68245?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 17:37:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5edf1909-ca7d-48ae-8024-880ddd8cdf11</guid><dc:creator>ColdBrew667</dc:creator><description>&lt;p&gt;Well, my thumb_crt0.s was ok. I missed the definition of the symbols in the FLASH segment.
I added it and removed my size from the RAM section to be aligned with what you are mentioning.
And in fact this is even worse, the warning is back and it looks like the init of &lt;code&gt;fds&lt;/code&gt; cannot go through.
In my code I directly call &lt;code&gt;fds_init()&lt;/code&gt; function. During this execution, a call to &lt;code&gt;pages_init()&lt;/code&gt; occurs just after the &lt;code&gt;fs_init()&lt;/code&gt;. In this &lt;code&gt;pages_init()&lt;/code&gt; function there is a tentative of retrieving the address of the start page which fails:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t        const * const p_page_addr = fs_config.p_start_addr + (i * FDS_PAGE_SIZE);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;p_page_addr = 0xffffffff&lt;/code&gt; after this call, and thus all this ends in a hardfault on the line that follows&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fds_page_type_t const         page_type   = page_identify(p_page_addr);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Segger Embedded Studio - FDS - warning .stack and hardfault</title><link>https://devzone.nordicsemi.com/thread/68244?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 09:52:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf984afd-968e-4164-8b64-074cf79b84be</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;As mentioned in @RK &amp;#39;s answer, you do also need to define the linker symbols __start_fs_data and __stop_fs_data. In flash_placement.xml it will look like the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;MemorySegment name=&amp;quot;$(FLASH_NAME:FLASH)&amp;quot;&amp;gt;
...
&amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; load=&amp;quot;Yes&amp;quot; name=&amp;quot;.fs_data&amp;quot; address_symbol=&amp;quot;__start_fs_data&amp;quot;  end_symbol=&amp;quot;__stop_fs_data&amp;quot; /&amp;gt;
&amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; load=&amp;quot;Yes&amp;quot; runin=&amp;quot;.fs_data_run&amp;quot; name=&amp;quot;.fs_data&amp;quot; /&amp;gt;
...
&amp;lt;/MemorySegment&amp;gt;

&amp;lt;MemorySegment name=&amp;quot;$(RAM_NAME:RAM);SRAM&amp;quot;&amp;gt;
...
&amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; load=&amp;quot;No&amp;quot; name=&amp;quot;.fs_data_run&amp;quot; address_symbol=&amp;quot;__start_fs_data&amp;quot;  end_symbol=&amp;quot;__stop_fs_data&amp;quot; /&amp;gt;
...
&amp;lt;/MemorySegment&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Did you add the below in thumb_crt0.s (also from @RK &amp;#39;s answer)?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  ldr r2, =__tdata_end__
bl memory_copy
# ADD HERE ... 
ldr r0, =__fs_data_load_start__
ldr r1, =__fs_data_start__
ldr r2, =__fs_data_end__
bl memory_copy
# TO HERE ...
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>