How to increase the size if SETTINGS_STORAGE over USB DFU?

Hi,

I have a nRF5340 with USB DFU support which uses MCUBoot for upgrades. The current build (app_version_1) on the nRF has 0x4000 as the size of the settings_storage. The new build (app_version_2) that I want to DFU needs more space in settings_storage, so I increased the size of settings_storage  to 0x6000, but after doing that, DFU over USB fails and the nRF goes back to app_version_1.

Question 1: How does a change in the settings_storage partition affect DFU of the application which resides in mcuboot_primary_app, which comes before the settings_storage?

Question 2: Is there any way of updating the partition table directly using USB DFU so that once the new partition is in effect, DFU of app_version_2 is successful?

Here is my partition table of app_version_1:

flash_primary (0x100000 - 1024kB):
+-------------------------------------------------+
| 0x0: mcuboot (0xc000 - 48kB) |
+---0xc000: mcuboot_primary (0x78000 - 480kB)-----+
| 0xc000: mcuboot_pad (0x200 - 512B) |
+---0xc200: mcuboot_primary_app (0x77e00 - 479kB)-+
| 0xc200: app (0x77e00 - 479kB) |
+-------------------------------------------------+
| 0x84000: mcuboot_secondary (0x78000 - 480kB) |
| 0xfc000: settings_storage (0x4000 - 16kB) |
+-------------------------------------------------+

otp (0x2fc - 764B):
+------------------------------+
| 0xff8100: otp (0x2fc - 764B) |
+------------------------------+

sram_primary (0x80000 - 512kB):
+-----------------------------------------------+
| 0x20000000: sram_primary (0x6e000 - 440kB) |
| 0x2006e000: pcd_sram (0x2000 - 8kB) |
| 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB) |
+-----------------------------------------------+

CPUNET flash_primary (0x40000 - 256kB):
+--------------------------------------------+
+---0x1000000: b0n_container (0x8800 - 34kB)-+
| 0x1000000: b0n (0x8600 - 33kB) |
| 0x1008600: provision (0x200 - 512B) |
+---0x1008800: app (0x37800 - 222kB)---------+
| 0x1008800: hci_rpmsg (0x37800 - 222kB) |
+--------------------------------------------+

CPUNET sram_primary (0x10000 - 64kB):
+-------------------------------------------+
| 0x21000000: sram_primary (0x10000 - 64kB) |
+-------------------------------------------+

To change the size of the settings_storage, I updated nrf/subsys/partition_manager/Kconfig

if SETTINGS
partition=SETTINGS_STORAGE
partition-size=0x6000
rsource "Kconfig.template.partition_size"
endif

This changes the layout as follows:

flash_primary (0x100000 - 1024kB):
+-------------------------------------------------+
| 0x0: mcuboot (0xc000 - 48kB) |
+---0xc000: mcuboot_primary (0x74000 - 464kB)-----+
| 0xc000: mcuboot_pad (0x200 - 512B) |
+---0xc200: mcuboot_primary_app (0x73e00 - 463kB)-+
| 0xc200: app (0x73e00 - 463kB) |
+-------------------------------------------------+
| 0x80000: mcuboot_secondary (0x74000 - 464kB) |
| 0xf4000: EMPTY_0 (0x6000 - 24kB) |
| 0xfa000: settings_storage (0x6000 - 24kB) |
+-------------------------------------------------+

otp (0x2fc - 764B):
+------------------------------+
| 0xff8100: otp (0x2fc - 764B) |
+------------------------------+

sram_primary (0x80000 - 512kB):
+-----------------------------------------------+
| 0x20000000: sram_primary (0x6e000 - 440kB) |
| 0x2006e000: pcd_sram (0x2000 - 8kB) |
| 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB) |
+-----------------------------------------------+

CPUNET flash_primary (0x40000 - 256kB):
+--------------------------------------------+
+---0x1000000: b0n_container (0x8800 - 34kB)-+
| 0x1000000: b0n (0x8600 - 33kB) |
| 0x1008600: provision (0x200 - 512B) |
+---0x1008800: app (0x37800 - 222kB)---------+
| 0x1008800: hci_rpmsg (0x37800 - 222kB) |
+--------------------------------------------+

CPUNET sram_primary (0x10000 - 64kB):
+-------------------------------------------+
| 0x21000000: sram_primary (0x10000 - 64kB) |

Parents Reply Children
No Data
Related