<?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>Using zephyr or nrfxlib to manipulate flash area</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95687/using-zephyr-or-nrfxlib-to-manipulate-flash-area</link><description>Hello 
 
 In pm_static.yml I defined a flash partition, intended to save some NV-flags for the application, which should survive OTA/DFU updates. 
 The project uses BLE for OTA/DFU and for application communication. 
 To erase / write I used the zephyr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Jan 2023 13:12:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95687/using-zephyr-or-nrfxlib-to-manipulate-flash-area" /><item><title>RE: Using zephyr or nrfxlib to manipulate flash area</title><link>https://devzone.nordicsemi.com/thread/405259?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 13:12:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02620830-9974-4639-9fb2-d676d9fc7a4e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Gera64"]Can you please provide me a link to some example using the&amp;nbsp;&lt;span&gt;&lt;strong&gt;sdc_soc_flash&lt;/strong&gt; API?&lt;/span&gt;[/quote]
&lt;p&gt;You can see the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/softdevice_controller/doc/api.html#c.sdc_soc_flash_write_async"&gt;MPSL API documentation&lt;/a&gt;. You don&amp;#39;t need any specific config as long as MPSL is enbled (which is is if you are using the SoftDevice Controller, which is the default Bluetooth controller in the nRF Connect SDK. The only thing you need to do is include sdc_soc.h in the file where you use it.&lt;/p&gt;
[quote user="Gera64"]Btw.: I can not find an actual page with an explanation of &lt;strong&gt;CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL&lt;/strong&gt;&amp;nbsp;, just older zephyr versions &lt;strong&gt;1.x&lt;/strong&gt;[/quote]
&lt;p&gt;You don&amp;#39;t need to think about &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL"&gt;CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL&lt;/a&gt;&amp;nbsp;as it will be enabled by default when you use MPSL. You can search in the code if you are interested to see how it is used (and if you look at the generated .config you should see it is enable din your projects that use the MPSL).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using zephyr or nrfxlib to manipulate flash area</title><link>https://devzone.nordicsemi.com/thread/405226?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 12:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f7202b0-b1ac-4f5d-a304-e536d75e3286</guid><dc:creator>Gera64</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Many thanks!&lt;br /&gt;Can you please provide me a link to some example using the&amp;nbsp;&lt;span&gt;&lt;strong&gt;sdc_soc_flash&lt;/strong&gt; API? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What file should I include in my project to gain access to the&amp;nbsp;sdc_soc_flash API - elements? What CONFIG_xx&amp;#39;s should be set in my proj.conf for that?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Btw.: I can not find an actual page with an explanation of &lt;strong&gt;CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL&lt;/strong&gt;&amp;nbsp;, just older zephyr versions &lt;strong&gt;1.x&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Gerardo&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using zephyr or nrfxlib to manipulate flash area</title><link>https://devzone.nordicsemi.com/thread/405188?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 10:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d59dd45b-25ef-4399-8172-419b8691edba</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&amp;nbsp;You can use the Zephyr flash APIs as well, as demonstrated by the&amp;nbsp;soc_flash_nrf sampel you referred to. If you combine this sample with a BT sample where MPSL is enabled step through you will see you end up in flash_sync_mpsl.c with the default configuration, which is&amp;nbsp;CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL enabled. You can see an example of that here: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/peripheral_5F00_hr_5F00_with_5F00_flash_5F00_write.zip"&gt;devzone.nordicsemi.com/.../peripheral_5F00_hr_5F00_with_5F00_flash_5F00_write.zip&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you always use MPSL and don&amp;#39;t need to support a situation without it, it does perhaps make more sense to use the&amp;nbsp;sdc_soc_flash API, though. This is very simple, with two functions (one for writing and one for page erase), and you provide a callback function which handles one of two results (timeout or success).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using zephyr or nrfxlib to manipulate flash area</title><link>https://devzone.nordicsemi.com/thread/405107?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 16:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fed606fe-269e-451d-94e5-9cd646999013</guid><dc:creator>Gera64</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Since the amount of information to be stored is big (long time loggging information), the overhead caused by NVS, LittleFS or other systems would be too space consuming, since the device has to have also DFU/FOTA capability (which in turn almost halves the application space size...). That&amp;#39;s why I would prefer to write the flash on a&amp;nbsp;32-bit word basis.&lt;/p&gt;
&lt;p&gt;As far as I understood, with the nrf Connect SDK 2.2.x, when using BLE, a sort of SoftDevice emulation is used. &lt;br /&gt;Can&amp;nbsp;I therefore safely use the Zephyr flash API (&lt;a href="https://docs.zephyrproject.org/latest/hardware/peripherals/flash.html"&gt;Flash &amp;mdash; Zephyr Project Documentation&lt;/a&gt;)?&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Gerardo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using zephyr or nrfxlib to manipulate flash area</title><link>https://devzone.nordicsemi.com/thread/405037?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 12:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82609849-6032-4236-ba42-9ae43b34c1d1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Gerardo,&lt;/p&gt;
&lt;p&gt;You cannot access the flash directly via (nrfx or otherwise) when using the SoftDevice Controller. You can use higher level Zephyr APIs (like NVS), or use the sdc_soc_flash* functions if you want to have full control yourself but. You may also want to consider storing your data in &lt;a href="https://docs.zephyrproject.org/3.2.0/services/settings/index.html"&gt;Settings subsystem&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that if you only have a limited set of data&amp;nbsp; you need to store, and they never change, then putting the data in the UICR might be the simplest (that is special flash that is never touched during DFU).&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>