<?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>MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97256/mcuboot-zephyr-and-static-partition-manager</link><description>Hi! We are currently migrating our SD-based SDK code to Zephyr, on nrf52833 boards. 
 While we have finally been able to get MCUBoot ( CONFIG_BOOTLOADER_MCUBOOT =y ) to run with a static partition file, we consistently get the following log on runtime</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Mar 2023 17:01:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97256/mcuboot-zephyr-and-static-partition-manager" /><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/414469?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 17:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b61663d-c10c-47b9-8399-733240035f50</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;OK we are veering a bit off subject - so I will close this ticket and open a new one on this specific problem.&lt;br /&gt;Thanks very much Sigurd!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/414344?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 11:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bba2eff-6f75-470a-8559-c366d9bf81a1</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;I fear not - because I am still receiving &amp;quot;bt_settings: settings_subsys_init failed (err -45)&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413786?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 10:59:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f22d19e-c324-4a46-9ab4-1202a063b34f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;From &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/bluetooth-arch.html#persistent-storage"&gt;Bluetooth Persistent storage&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also find these configurations in many of our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bl.html"&gt;Bluetooth samples&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If I build the hello world sample with these configurations:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_BT=y

CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=yONFIG_SETTINGS=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I get the following partition_manager_report:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  flash_primary (0x100000 - 1024kB): 
+-------------------------------------------------+
| 0x0: mcuboot (0xc000 - 48kB)                    |
+---0xc000: mcuboot_primary (0x79000 - 484kB)-----+
| 0xc000: mcuboot_pad (0x200 - 512B)              |
+---0xc200: mcuboot_primary_app (0x78e00 - 483kB)-+
| 0xc200: app (0x78e00 - 483kB)                   |
+-------------------------------------------------+
| 0x85000: mcuboot_secondary (0x79000 - 484kB)    |
| 0xfe000: settings_storage (0x2000 - 8kB)        |
+-------------------------------------------------+

  sram_primary (0x40000 - 256kB): 
+--------------------------------------------+
| 0x20000000: sram_primary (0x40000 - 256kB) |
+--------------------------------------------+
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I see that with this, I can still not select it as chosen.&lt;/p&gt;
&lt;p&gt;But I think you do not need to choose it, as Bluetooth LE will use this to store its persistent data at that point automatically.&lt;/p&gt;
&lt;p&gt;Does that fix your issue?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413782?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 10:46:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:322e70c2-23cd-4a9a-9ac2-8f1bb3696263</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;BT settings (so LTKs and such)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413777?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 10:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40b6a9f2-bc10-4a22-88fe-28258db98a80</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;I will have a look at how to do that, but first:&lt;/p&gt;
&lt;p&gt;Quick question: What do you intend to use settings for?&lt;br /&gt;NVS? Bluetooth? Something else?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413759?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 10:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d444e312-a492-4069-8ae4-feb640a06324</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;OK, but if I remove the flash redefinition entirely, the settings_partition will no longer exist, and I will not be able to choose it for settings in &amp;quot;chosen&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413711?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 07:46:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a85043f1-5e11-4fe3-af23-c7d14a0c71ba</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Roiger"]&lt;p&gt;Hi!&lt;br /&gt;Was finally able to make this happen by:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Removing the addition lines from cmake&lt;/li&gt;
&lt;li&gt;Moving mcuboot.conf to child_image subfolder&lt;/li&gt;
&lt;li&gt;Configuring in /ncs/bootloader/mcuboot/boot/zephyr/dts.overlay to use our board&amp;#39;s UART pins in mcuboot&lt;/li&gt;
&lt;li&gt;Configuring UART logging for MCUBoot&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After this, I receive the following message:&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v3.2.99-ncs1 ***&lt;br /&gt;I: Starting bootloader&lt;br /&gt;I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3&lt;br /&gt;I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3&lt;br /&gt;I: Boot source: none&lt;br /&gt;I: Swap type: none&lt;br /&gt;I: Bootloader chainload address offset: 0x9000&lt;br /&gt;I: Jumping to the first image slot&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However - our app still doesnt run after this, but that is a different question.&lt;/p&gt;
&lt;p&gt;Thanks very much!&lt;/p&gt;[/quote]
&lt;p&gt;Good job!&lt;br /&gt;And thanks for posting a detailed explanation of what you did.&lt;/p&gt;
[quote user="Roiger"]How would I go about adding an overlay for mcuboot without having to alter /ncs/bootloader/mcuboot/boot/zephyr/dts.overlay?[/quote]
&lt;p&gt;From &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/ug_multi_image.html"&gt;Multi Image builds&lt;/a&gt;: &lt;/p&gt;
&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/pastedimage1678174411910v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So child_image/mcuboot/boards/board_name.overlay.&lt;br /&gt;Or just child_image/mcuboot.overlay&lt;/p&gt;
[quote user="Roiger"]My question was if it matters how much empty space exists after MCUboot, per your suggestion. You stated that I may downsize the partition from default 48 KB to 0x9000 (since MCUBoot size for us is currently 0x871b if I recall correctly). My question was if there is some &amp;quot;must&amp;quot; for MCUBoot parition to be the exact size of the actual MCUBoot.\[/quote]
&lt;p&gt;The partition may be larger than the actual MCUboot build.&lt;/p&gt;
&lt;p&gt;And it often has to be.&lt;br /&gt;I know that for example for the nRF5340 or the nRF9160, the MCUboot can not share codepages with the application, for security.&lt;br /&gt;I do not know exactly how this works for the nRF52833, but I will try to figure it out. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/95599/partition-manager-not-using-flash-efficiently"&gt;Partition Manager not using flash efficiently&lt;/a&gt; for some discussion on the MCUboot partitioning.&lt;/p&gt;
&lt;p&gt;In your build log, you can see an overview of the MCUboot partition:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[190/190] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       33676 B        48 KB     68.51%
             RAM:       17792 B       256 KB      6.79%
        IDT_LIST:          0 GB         2 KB      0.00%
&lt;/pre&gt;&lt;/p&gt;
[quote user="Roiger"]So should I remove the flash redefinition section entirely?[/quote]
&lt;p&gt;Yes&lt;/p&gt;
[quote user="Roiger"]How would I go about marking the settings partition for code (&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; zephyr,settings-partition = &amp;amp;settings_partition;)?[/quote]
&lt;p&gt;Setting &amp;quot;chosen&amp;quot; are still done in dts overlays.&lt;br /&gt;For example, if you need to add &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/scripts/partition_manager/partition_manager.html#external-flash-memory-partitions"&gt;external flash for the partition manager&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	chosen {
		nordic,pm-ext-flash = &amp;amp;mx25r64;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413617?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 16:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d49d1bd0-a425-41a1-adb7-86c50097438a</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;How would I go about adding an overlay for mcuboot without having to alter /ncs/bootloader/mcuboot/boot/zephyr/dts.overlay?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413616?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 16:35:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09692d80-9bad-4333-be8c-99f8896084cd</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi!&lt;br /&gt;Was finally able to make this happen by:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Removing the addition lines from cmake&lt;/li&gt;
&lt;li&gt;Moving mcuboot.conf to child_image subfolder&lt;/li&gt;
&lt;li&gt;Configuring in /ncs/bootloader/mcuboot/boot/zephyr/dts.overlay to use our board&amp;#39;s UART pins in mcuboot&lt;/li&gt;
&lt;li&gt;Configuring UART logging for MCUBoot&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After this, I receive the following message:&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v3.2.99-ncs1 ***&lt;br /&gt;I: Starting bootloader&lt;br /&gt;I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3&lt;br /&gt;I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3&lt;br /&gt;I: Boot source: none&lt;br /&gt;I: Swap type: none&lt;br /&gt;I: Bootloader chainload address offset: 0x9000&lt;br /&gt;I: Jumping to the first image slot&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However - our app still doesnt run after this, but that is a different question.&lt;/p&gt;
&lt;p&gt;Thanks very much!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413543?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 13:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99e3c708-aa6c-4a71-a2b6-d184f5c5eed7</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Reegarding the override - I think the CMake line simply appends:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;)&lt;br /&gt; list(APPEND mcuboot_OVERLAY_CONFIG&lt;br /&gt; &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;&lt;br /&gt; )&lt;br /&gt;endif()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and I can see in the build log that it merges mcuboot.conf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413535?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 12:52:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5641ef7a-7a62-4b8a-99f9-54fa34067329</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I have tried with the child_image folder as suggested - it now seems that it is not working at all, or at least not logging the boot message to RTT as it did before&lt;/li&gt;
&lt;li&gt;My question was if it matters how much empty space exists after MCUboot, per your suggestion. You stated that I may downsize the partition from default 48 KB to 0x9000 (since MCUBoot size for us is currently 0x871b if I recall correctly). My question was if there is some &amp;quot;must&amp;quot; for MCUBoot parition to be the exact size of the actual MCUBoot.\&lt;/li&gt;
&lt;li&gt;So should I remove the flash redefinition section entirely? How would I go about marking the settings partition for code (&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; zephyr,settings-partition = &amp;amp;settings_partition;)?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413520?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 12:26:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58be1a48-3cdd-4c1e-9a92-c9d02fb112c3</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;I see now that you write:&lt;/p&gt;
[quote user=""]&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;mcuboot.conf (merged via edit to CMakeLists):&lt;/strong&gt;&lt;/span&gt;[/quote]
&lt;p&gt;How do you merge this?&lt;/p&gt;
&lt;p&gt;I suspect you overwrite default MCUboot configurations instead of overlaying them.&lt;br /&gt;This might cause you to miss flash drivers (CONFIG_FLASH) in your MCUboot configuration.&lt;/p&gt;
&lt;p&gt;Instead of adding mcuboot.conf via CMake, try to use a child_image/ folder instead. (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/multi_image/index.html"&gt;docs&lt;/a&gt; and &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart"&gt;sample&lt;/a&gt;)&lt;/p&gt;
[quote user="Roiger"]&lt;span&gt;I understand from your comment that I may resize the static partition for mcuboot according to the actual size - does it mean I HAVE to for mcuboot to work?&lt;/span&gt;[/quote]
&lt;p&gt;I do not understand the question.&lt;/p&gt;
&lt;p&gt;If you use a single bootloader, the partitioning must never change when doing DFU.&lt;/p&gt;
[quote user="Roiger"]&lt;span&gt;In the DTS overlay - does that mean that image-0 needs to include the mcuboot_pad or not?&lt;/span&gt;[/quote]
&lt;p&gt;If you use MCUboot, the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html"&gt;Partition Manager&lt;/a&gt; will be enabled.&lt;br /&gt;The partition manager will override any DTS overlays for partitioning. =&amp;gt; The DTS overlay will best case, be ignored.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413383?ContentTypeID=1</link><pubDate>Sun, 05 Mar 2023 12:40:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4508b598-c699-4e6e-ad20-1ee915d65088</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;I have in addition changed the static partitioning + DTS overlay to match the smaller MCUBoot + enlarged &lt;span&gt;CONFIG_BOOT_MAX_IMG_SECTORS&amp;nbsp;to 256 per your suggestion&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;pm_static.yml:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;app:
  address: 0x9200
  end_address: 0x3b000
  region: flash_primary
  size: 0x31e00
mcuboot:
  address: 0x0
  end_address: 0x9000
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  size: 0x9000
mcuboot_pad:
  address: 0x9000
  end_address: 0x9200
  placement:
    align:
      start: 0x1000
    before:
    - mcuboot_primary_app
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0x9000
  end_address: 0x3b000
  orig_span: &amp;amp;id001
  - mcuboot_pad
  - app
  region: flash_primary
  sharers: 0x1
  size: 0x32000
  span: *id001
mcuboot_primary_app:
  address: 0x9200
  end_address: 0x3b000
  orig_span: &amp;amp;id002
  - app
  region: flash_primary
  size: 0x31e00
  span: *id002
mcuboot_secondary:
  address: 0x3b000
  end_address: 0x6d000
  placement:
    after:
    - mcuboot_primary
    align:
      start: 0x1000
  region: flash_primary
  share_size:
  - mcuboot_primary
  size: 0x32000
scratch_partition:
  address: 0x6d000
  end_address: 0x77000
  placement:
    align:
      start: 0x1000
  region: flash_primary
  size: 0xa000
settings_storage:
  address: 0x77000
  end_address: 0x79000
  placement:
    align:
      start: 0x1000
  region: flash_primary
  size: 0x3000
storage_partition:
  address: 0x7A000
  end_address: 0x80000
  placement:
    align:
      start: 0x1000
  region: flash_primary
  size: 0x6000
sram_primary:
  address: 0x20000000
  end_address: 0x20020000
  region: sram_primary
  size: 0x20000
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;DTS (relevant part):&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/delete-node/ &amp;amp;boot_partition;
/delete-node/ &amp;amp;slot0_partition;
/delete-node/ &amp;amp;slot1_partition;
/delete-node/ &amp;amp;scratch_partition;
/delete-node/ &amp;amp;storage_partition;
&amp;amp;flash0 {

	partitions {
		compatible = &amp;quot;fixed-partitions&amp;quot;;
		#address-cells = &amp;lt;1&amp;gt;;
		#size-cells = &amp;lt;1&amp;gt;;

		boot_partition: partition@0 {
			label = &amp;quot;mcuboot&amp;quot;;
			reg = &amp;lt;0x00000000 0x9000&amp;gt;;
		};
		slot0_partition: partition@9000 {
			label = &amp;quot;image-0&amp;quot;;
			reg = &amp;lt;0x00009000 0x31e00&amp;gt;;
		};
		slot1_partition: partition@3b000 {
			label = &amp;quot;image-1&amp;quot;;
			reg = &amp;lt;0x0003B000 0x32000&amp;gt;;
		};
		scratch_partition: partition@6d000 {
			label = &amp;quot;image-scratch&amp;quot;;
			reg = &amp;lt;0x0006D000 0xA000&amp;gt;;
		};
		settings_partition: partition@77000 {
			label = &amp;quot;settings&amp;quot;;
			reg = &amp;lt;0x00077000 0x00003000&amp;gt;;
		};
        storage_partition: partition@7a000 {
			label = &amp;quot;storage&amp;quot;;
			reg = &amp;lt;0x0007A000 0x00006000&amp;gt;;
		};
	};
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am still receiving the error of 256 sectors being too small&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413382?ContentTypeID=1</link><pubDate>Sun, 05 Mar 2023 11:59:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e3b6801-d880-4303-a451-5eece443c2f1</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi Sigurd!&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Our SDK is 2.2.0, and our hardware is custom hardware but is based on nrf52833 as the MCU.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When I raised&amp;nbsp;&lt;span&gt;CONFIG_BOOT_MAX_IMG_SECTORS&amp;nbsp;to 256 in mcuboot.conf, I still get the following:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; *** Booting Zephyr OS build v3.2.99-ncs1 ***
00&amp;gt; I: Starting bootloader
00&amp;gt; W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=256 - too small?
00&amp;gt; W: Cannot upgrade: not a compatible amount of sectors
00&amp;gt; E: Unable to find bootable image&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;We do not have external flash.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Thanks for the explanation about alignment and pad! A few followup questions:&lt;/span&gt;&lt;span&gt;&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;I understand from your comment that I may resize the static partition for mcuboot according to the actual size - does it mean I HAVE to for mcuboot to work?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;In the DTS overlay - does that mean that image-0 needs to include the mcuboot_pad or not?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;Thanks!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Roi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413261?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2023 13:12:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bbd5960-5665-42be-95b1-8d3fc0522f54</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I took the liberty to clean up your post using Insert-&amp;gt;Code.&lt;/p&gt;
&lt;p style="margin:0;padding:0;text-align:left;"&gt;For us to help you with this in the best possible way, please list the following information:&lt;/p&gt;
&lt;ul style="list-style-type:disc;margin:0;text-align:left;"&gt;
&lt;li&gt;SDK Version&lt;/li&gt;
&lt;li&gt;Development Kit Version&lt;/li&gt;
&lt;li&gt;Do you use custom hardware or code?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tip:&lt;br /&gt;VS Code -&amp;gt; Memory Report -&amp;gt; Partitions is handy for looking at MCUboot partitioning.&lt;br /&gt;I took your configurations and added them to the hello world example. v2.2.0, nrf52833dk_nrf52833. &lt;br /&gt;Then from Actions-&amp;gt;Memory Report-&amp;gt;Partitions:&lt;/p&gt;
&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/pastedimage1677846427318v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Alternatively, I personally prefer the command line: &amp;quot;west build -t partition_manager_report&amp;quot;:&lt;/p&gt;
&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/pastedimage1677846618502v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Now, onto your questions:&lt;/p&gt;
[quote user=""]I have created the partition manager file (pm_static.yml) from the original build of our project, and added partitions to match our dts overlay (both are at bottom). The default setup causes s.t. the bootloader. which is much smaller than the default of 0xC000 = 48 KB for MCUboot, to sit apart from the mcuboot_pad and the app more than needed (see picture from nrfConnect Programmer below). What is the correct way to work with this?[/quote]
&lt;p&gt;You can change the size of the MCUboot partition in the static partitioning. &lt;br /&gt;From the build log, we can see how much space your MCUboot image is using: &lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Memory region         Used Size  Region Size  %age Used
           FLASH:       34652 B        48 KB     70.50%
             RAM:       23808 B       128 KB     18.16%
        IDT_LIST:          0 GB         2 KB      0.00%&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I suggest you try configuring MCUboot to use less space and then set the partition to 32KiB (0x8000).&lt;br /&gt;Yes, changing the partition size means you must manually move all the other partitions. &lt;br /&gt;See the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot/prj.conf"&gt;prj.conf of the machine learning example&lt;/a&gt; for tips on decreasing the footprint.&lt;/p&gt;
&lt;p&gt;FYI: Do not give up on static partitioning, though. If you use a single bootloader, static partitioning is &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration"&gt;mandatory&lt;/a&gt;.&lt;/p&gt;
[quote user=""]If I try to remove the mcuboot_pad totally, I consistently receive a failure of the static partition manager on build: &amp;quot;Partition manager failed: End of last partition is after last valid address&amp;quot;. Why is this? Is the pad a must?[/quote]
&lt;p&gt;I think the pad is where MCUboot stores metadata about images. &lt;br /&gt;So yes, you must use mcuboot_pad.&lt;/p&gt;
[quote user=""]In the default partition manager (As you can see below), alignment is consistently used (&amp;quot;align: start: 0x1000&amp;quot;). Is there a specific reason for this?[/quote]
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/24624/is-it-possible-to-change-the-flash-page-size-of-nrf52"&gt;Is it possible to change the flash page size of nrf52&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;For the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/ficr/doc/ficr.html?cp=4_0_0_4_3_1_0_7#register.INFO.CODEPAGESIZE"&gt;FICR.INFO.CODEPAGESIZE for nrf5340&lt;/a&gt;, it says it should be 0x1000. I kind of would expect the same in &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/ficr.html?cp=5_1_0_3_3_0_0#register.CODEPAGESIZE"&gt;FICR.CODEPAGESIZE for the nrf52833&lt;/a&gt;, but it is not. Unsure if it is possible to change it or if this is a documentation bug. &lt;br /&gt;However, I think it is a good idea to align it with 0x1000 either way, as I think most of our partitioning does this by default, and it can be argued using 0x1000 alignment will make the project more portable.&lt;/p&gt;
[quote user=""]The big one - &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;what is the reason that the aforementioned mcuboot print is received?&lt;/strong&gt;&lt;/span&gt;[/quote]
&lt;p&gt;In my experience, the error&amp;nbsp; &amp;quot;W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?&amp;quot; can mean two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;CONFIG_BOOT_MAX_IMG_SECTORS is too small. Try setting this to 256 in mcuboot.conf.&lt;/li&gt;
&lt;li&gt;The external flash driver has not been initialized for MCUboot.&lt;br /&gt;Have you configured &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/bootloaders_and_dfu/bootloader_external_flash.html"&gt;Using external flash memory partitions&lt;/a&gt;, and more specifically, &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#pm-external-flash"&gt;External flash memory partitions&lt;/a&gt;?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot, Zephyr, and static partition manager</title><link>https://devzone.nordicsemi.com/thread/413076?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 15:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef6f1a6b-1db4-4031-8743-e4ddc4a6f723</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Forgot to add image from nrfConnect Programmer:&lt;/p&gt;
&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/pastedimage1677769455982v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>