<?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>west build generates large EMPTY partitions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92406/west-build-generates-large-empty-partitions</link><description>I am trying to make a build with a slightly modified copy of the Zephyr button example on a nrf9160 board with a upgradable bootloader. 
 The following command can build our firmware: 
 west build --build-dir build/SG1500-board-tester --board ${BOARD</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Oct 2022 07:50:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92406/west-build-generates-large-empty-partitions" /><item><title>RE: west build generates large EMPTY partitions</title><link>https://devzone.nordicsemi.com/thread/389942?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2022 07:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34d4f2fc-cd43-4e24-9748-3614166f3c51</guid><dc:creator>maarten v</dc:creator><description>&lt;p&gt;Thank you for the clarification.&lt;/p&gt;
&lt;p&gt;I already found&amp;nbsp;CONFIG_PM_PARTITION_SIZE_MCUBOOT and CONFIG_PM_PARTITION_SIZE_MCUBOOT_PAD and the EMPTY_0 and EMPTY_1 partitions are now minimal.&lt;/p&gt;
&lt;p&gt;I understand now, the&amp;nbsp;&lt;span&gt;mcuboot_primary and&amp;nbsp;mcuboot_secondary will get the same size resulting in an empty_2 partition.&amp;nbsp;So i can either reduce or enlarge the&amp;nbsp;data_partition_flash by 32k to get rid of the EMPTY_2 partition. Ill try that later.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build generates large EMPTY partitions</title><link>https://devzone.nordicsemi.com/thread/389795?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2022 10:51:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f07fa907-226a-4cbf-93a5-30723d0f346d</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="maarten v"]We only think we need the upgradable bootloader be able to update the&amp;nbsp;encryption/signing keys of FOTA images. Do we indeed need an upgradeble bootloader for that or can that be done in another way?[/quote]
&lt;p&gt;Yes, having an upgradable bootloader is the only way to do it securely.&lt;/p&gt;
&lt;p&gt;There are a couple of other possibilities though:&lt;/p&gt;
&lt;p&gt;1. If you can reduce the size of the data_flash_partition with 32kB, that will give the application 32kB, and remove the EMPTY_2 partition (one 32kB goes to the primary slot, the other 32kB goes to the secondary slot).&lt;/p&gt;
&lt;p&gt;2. If you add an external flash, you can move the secondary slot to the external flash. This will let you double the size and add 32kB for the application (the extra 32kB comes from the EMPTY_2 partition), and if you also move the data_flash_partition to the external flash, you free up another 64kB for the application.&lt;/p&gt;
&lt;p&gt;3. I don&amp;#39;t know how well this will work in practice, but at least in theory, you might be able to modify CONFIG_PM_PARTITION_SIZE_MCUBOOT and CONFIG_PM_PARTITION_SIZE_MCUBOOT_PAD, so their sum is &amp;lt;= 32kB, while still fitting all the information they need. If you manage that, that should remove the need for the EMPTY_0 and EMPTY_1 partitions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build generates large EMPTY partitions</title><link>https://devzone.nordicsemi.com/thread/389327?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2022 08:19:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1176759-1ca6-427a-872c-a59a396f40d8</guid><dc:creator>maarten v</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Unfortunately wasting this much memory is not an option for us.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We only think we need the upgradable bootloader be able to update the&amp;nbsp;encryption/signing keys of FOTA images. Do we indeed need an upgradeble bootloader for that or can that be done in another way?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build generates large EMPTY partitions</title><link>https://devzone.nordicsemi.com/thread/388580?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 13:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a20abf-cc07-4e61-b727-f4f08cf16aff</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The SPU splits the flash into 32kB regions.&lt;/p&gt;
&lt;p&gt;Looking at your flash partitioning, you have the first region taken by the b0.&lt;/p&gt;
&lt;p&gt;Then, you have s0_pad, which does not take a whole region.&lt;/p&gt;
&lt;p&gt;MCUBoot, which resides in s0_image takes a whole region, and then the next region, s1_image needs to start at the boundary of a new region. This causes the first empty region.&lt;/p&gt;
&lt;p&gt;We have a similar situation for s1. The s1_pad takes less than one region, while s1_image takes exactly one region. This causes another empty region to be placed before we get to the application images, mcuboot_primary and mcuboot_secondary.&lt;/p&gt;
&lt;p&gt;Because mcuboot_primary and mcuboot_secondary must be of equal size, we now have an uneven number of regions used, and 3 regions left in total. Your data_partition_flash partition uses the last 2 of these regions, leaving a single region left unused.&lt;/p&gt;
&lt;p&gt;I am not aware of any good way of reducing the first two empty regions. However, the third empty region (EMPTY_2) can be used as an extra partition, or you can increase the size of the data_partition_flash partition.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>