<?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>Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51216/writing-erasing-the-flash-with-radio-on-and-ble-communication-on-going</link><description>I want to erase and write the flash while the BLE communication is going on. 
 In nRF52832 specifications it is mentioned that t he CPU is halted while the NVMC performs write/erase operation. So in this case the BLE communication can fail. 
 Is there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Sep 2019 09:27:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51216/writing-erasing-the-flash-with-radio-on-and-ble-communication-on-going" /><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/207329?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 09:27:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dad0e371-f7d9-42cd-93c4-71a6fbbbe8f9</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Justin, &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As my colleagues explained in &lt;a href="https://devzone.nordicsemi.com/support-private/support/235189"&gt;this post&lt;/a&gt;. I suggest you study the fstorage library&amp;#39;s handling of that return code.&amp;nbsp; See line 511 of nrf_fstorage_sd.c and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/fstorage_example.html"&gt;flash_fstorage&lt;/a&gt;&amp;nbsp;example in SDK 15.3 for the detail.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/207183?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2019 13:49:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e43e913f-d973-480d-9ae0-68a2c2e947b1</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;[quote userid="77782" url="~/f/nordic-q-a/51216/writing-erasing-the-flash-with-radio-on-and-ble-communication-on-going/207118"][/quote]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___e_n_u_m_s.html#gga2a3d2f55035ee3173aff0c05465fb648a566ef9d8a97914dd30cd152bdfcd50e6"&gt;&lt;span lang="en-US"&gt;NRF_EVT_FLASH_OPERATION_SUCCESS&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang="en-US"&gt;- The command was successfully completed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___e_n_u_m_s.html#gga2a3d2f55035ee3173aff0c05465fb648a7c0083f76ab9ee6e75369776526d584d"&gt;&lt;span lang="en-US"&gt;NRF_EVT_FLASH_OPERATION_ERROR&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang="en-US"&gt;- The&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Where to add the callbacks for these events in my application? Any code example would be of great help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/207118?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2019 11:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b49378c-b45a-423b-bca1-fd427cfaf6da</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span lang="nb-NO"&gt;Hi, &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="nb-NO"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="nb-NO"&gt;In &lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fstorage.html"&gt;&lt;span lang="nb-NO"&gt;Experimental: Flash Storage&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;/&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fstorage.html?cp=5_1_3_56_2#lib_fstorage_write"&gt;&lt;span lang="en-US"&gt;Writing data&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt; section, you can see how to handle the event return from &lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__fstorage.html?cp=5_1_6_11_21_20#ga5a37147f85e54eb049d3cad8bf59c807"&gt;&lt;span lang="en-US"&gt;nrf_fstorage_write&lt;/span&gt;&lt;/a&gt;&lt;span lang="en-US"&gt;()&lt;/span&gt;&lt;span lang="nb-NO"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html#gae5361e65cbb5e7f6e258947a394c9b55"&gt;&lt;span lang="en-US"&gt;sd_flash_write&lt;/span&gt;&lt;/a&gt;&lt;span lang="en-US"&gt;() &lt;/span&gt;&lt;span lang="en-US"&gt;will be communicated to the application with exactly one of the following events:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___e_n_u_m_s.html#gga2a3d2f55035ee3173aff0c05465fb648a566ef9d8a97914dd30cd152bdfcd50e6"&gt;&lt;span lang="en-US"&gt;NRF_EVT_FLASH_OPERATION_SUCCESS&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang="en-US"&gt;- The command was successfully completed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___e_n_u_m_s.html#gga2a3d2f55035ee3173aff0c05465fb648a7c0083f76ab9ee6e75369776526d584d"&gt;&lt;span lang="en-US"&gt;NRF_EVT_FLASH_OPERATION_ERROR&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang="en-US"&gt;- The command could not be started.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span lang="en-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en-US"&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/206952?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 19:03:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0497c2d-30da-42c1-a358-4e565096f86b</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;Thanks for your valuable inputs. I am able to write into flash using Flash Storage.&lt;/p&gt;
&lt;p&gt;My question is if the write fails is there any event generated so that it can be retried?&lt;/p&gt;
&lt;p&gt;I want to specifically use Experimental Flash Storage or sd_flash_write() API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/205635?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2019 13:24:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19a4bb54-686f-4ce4-b3d2-148948ec6be1</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="johnmjustin"]how FDS works?[/quote]
&lt;p&gt;Please see this&amp;nbsp;&lt;a title="Experimental: Flash Data Storage" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fds.html?cp=5_1_3_55"&gt;Experimental: Flash Data Storage&lt;/a&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FDS uses&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fstorage.html"&gt;Experimental: Flash Storage&lt;/a&gt;&lt;span&gt;&amp;nbsp;as the backend to write to flash. Flash Storage, in turn, relies on the SoftDevice to execute the write. Flash Data Storage supports&amp;nbsp;&lt;/span&gt;&lt;span&gt;synchronous read operations and asynchronous writes.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="johnmjustin"]Where do we give the memory address where I want to start writing[/quote]
&lt;p&gt;Please see&amp;nbsp;&lt;a title="Experimental: Flash Storage" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fstorage.html?cp=5_1_3_56"&gt;Flash Storage&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
[quote user="johnmjustin"]I am confused when should I use sd_flash*** API and FDS.[/quote]
&lt;p&gt;FDS is a file system, and with sd_flash you just write bytes directly to flash.&lt;/p&gt;
&lt;p&gt;you can read about the benefits of FDS &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fds.html?cp=5_1_3_55"&gt;here&lt;/a&gt;,&amp;nbsp;(the points under &amp;quot;The module has been designed to provide the following benefits: &amp;quot;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When the SoftDevice is enabled, flash operations should be done using the sd_flash_xx api. For writing to flash,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v2.0.1%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=3_7_2_1_0_2_7_2_9&amp;amp;anchor=ga8b49f2e72e97291aecc18ce396956eed"&gt;sd_flash_write()&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;should be used.&amp;nbsp;To simplifying storing data to flash, the library&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Flib_fds.html&amp;amp;cp=4_0_0_3_43"&gt;flash data storage&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(FDS) can be used.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/205419?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2019 03:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf787a52-0f97-4ace-b1fd-cb113ffba1f4</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;HI Amanda,&lt;/p&gt;
&lt;p&gt;Thanks for your email.&lt;/p&gt;
&lt;p&gt;I am not able to understand how FDS works? Where do we give the memory address where I want to start writing? In the input parameter of structures no where we provide memory address.&lt;/p&gt;
&lt;p&gt;I am confused when should I use sd_flash*** API and FDS. Also to write few bytes should I go with sd_flash_write() api or FDS?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing/Erasing the flash with radio on and BLE communication on-going.</title><link>https://devzone.nordicsemi.com/thread/205273?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 10:57:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92240865-fae5-47b4-ada0-b72c1abc7514</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Justin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en-US"&gt;&amp;nbsp;If you look at the &lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/nvmc.html?cp=3_1_0_10#concept_pcl_wbz_vr"&gt;&lt;span lang="en-US"&gt;NVMC — Non-volatile memory controller&lt;/span&gt;&lt;/a&gt;&lt;span lang="en-US"&gt; documentation, you&amp;#39;ll see that there is an NVMC-&amp;gt;CONFIG register where you can set the flash to read enable, write enable or erase enable. The SoftDevice takes over control of the NVMC when it&amp;#39;s running which is why you have to use the sd_flash_page_erase() API when the SoftDevice is active instead of programming the NVMC directly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en-US"&gt;When the SoftDevice is enabled,&lt;/span&gt;&lt;span lang="en-US"&gt; flash operations should be done using the sd_flash_xx api. For writing/erasing to flash,&lt;/span&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.1%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=gae5361e65cbb5e7f6e258947a394c9b55"&gt;&lt;span lang="nb-NO"&gt;sd_flash_write()&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;/ &lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.1%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga9c93dd94a138ad8b5ed3693ea38ffb3e"&gt;&lt;span lang="en-US"&gt;sd_flash_page_erase()&lt;/span&gt;&lt;/a&gt;&lt;span lang="en-US"&gt; should be used. &lt;/span&gt;&lt;span lang="en-US"&gt;If you try to access the NVMC directly when the SoftDevice is enabled, it will result in a hardfault. See&lt;/span&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.sds/dita/softdevices/s130/sd_resource_reqs/hw_block_interrupt_vector.html?cp=3_7_2_0_6_0"&gt;&lt;span lang="nb-NO"&gt;this&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;,&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_7_2_1_0_2_7_2_9#ga8b49f2e72e97291aecc18ce396956eed"&gt;&lt;span lang="nb-NO"&gt;this&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;and&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_7_2_1_0_2_7_2_7#ga9c93dd94a138ad8b5ed3693ea38ffb3e"&gt;&lt;span lang="nb-NO"&gt;this link.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en-US"&gt;To simplifying storing data to flash, the library&lt;/span&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fds.html"&gt;&lt;span lang="nb-NO"&gt;flash data storage&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang="en-US"&gt;(FDS) and &lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/fds_example.html?resultof=%22%46%6c%61%73%68%22%20%22%66%6c%61%73%68%22%20%22%44%61%74%61%22%20%22%64%61%74%61%22%20%22%53%74%6f%72%61%67%65%22%20%22%73%74%6f%72%61%67%22%20"&gt;&lt;span lang="en-US"&gt;nRF5 SDK v15.3.0: Flash Data Storage Example &lt;/span&gt;&lt;/a&gt;&lt;span lang="en-US"&gt;can be used.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>