<?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>nRF5340 - Setting Feature with Custom Partition</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104789/nrf5340---setting-feature-with-custom-partition</link><description>1. nRF Connect SDK: v2.3 
 2. Problem Description / Question 
 I&amp;#39;m currently working on implementing a settings feature using either NVS or a file system (NVS preferred), alongside existing Bluetooth (BT) and l ittleFS functionality in my project. 
 Here</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Oct 2023 13:31:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104789/nrf5340---setting-feature-with-custom-partition" /><item><title>RE: nRF5340 - Setting Feature with Custom Partition</title><link>https://devzone.nordicsemi.com/thread/452002?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 13:31:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9593ed3b-095d-495b-9b8a-e48f90fd238f</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Apologies for the delayed response, I had to check up on some things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In general we don&amp;#39;t recommend you to remove the settings_partition that Bluetooth and/or Matter uses as this is a persistent part of the memory&lt;/li&gt;
&lt;li&gt;After some input from the creator of the sample you refer to from&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/97525/setting-and-using-nvs-and-bt-settings-with-static-partition-manager"&gt;Setting and using NVS and BT Settings with Static Partition Manager&lt;/a&gt;&amp;nbsp;:&lt;br /&gt;Adding another settings partition should be relatively straight forward, and can be done by
&lt;ol&gt;
&lt;li&gt;Adding a new partition in pm_static.yml&lt;/li&gt;
&lt;li&gt;Change this line:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/32a51d982e0b7eba7e458678a8246440b25c3916/samples/subsys/settings/src/main.c#L20"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/32a51d982e0b7eba7e458678a8246440b25c3916/samples/subsys/settings/src/main.c#L20&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
[quote user="skim"]If I disable it, will the BT_SETTINGS feature be&amp;nbsp;entirely deactivated? Would I then be responsible for handing the storage and restoration of BT state (including pairing keys)? If so, how should I proceed?[/quote]
&lt;p&gt;As the other case you refer to states, this is possible and the sample that Sigurd has provided showcases how to do this. Item number 1 in my previous list explains why you should not disable bt_settings and thus remove the persistant storage for the wireless protocols that use it.&amp;nbsp;&lt;/p&gt;
[quote user="skim"]a) Define a partition in the &amp;#39;external_flash&amp;#39; area using pm_static.yml (Currently, it is defined in the &amp;#39;primary_flash&amp;#39; area as a name of &lt;strong&gt;custom_nvs_storage&lt;/strong&gt;)[/quote]
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#external-flash-memory-partitions"&gt;developer.nordicsemi.com/.../partition_manager.html&lt;/a&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#external-flash-memory-partitions"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/32a51d982e0b7eba7e458678a8246440b25c3916/samples/subsys/settings/src/main.c#L20 &lt;/a&gt;and the Note in that section should explain how to do this&lt;/p&gt;
&lt;p&gt;Regarding b) and c) I also believe that this should be handled by the sample Sigurd created. I will look closer into the sample at the end of this week, but in the meanwhile I hope this is enough to keep you going&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - Setting Feature with Custom Partition</title><link>https://devzone.nordicsemi.com/thread/451571?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 21:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffb6826f-2a98-4e15-ae0a-ec333ea96696</guid><dc:creator>skim</dc:creator><description>&lt;p&gt;Hello, I apologize for the truncated image. Here is the textual representation of the kernel error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ASSERTION FAIL [handler != ((void *)0)] @ WEST_TOPDIR/zephyr/kernel/work.c:667
[00:00:00.807,373] &amp;lt;err&amp;gt; os: esf_dump: r0/a1:  0x00000004  r1/a2:  0x0000029b  r2/a3:  0x00000024
[00:00:00.807,403] &amp;lt;err&amp;gt; os: esf_dump: r3/a4:  0x0000029b r12/ip:  0xb6a93df4 r14/lr:  0x000351a7
[00:00:00.807,434] &amp;lt;err&amp;gt; os: esf_dump:  xpsr:  0x61100000
[00:00:00.807,495] &amp;lt;err&amp;gt; os: esf_dump: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
[00:00:00.807,525] &amp;lt;err&amp;gt; os: esf_dump: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
[00:00:00.807,556] &amp;lt;err&amp;gt; os: esf_dump: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
[00:00:00.252,716] &amp;lt;dbg&amp;gt; nrf5340dk_nrf5340_cpuapp: remoteproc_mgr_boot: Network MCU released.
[00:00:00.807,617] &amp;lt;err&amp;gt; os: esf_dump: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
[00:00:00.807,647] &amp;lt;err&amp;gt; os: esf_dump: fpscr:  0x00000000
[00:00:00.807,678] &amp;lt;err&amp;gt; os: esf_dump: Faulting instruction address (r15/pc): 0x0003cce8
[00:00os: z_fatal_error: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:00.807,769] &amp;lt;err&amp;gt; os: z_fatal_error: Current thread: 0x20001ed8 (unknown)
[00:00:00.975,769] &amp;lt;err&amp;gt; os: k_sys_fatal_error_handler: Halting system&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;During my investigation into the issue, I managed to find a way to run the project without encountering the kernel error. This involved disabling the&lt;strong&gt; CONFIG_BT_SETTINGS.&amp;nbsp;&lt;/strong&gt;The documentation regarding this config value states,&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;&amp;quot;When selected, the Bluetooth stack will take care of storing (and restoring) the Bluetooth state (e.g. pairing keys) and configuration persistently in flash&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is my question:&lt;/p&gt;
&lt;p&gt;If I disable it, will the BT_SETTINGS feature be&amp;nbsp;entirely deactivated? Would I then be responsible for handing the storage and restoration of BT state (including pairing keys)? If so, how should I proceed?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another unresolved issue is that I want to&lt;/p&gt;
&lt;p&gt;a) Define a partition in the &amp;#39;external_flash&amp;#39; area using pm_static.yml (Currently, it is defined in the &amp;#39;primary_flash&amp;#39; area as a name of &lt;strong&gt;custom_nvs_storage&lt;/strong&gt;)&lt;/p&gt;
&lt;p&gt;b)&amp;nbsp;Utilize it as the backend for Settings in the overlay using &amp;#39;zephyr, settings-partition&amp;#39;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;c) Ensure that the memory area used by BT_SETTING is separated from the memory area used by regular Settings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here I am attaching the project that I combines a project from the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/97525/setting-and-using-nvs-and-bt-settings-with-static-partition-manager"&gt;devzone&lt;/a&gt;&amp;nbsp;and Settings sample. This project shouldn&amp;#39;t build because I added a line in the overlay file to link settings&amp;#39; NVS and a custom_nvs_storage, and the system cannot find the custom partition.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bt_5F00_setting_5F00_sample_5F00_from_5F00_devzone.zip"&gt;devzone.nordicsemi.com/.../bt_5F00_setting_5F00_sample_5F00_from_5F00_devzone.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Feel free to let me know if you&amp;#39;d like further clarification or edits.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Skim.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - Setting Feature with Custom Partition</title><link>https://devzone.nordicsemi.com/thread/451297?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 12:11:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e937759-71c2-40eb-9dc2-eb4132456adb</guid><dc:creator>AHaug</dc:creator><description>[quote user="skim"]1. Here is a screenshot of a kernel fatal error.&amp;nbsp;[/quote]
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697717381742v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;What is posted beneath here? What is posted above the line? I need the entire log to be able to cipher anything from it. Please upload it as a text or insert code&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697717425579v2.png" alt=" " /&gt;&lt;/p&gt;
[quote user="skim"]2. Here is a screenshot of a memory map[/quote]
&lt;p&gt;This image is also cut off, can you reupload a full picture including all numbers&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - Setting Feature with Custom Partition</title><link>https://devzone.nordicsemi.com/thread/451157?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 23:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07685839-40c9-4559-88eb-f16feb4e5ee8</guid><dc:creator>skim</dc:creator><description>&lt;p&gt;1. Here is a screenshot of a kernel fatal error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2023_2D00_10_2D00_18-161108.png" /&gt;&lt;/p&gt;
&lt;p&gt;2. Here is a screenshot of a memory map&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2023_2D00_10_2D00_18-161408.png" /&gt;&lt;/p&gt;
&lt;p&gt;3. Here is a pm_static.yml file for each case&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pm_5F00_static_5F00_ext_5F00_flash.txt"&gt;devzone.nordicsemi.com/.../pm_5F00_static_5F00_ext_5F00_flash.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pm_5F00_static_5F00_flash_5F00_prim.txt"&gt;devzone.nordicsemi.com/.../pm_5F00_static_5F00_flash_5F00_prim.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Sungji Kim.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - Setting Feature with Custom Partition</title><link>https://devzone.nordicsemi.com/thread/451065?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 12:35:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e91cee6b-e1ce-4193-b3fe-d9373d443f37</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For all three cases, can you also provide the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Can you provide the full build errors and/or device logs?&lt;/li&gt;
&lt;li&gt;Can you provide the memory map, i.e use VS Code extensions tool or navigate to the build folder and report back what &amp;quot;&lt;em&gt;ninja partition_manager_report&lt;/em&gt;&amp;#39; generates?&lt;/li&gt;
&lt;li&gt;If you have a static_pm.yml for each of the cases, can you provide that as well?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>