<?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>Access flash memory using SoftDevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84219/access-flash-memory-using-softdevice</link><description>hi, 
 How can I access flash memory of nRF52840 while using softdevice ? I just want to read and update two integer values? is there any simple way to do this? 
 
 Thank you !</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Feb 2022 04:55:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84219/access-flash-memory-using-softdevice" /><item><title>RE: Access flash memory using SoftDevice</title><link>https://devzone.nordicsemi.com/thread/350551?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 04:55:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8463504-5fec-47e5-88de-03c085fec0c9</guid><dc:creator>Yashodha</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;&lt;br /&gt;Thanks all. I solve my issue. The&amp;nbsp;flash_fds example was really useful in this case&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Access flash memory using SoftDevice</title><link>https://devzone.nordicsemi.com/thread/350408?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 12:12:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00a53119-332f-4063-b800-611f9dd34ba4</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For flash, it is important to note that erase operations can only be done for full flash pages (4 kB on the nRF52 series). The erase will set all bits to 1, i.e. all bytes will be 0xFF after the erase, and writes can then flip bits to 0 (but not back to 1 again.) Any update that means a bit should go from 0 to 1, means the full flash page must be erased, then re-written. The issue with rewrites is that flash gets worn down after several thousand write/erase cycles. In order to work within those limitations, it is usually best to use a library that provides an abstraction to write/update/delete flash records, and not use flash addresses directly.&lt;/p&gt;
&lt;p&gt;In nRF5 SDK you will find the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Flib_fds.html"&gt;Flash Data Storage (FDS)&lt;/a&gt; library, which lets you write &amp;quot;records&amp;quot; to flash, where you identify data not by the address where it is located, but using two sets of identifiers called &amp;quot;File ID&amp;quot; and &amp;quot;Record Key&amp;quot;. It is up to you how you want to use one or both of those identifiers to organize your data. FDS can run with two different backends, one for when you do not use a SoftDevice, and one for when you do have a SoftDevice. See also the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Ffds_example.html"&gt;Flash Data Storage Example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If for some reason you do need to write data to a specific flash location, you could have a look at the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Flib_fstorage.html"&gt;Flash Storage (fstorage)&lt;/a&gt; library. It lets you access flash directly, but it also means you must take care of all the details yourself regarding how flash works and how many erase cycles are guaranteed to work before bits may start misbehaving.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Access flash memory using SoftDevice</title><link>https://devzone.nordicsemi.com/thread/350337?ContentTypeID=1</link><pubDate>Sun, 30 Jan 2022 17:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dccf5e68-8ca6-4c27-abc9-0f6d99fb92ec</guid><dc:creator>sipan112</dc:creator><description>&lt;p&gt;hi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The flash memory accesses are scheduled to not disturb radio events. &lt;/span&gt;&lt;span&gt;&amp;nbsp;If the protocol radio events are in a critical state, flash memory accesses may be delayed for a long period resulting in a time-out event. In this case, NRF_EVT_FLASH_OPERATION_ERROR will be returned in the application event handler. If this happens, retry the flash memory operation. Examples of typical critical phases of radio events include connection setup, connection update, disconnection, and impending supervision time-out.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>