<?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>keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108206/keep-settings-data-and-existing-bonds-during-ota-update---nrf-connect-sdk</link><description>Hi, 
 SoC: nrf52840 Environment: nRF Connect SDK v2.4.1 
 When performing OTA app upgrade all settings and bonds are gone. Settings subsystem seems to be working fine. Settings are corrently loaded at startup and data is preserved during MCU reboot. Data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Dec 2024 08:50:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108206/keep-settings-data-and-existing-bonds-during-ota-update---nrf-connect-sdk" /><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/513130?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2024 08:50:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fcb8252-52fe-4ee6-916f-3fb636d59210</guid><dc:creator>Marko W</dc:creator><description>&lt;p&gt;I have now found a solution to prevent deletion via BLE directly in the firmware.&lt;br /&gt;&lt;br /&gt;You can disable support for this by switching off the function via CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=n or the entire SMP group 63 &amp;quot;Zephyr Management Group&amp;quot; via CONFIG_MCUMGR_GRP_ZBASIC=n (erase storage is currently the only function in the group anyway).&lt;br /&gt;&lt;br /&gt;Notes: I had originally tried to solve the problem with MGMT_EVT_OP_SETTINGS... hooks, spent a lot of time and recorded BLE via Wireshark to find out that the SMP group 3 &amp;quot;Settings (Config) Management Group&amp;quot; not used.&lt;br /&gt;&lt;br /&gt;I also found when looking through the source code that there are no hooks for the SMP group 63 &amp;quot;Zephyr Management Group&amp;quot; where you could intervene in the process.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/512758?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2024 13:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:624a8f38-a3c2-44e5-86fe-3ac6c9e6eb95</guid><dc:creator>Marko W</dc:creator><description>&lt;p&gt;Hello, I have the same problem and the workaround works for me.&lt;br /&gt;But can&amp;#39;t you protect the settings from being deleted via the OTA update?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/468902?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2024 19:02:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e61cd840-3ae6-4c7e-90cc-83af0ce911ad</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using nRF Connect mobile app and I was not aware of this setting as nothing is shown during DFU update process.&lt;/p&gt;
&lt;p&gt;I can confirm that everything works fine if I disable this option.&lt;/p&gt;
&lt;p&gt;Thanks for your support!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/468785?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2024 10:40:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a313081b-325f-4df8-824e-7c2545dad6a0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Simon,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I think I know why that happens.&amp;nbsp;&lt;br /&gt;Are you using nRF Device Manager for updating ?&amp;nbsp;&lt;br /&gt;There is an option which is enabled by default that erase the application settings:&amp;nbsp;&lt;br /&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/8880.pastedimage1707907180166v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If you click on the small arrow button in Firmware Upgrade , you will find the option to not to Erase application settings.&amp;nbsp;&lt;br /&gt;&lt;span&gt;&lt;span dir="ltr"&gt;In nRF Connect app this setting is hidden in Settings/Mcu Manager options/Erase application settings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Could you please disable it and try again?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/468709?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2024 19:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b5fe14a-8466-4572-bbd5-96f2d27d1456</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I saved settings area before upgrade and then added hardcoded asm breakpoint instruction at the beggining of int main(void). With this image I made DFU update and read the same settings area after the update. It seems that DFU erased &amp;quot;settings_storage&amp;quot; section completely.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/468551?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2024 10:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:000ad624-1e21-471e-a19b-e16a303e1221</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Simon,&amp;nbsp;&lt;br /&gt;If you have an identical partitions.yml then the partition may not be the culprit here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suspect that there could be change in the setting module that may change the layout of the setting data. Causing the data mismatch.&amp;nbsp;&lt;br /&gt;Have you tried to read the setting flash area out before the&amp;nbsp;&lt;span&gt;settings_subsys_init() is called in the new firmware (maybe putting an infinite loop there, then read flash using nrfjprog.exe --memrd or nrfjprog --readcode). You would need to read flash at address&amp;nbsp;0xfe000.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You may want to compare the flash before and after DFU update to see if the setting area is overwritten or not. If the content doesn&amp;#39;t change, then it must be something changed in the settings layout causing it not able to read the bond information.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/468461?ContentTypeID=1</link><pubDate>Mon, 12 Feb 2024 16:24:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:229c1e38-16bd-4211-a738-5d4e5d48ba15</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;here is partitions.yml content. I don&amp;#39;t use static one. Content of the partitions.yml is the same between the builds. There is basically no difference between the &amp;quot;old&amp;quot; and the &amp;quot;new&amp;quot; project as I am testing update proces just between the builds.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;EMPTY_0:
  address: 0x15200
  end_address: 0x16000
  placement:
    before:
    - s1_pad
  region: flash_primary
  size: 0xe00
EMPTY_1:
  address: 0x22200
  end_address: 0x23000
  placement:
    before:
    - mcuboot_pad
  region: flash_primary
  size: 0xe00
EMPTY_2:
  address: 0xfd000
  end_address: 0xfe000
  placement:
    after:
    - mcuboot_secondary
  region: flash_primary
  size: 0x1000
app:
  address: 0x23200
  end_address: 0x90000
  region: flash_primary
  size: 0x6ce00
app_image:
  address: 0x23200
  end_address: 0x90000
  orig_span: &amp;amp;id001
  - app
  region: flash_primary
  size: 0x6ce00
  span: *id001
b0:
  address: 0x0
  end_address: 0x8000
  placement:
    after:
    - start
  region: flash_primary
  size: 0x8000
b0_container:
  address: 0x0
  end_address: 0x9000
  orig_span: &amp;amp;id002
  - b0
  - provision
  region: flash_primary
  size: 0x9000
  span: *id002
mcuboot:
  address: 0x9200
  end_address: 0x15200
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  sharers: 0x1
  size: 0xc000
mcuboot_pad:
  address: 0x23000
  end_address: 0x23200
  placement:
    align:
      start: 0x1000
    before:
    - mcuboot_primary_app
  region: flash_primary
  sharers: 0x2
  size: 0x200
mcuboot_primary:
  address: 0x23000
  end_address: 0x90000
  orig_span: &amp;amp;id003
  - mcuboot_pad
  - app
  region: flash_primary
  sharers: 0x1
  size: 0x6d000
  span: *id003
mcuboot_primary_app:
  address: 0x23200
  end_address: 0x90000
  orig_span: &amp;amp;id004
  - app
  region: flash_primary
  size: 0x6ce00
  span: *id004
mcuboot_secondary:
  address: 0x90000
  end_address: 0xfd000
  placement:
    after:
    - mcuboot_primary
    align:
      start: 0x1000
  region: flash_primary
  share_size:
  - mcuboot_primary
  size: 0x6d000
provision:
  address: 0x8000
  end_address: 0x9000
  placement:
    after:
    - b0
    align:
      start: 0x1000
  region: flash_primary
  size: 0x1000
s0:
  address: 0x9000
  end_address: 0x15200
  orig_span: &amp;amp;id005
  - s0_pad
  - mcuboot
  region: flash_primary
  size: 0xc200
  span: *id005
s0_image:
  address: 0x9200
  end_address: 0x15200
  orig_span: &amp;amp;id006
  - mcuboot
  region: flash_primary
  size: 0xc000
  span: *id006
s0_pad:
  address: 0x9000
  end_address: 0x9200
  placement:
    after:
    - b0_container
    align:
      start: 0x1000
  region: flash_primary
  share_size:
  - mcuboot_pad
  size: 0x200
s1:
  address: 0x16000
  end_address: 0x22200
  orig_span: &amp;amp;id007
  - s1_pad
  - s1_image
  region: flash_primary
  size: 0xc200
  span: *id007
s1_image:
  address: 0x16200
  end_address: 0x22200
  placement:
    after:
    - s1_pad
    - s0
  region: flash_primary
  share_size:
  - mcuboot
  size: 0xc000
s1_pad:
  address: 0x16000
  end_address: 0x16200
  placement:
    after:
    - s0
    align:
      start: 0x1000
  region: flash_primary
  share_size:
  - mcuboot_pad
  size: 0x200
settings_storage:
  address: 0xfe000
  end_address: 0x100000
  placement:
    align:
      start: 0x1000
    before:
    - end
  region: flash_primary
  size: 0x2000
sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000
&lt;/pre&gt;&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/108206/keep-settings-data-and-existing-bonds-during-ota-update---nrf-connect-sdk/468453"]Do you change anything that may change the partition allocation ?&amp;nbsp;[/quote]
&lt;p&gt;This is hard to answer. I might changed something unintentionaly.&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/108206/keep-settings-data-and-existing-bonds-during-ota-update---nrf-connect-sdk/468453"]How do you receive the image ?[/quote]
&lt;p&gt;Image is generated with default build task, generated by nRF Connect vscode plugin.&lt;/p&gt;
&lt;p&gt;For OTA update I used &amp;quot;app_update.bin&amp;quot; file from build/zephyr/&amp;nbsp;directory.&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/108206/keep-settings-data-and-existing-bonds-during-ota-update---nrf-connect-sdk/468453"]Did you use the smp_svr ?&amp;nbsp;[/quote]
&lt;p&gt;I am using mcumgr SMP:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/mgmt/mcumgr/transport/smp_bt.h&amp;gt;
...
int main(void)
{
...
    smp_bt_register();
...
}

# sleep/shutdown
smp_bt_unregister();
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Maybe it&amp;#39;s worth mentioning that I also tried to enable&amp;nbsp;Direct XIP without success. I get similar issue as described here:&lt;/p&gt;
&lt;p&gt;&lt;a id="i1" href="https://devzone.nordicsemi.com/f/nordic-q-a/102186/partition-manager-error-w-direct-xip-and-mcuboot-enabled"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/102186/partition-manager-error-w-direct-xip-and-mcuboot-enabled&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: keep Settings Data and existing bonds during OTA update - nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/468453?ContentTypeID=1</link><pubDate>Mon, 12 Feb 2024 15:47:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed8a915d-3e55-4398-b02a-3c46eeffe027</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;Please provide the&amp;nbsp;partitions.yml in the build folder or the pm_static.yml if you are using static partitions. Please provide the file for both the old project and the new project that you are updating to.&amp;nbsp;&lt;br /&gt;I suspect that the partition was changed and somehow overlapping the&amp;nbsp;setting partition.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you change anything that may change the partition allocation ?&amp;nbsp;&lt;br /&gt;How do you receive the image ? Did you use the smp_svr ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>