<?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>FDS erase</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40975/fds-erase</link><description>Hello, 
 I need to reset FDS. How can I get it&amp;#39;s address / size in code ? How to erase it&amp;#39;s area ? 
 Thank you.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Jan 2019 06:34:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40975/fds-erase" /><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/164141?ContentTypeID=1</link><pubDate>Mon, 07 Jan 2019 06:34:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:266db320-b6ea-4b25-842d-d75e75860cec</guid><dc:creator>natersoz</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159825?ContentTypeID=1</link><pubDate>Sat, 01 Dec 2018 22:08:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7366204c-869c-434d-b94b-0747d3a0a98a</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;This is the part of my code that can interest you (for bootloader).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159824?ContentTypeID=1</link><pubDate>Sat, 01 Dec 2018 22:07:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68484f52-bf6f-449f-99d6-f29b4d04493e</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void fds_erase()
{
	flash_bounds_set();
	
	NRF_LOG_INFO(&amp;quot;FDS area is 0x%08X - 0x%08X&amp;quot;, m_fs.start_addr, m_fs.end_addr - 1);
	

	ret_code_t rc = nrf_fstorage_init(&amp;amp;m_fs, &amp;amp;nrf_fstorage_nvmc, NULL); // only working for bootloader

	if (rc == NRF_SUCCESS)
	{
		NRF_LOG_INFO(&amp;quot;nrf_fstorage_init OK&amp;quot;);
	}
	else
	{
		NRF_LOG_ERROR(&amp;quot;nrf_fstorage_init error (%d)&amp;quot;, rc);
		return;
	}
	
	for (int a = m_fs.start_addr; a &amp;lt; m_fs.end_addr; a++)
    {
		unsigned char * fds_area = (unsigned char *) a;
        if (fds_area[0] != 0xFF)
        {
            NRF_LOG_INFO(&amp;quot;FDS not clear at 0x%08X&amp;quot;, a);
			break;
        }
    }
	
	for (int p = 0; p &amp;lt; FDS_VIRTUAL_PAGES; p++)
	{
		NRF_LOG_INFO(&amp;quot;FDS erasing page %d&amp;quot;, (int) p);

		#if   defined(NRF51)
			int erase_unit = 1024;
		#elif defined(NRF52_SERIES)
			int erase_unit = 4096;
		#endif

		int page_addr = m_fs.start_addr + p * erase_unit; // erase unit == virtual page size

		nrf_nvmc_page_erase(page_addr);

		low_power_delay_ms(200);
	}
	
	for (int a = m_fs.start_addr; a &amp;lt; m_fs.end_addr; a++)
    {
		unsigned char * fds_area = (unsigned char *) a;
        if (fds_area[0] != 0xFF)
        {
            NRF_LOG_ERROR(&amp;quot;FDS erase failed at 0x%08X&amp;quot;, a);
			break;
        }
    }
		
	NRF_LOG_INFO(&amp;quot;FDS erase finished&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159814?ContentTypeID=1</link><pubDate>Sat, 01 Dec 2018 20:12:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f105e01-587e-414d-aafc-620e0d0ab0a3</guid><dc:creator>natersoz</dc:creator><description>&lt;p&gt;This sounds interesting. Is this code publicly&amp;nbsp; accessible on github?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159772?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 20:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4488336d-1f5d-437c-bc06-80fdbac84429</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Error printed fatal error on RTT output (in event management)&lt;/p&gt;
&lt;p&gt;I finally found a way to create my &amp;quot;FDS&amp;quot; format that works nice. Thank you for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159748?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 15:06:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fbbf42e-f2d9-4c1e-9235-bb729ec509d4</guid><dc:creator>Jared</dc:creator><description>&lt;div&gt;&lt;span&gt;Hi&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;You can use nrfjprog for erasing the data in flash if it&amp;#39;s not a part of your application. However, if it&amp;#39;s part of your application then you can use&amp;nbsp;&lt;/span&gt;&lt;span&gt;nrf_fstorage_erase(). Flash can contain a lot of stuff, boot-loader, softdevice, application etc. Erasing flash would therefore require you to have an overview of its contents. If not, you can risk deleting the application itself. SES gives an overview of the content of flash after compilation. I would recommend&amp;nbsp; that you use the FDS module so that you avoid the scenario of having to erase the entire flash. The FDS module gives you a reference to data in flash with its files, and records. You write that you get a fatal error when you use&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;nrf_fstorage_erase(), could be more specific? What kind of error code is thrown? What are the parameters you use in&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;nrf_fstorage_erase()?&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159577?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 13:32:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee92da3e-654c-4017-8109-bde46fd2000d</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;if i use&amp;nbsp;nrf_fstorage_erase, i get a fatal error. What can i do next please ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159402?ContentTypeID=1</link><pubDate>Wed, 28 Nov 2018 11:54:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eef3f36a-b0b1-4038-9e4d-2dca8ef5cc0f</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;I found for address in fds.c, see function&amp;nbsp;flash_bounds_set();&lt;/p&gt;
&lt;p&gt;There is a bug in fds.c /&amp;nbsp;address_is_valid:&lt;/p&gt;
&lt;p&gt;&amp;quot;p_addr &amp;lt;= (uint32_t*)m_fs.end_addr&amp;quot; should be &amp;quot;p_addr &amp;lt; (uint32_t*)m_fs.end_addr&amp;quot; because end_addr is excluded.&lt;/p&gt;
&lt;p&gt;What can i use to erase pages ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS erase</title><link>https://devzone.nordicsemi.com/thread/159370?ContentTypeID=1</link><pubDate>Wed, 28 Nov 2018 08:56:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b027eb1-6262-40e9-986d-e48ac88315c1</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Is that possible to erase a FDS area with a DFU update (a hex file full of FF with addresses that correspond to FDS) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>