NCS: 2.3.0
OS: Windows 10I have a question regarding how NVS is managed with MCUboot enabled.
So the way I understand it, when MCUboot is enabled, it automatically enabled partition manager. This means all the flash partitions in the device tree are ignored.
Flash section from the custom project dts file...
PS C:\Virtuix\nordic\myapps\o1_agg_nrf52833\build> west build -t partition_manager_report
-- west build: running target partition_manager_report
[1/1] cmd.exe /C "cd /D C:\Virtuix\nordic\myapps\o1_agg_n...rtuix/nordic/myapps/o1_agg_nrf52833/build/partitions.yml" flash_primary (0x80000 - 512kB):
+-------------------------------------------------+
| 0x0: mcuboot (0x6000 - 24kB) |
+---0x6000: mcuboot_primary (0x3c000 - 240kB)-----+
| 0x6000: mcuboot_pad (0x200 - 512B) |
+---0x6200: mcuboot_primary_app (0x3be00 - 239kB)-+
| 0x6200: app (0x3be00 - 239kB) |
+-------------------------------------------------+
| 0x42000: mcuboot_secondary (0x3c000 - 240kB) |
| 0x7e000: EMPTY_0 (0x1000 - 4kB) |
| 0x7f000: nvs_storage (0x1000 - 4kB) |
+-------------------------------------------------+
This does not seem to be the case for NVS storage. I want to limit the size of NVS to as small as possible so as much flash can be used MCUboot as possible. I was told in another devzone post that the smallest number of flash pages that can be used is two (each page is 4096 bytes). One for data and one for swap.
devzone.nordicsemi.com/.../partition-manager-and-nvs-size-change
1. prj.conf
2. dts file
3. NVS init routine
If any of them do not match, I get these error messages.
[00:00:01:002] <info> nvs: Initializing flash device...
[00:00:01.002,380] <err> flash_nrf: flash_nrf_read: invalid address: 0x00080ff8:8
[00:00:01.005,859] <err> flash_nrf: flash_nrf_read: invalid address: 0x00080000:32
[00:00:01:005] <error> nvs: Error -22 occurred in nvs_mount(&nvs_fs) in ../src/nvs.c line 60. Unable to mount flash
Can someone give a thorough explanation of "how" NVS is managed when MCUboot is enabled and how it should be properly configured? Even though the above works as long as all three locations have matching configuration, it simply doesn't seem like the correct way to do it.