<?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>Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29920/alternative-to-use-sd_flash_page_erase-using-fds</link><description>Hi there, 
 On my project I was working using sd_flash_xxx functions to write the whole flash pages or erase it, so I added peer manager to my project and I had to switch my functions from sd_flash_xxx to FDS, because I was getting hangs on my code when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Feb 2018 14:09:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29920/alternative-to-use-sd_flash_page_erase-using-fds" /><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/120293?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2018 14:09:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6985b5a9-514d-4b32-a4c1-17c60b66ad3e</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung, I solved my problem. I was calling the fs_xxx functions before enabling some SD functions I had to re-order the way how I call some SD functions and I was erasing/storing data where my application was allocated also I fixed it and now my application is working so far so good. thanks for the suggestions&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/119560?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 14:46:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75384083-d4b6-4389-8a7f-888cbdc8c52c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You may want to check in your application what cause the problem. i would suggest to comment out some of the functionality, one by one, such as stop advertising for example. Until you have the flash working as in the ble_app_hrs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Note that the event for radio notification is the same as the flash event, so you should be careful if you use radio notification.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/119555?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 14:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7505c3f7-8311-4491-b469-bb7a3d8b4eda</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung, Thanks for the example, it works fine also I read the fstorage_simple and port it to ble_app_hrs, and it work fine. But when I tried to port it to my project for some reason it is not working and not triggering any event. for my main project I am using GCC&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/119000?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2018 15:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:275d62dc-ff27-4453-9e45-9820c5fa2dd3</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If you don&amp;#39;t plan to pass any context pointer to the handler, you can use NULL.
I attached here a quick example I used the fstorage_simple in to SDK v13.0 ble_app_hrs example. You can test:
&lt;a href="https://devzone.nordicsemi.com/attachment/7537feeb4950b2d53fcd94aff0e89078"&gt;main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118998?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2018 14:32:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:038e6162-9fed-4e76-914e-c30e18d14ea4</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;yes, I put fs_sys_event_handler into sys_evt_diispatch, it is in the code above :)&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t chance to run properly fstorage_simple, for some reason I cant build it using gcc and makefile, I am setting a virtual machine to do it&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fgroup__fstorage.html&amp;amp;anchor=ga0428a1e8a5988a9d031f67ce67ff8eb1"&gt;p_context &lt;/a&gt; is a parameter used for fs_erase/store&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118999?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2018 14:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4525c00c-6430-4f45-b1e0-fea533f411ab</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Have you put fs_sys_event_handler() into sys_evt_dispatch() ?&lt;/p&gt;
&lt;p&gt;Have you tried to test with fstorage_simple ?  Did it work for you ? If it worked with SDK v11 it should most likely work on SDK v13.&lt;/p&gt;
&lt;p&gt;What is p_context ? Where is it declared ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118997?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2018 11:49:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c53b49-25aa-46f7-b5ff-558ebd338d52</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hey Hung, I found that my code is getting hangs due an unhandled callback to fstorage callback, but my callback is declared on FS_REGISTER_CFG. If I use the p_contex for fs_store/erase could it help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118996?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 11:16:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5465c178-4b9f-4306-a21f-61682f953414</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t see why ble_advertising_on_sys_evt() has anything to do with fstorage.&lt;/p&gt;
&lt;p&gt;What I mean with ble_app_hrs is to edit that example and add your code in. The code should be basically what described in the code snipets &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.1.0/lib_fstorage.html?cp=4_0_3_3_44"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You should have a look at the fstorage_test() in the fstorage simple example &lt;a href="https://github.com/NordicPlayground/nRF5-flash-storage-examples/blob/master/fstorage_example_simple/main.c"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please try to put it into ble_app_hrs or any example in the SDK.&lt;/p&gt;
&lt;p&gt;If you still have problem, please zip your project and add it into the question so we can have a look.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118995?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 04:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee84f1b0-5ee5-46e0-9060-c681a6adb24b</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;I also added ble_advertising_on_sys_evt(sys_evt) to my system dispatch and I am now receiving my fs_erase events, but not for fs_store not sure why&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118989?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2018 14:15:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dbbbfd1-dda5-4bba-a6e8-513e69c185d8</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung, I am using SDK 13. It looks nrf_fstorage_sd.c is only available for SDK 14 and not 13. When I added Fstorage to my project I used the fstorage_example_ascii as base. I read the ble_app_hrs, But I could find calls for fs_erase or fs_write. the only thing I found:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Dispatch the system event to the fstorage module, where it will be
// dispatched to the Flash Data Storage (FDS) module.
fs_sys_event_handler(sys_evt);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That means I need to register a FDS callback for the fstorage events? instead of use fstorage callback?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118994?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2018 10:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23733df8-bcbb-498d-837a-e270a5b4bd04</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Which SDK are you working on ? I would suggest you to try play with the fstorage in one of our example in the SDK for example ble_app_hrs. Also, make sure you used nrf_fstorage_sd.c back end. We also have some example &lt;a href="https://github.com/NordicPlayground/nRF5-flash-storage-examples"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118993?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 04:20:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdcf5b6f-d063-43ff-9b05-5a54715a3630</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Hung, I still have problems after I added fstorage the event the fs_evt_handler doesn&amp;#39;t triggered after call fs_store/fs_erase. I registered:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void sys_evt_dispatch(uint32_t sys_evt)
{
    fs_sys_event_handler(sys_evt);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and I call inside my Fstorage initilialization:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NUM_PAGES 1

void fstorage_initialization(void)
{
	static uint32_t data;
	uint32_t flash_data[4];
	
	FS_REGISTER_CFG(fs_config_t fs_config) =
	{	
	.p_start_addr = (uint32_t*)0x00060000,
    .p_end_addr = (uint32_t*)0x00061000,  			
    .callback = fs_evt_handler,
    .num_pages = NUM_PAGES,
    .priority = 0xFE  					
	};
		
	fs_ret_t ret = fs_init();
	if (ret != FS_SUCCESS)
	{
		NRF_LOG_INFO(&amp;quot;fs_init() BSP_INDICATE_FATAL_ERROR \n\r&amp;quot;);
	}
}		
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;after initialized the peer manager&lt;/p&gt;
&lt;p&gt;I call fs_erase:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t Page_erase(uint32_t page_address)
{
	FS_REGISTER_CFG(fs_config_t fs_config) =
	{	
		.p_start_addr = (uint32_t*)page_address ,
		.p_end_addr = NULL, 			
		.callback = fs_evt_handler,
		.num_pages = NUM_PAGES,
		.priority = 0xFE  					
	};

	fs_ret_t ret;
	ret = fs_erase(&amp;amp;fs_config, fs_config.p_start_addr , 1, NULL);
	APP_ERROR_CHECK(ret);
	return ret;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;my fstorage callback:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void fs_evt_handler(fs_evt_t const * const evt, fs_ret_t result)
{
	if (result != FS_SUCCESS)
	{
		NRF_LOG_INFO(&amp;quot;fs_evt_handlermand FATAL_ERROR \n\r&amp;quot;);
	}
	else
	{
		NRF_LOG_INFO(&amp;quot;    fstorage command successfully completed   \n\r&amp;quot;);
		fs_callback_flag = 0;
	}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Are there any additional step in order to make work fstorage? my original project did not have fstorage or FDS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118992?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 15:14:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8346383-f6e7-4126-a2b8-f1f1c1b040b4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please read &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/lib_fstorage.html?cp=4_0_0_3_51"&gt;the documentation.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118991?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 14:31:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cf6def6-bdc0-4da0-afc5-38b9c85370b8</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Thanks for the reply hung it was my mistake I mean 40 flash pages :)&lt;/p&gt;
&lt;p&gt;is the operation for fstorage similar to sd_flash_xxx functions? if it is the case great :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Alternative to use sd_flash_page_erase using FDS</title><link>https://devzone.nordicsemi.com/thread/118990?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 14:11:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b76a4a02-b195-4299-a93e-49f8382fef0e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;On nRF52 chip, each flash page is 4kB so 40000 pages equal 160 MB, I don&amp;#39;t think our chip could have that much of flash :)&lt;/p&gt;
&lt;p&gt;If you want to access flash directly, please use fstorage. You can declare your own area of flash that you want to use with fstorage. fds also use fstorage as it back end.&lt;/p&gt;
&lt;p&gt;You can use any flash page as long as it&amp;#39;s not softdevice, or application. Basically any page after your application and before the area where peer manager data located (usually right before the bootloader or the end of the flash if there isn&amp;#39;t any bootloader)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>