<?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>52810 coudl&amp;#39;t write data to flash using fstorage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34429/52810-coudl-t-write-data-to-flash-using-fstorage</link><description>Hi, 
 I&amp;#39;m using S112 v6.0 with SDK 15.0 on nRF52810. It&amp;#39;s based on app_ble_uart example. I have some data to save in flash. I define the address as follow: 
 #define PAGRE_TO_ERASE 1 #define FLASH_START_ADDR 0x27000 #define FLASH_STOP_ADDR 0x28000 
 #define</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 May 2018 09:37:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34429/52810-coudl-t-write-data-to-flash-using-fstorage" /><item><title>RE: 52810 coudl't write data to flash using fstorage</title><link>https://devzone.nordicsemi.com/thread/132700?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 09:37:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5bd610c-33d5-4005-8e31-78c9c5f0565b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;After the erase function, can you check that the data are all FFFF... in the page you have erased? I was thinking possible that you somehow don&amp;#39;t erase the page you expect. You could add a debug output before calling&amp;nbsp;sd_flash_page_erase() to make sure that the&amp;nbsp;page_number is as you expect. Also take a look at&amp;nbsp;\nRF5_SDK_15.0.0_a53641a\examples\peripheral\flash_fstorage if you haven&amp;#39;t already.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52810 coudl't write data to flash using fstorage</title><link>https://devzone.nordicsemi.com/thread/132373?ContentTypeID=1</link><pubDate>Thu, 17 May 2018 03:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d3a1313-3945-4484-ab91-89390982f654</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Kenneth,&lt;/p&gt;
&lt;p&gt;Yes, I know it need to&amp;nbsp;&lt;span&gt;take several hundred ms to execute the flash operation.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I&amp;nbsp;&amp;nbsp;set erase_finish = false; before I call &amp;nbsp;&amp;nbsp;nrf_fstorage_erase, then wait it erase finish:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;while(!erase_finish);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;printf(&amp;quot;Clear OK\r\n&amp;quot;);&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The&amp;nbsp;erase_finish would be set to true in the&amp;nbsp;NRF_FSTORAGE_EVT_ERASE_RESULT event in the callback function fs_evt_handler . It has printed&amp;nbsp;Clear OK debug information.I do erase and write flash in the main function.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, it still couldn&amp;#39;t write data successfully. Is there anywhere wrong?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52810 coudl't write data to flash using fstorage</title><link>https://devzone.nordicsemi.com/thread/132350?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 19:13:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3659a9fa-6c79-49fa-a73f-5ee0b8d9ddde</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi, if you are using the softdevice api to write and erase flash, then it may take several hundred ms to execute the flash operation, because the softdevice need to schedule the flash operation. So for instance after calling a flash erase operation you need to wait for flash operation success event before the flash erase operation is complete, see description here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_1_2_7_2_7#ga9c93dd94a138ad8b5ed3693ea38ffb3e"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_1_2_7_2_7#ga9c93dd94a138ad8b5ed3693ea38ffb3e&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>