<?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 on SED reverts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105652/mcuboot-on-sed-reverts</link><description>Using: 
 NCS 2.4.1 
 nrf52840 
 Custom hardware 
 
 I am porting two projects from NCS 1.9.1 to NCS 2.4.1. Both are based on the coap_client sample. I am downloading a firmware update to external flash, then calling boot_request_upgrage(BOOT_UPGRADE_TEST</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Dec 2023 15:27:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105652/mcuboot-on-sed-reverts" /><item><title>RE: MCUBOOT on SED reverts</title><link>https://devzone.nordicsemi.com/thread/459223?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 15:27:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d2af7ca-7f63-4526-9167-b1fcb192ae5a</guid><dc:creator>Mary</dc:creator><description>&lt;p&gt;Indeed the flash partitions are different, though they shouldn&amp;#39;t be.&amp;nbsp; For some reason, the NCS 1.9.1 project creates a storage setting partition with size 0x2000, even though I&amp;#39;ve specified 0x8000.&lt;/p&gt;
&lt;p&gt;In partitions.yml&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;settings_storage:
address: 0xfe000
end_address: 0x100000
placement:
before:
- end
region: flash_primary
size: 0x2000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;even though the dts file contains&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&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;0x0 0x10000&amp;gt;;
		};
		slot0_partition: partition@10000 {
			label = &amp;quot;image-0&amp;quot;;
			reg = &amp;lt;0x10000 0xE8000&amp;gt;;
		};
	
		storage_partition: partition@f8000 {
			label = &amp;quot;storage&amp;quot;;
			reg = &amp;lt;0xf8000 0x8000&amp;gt;;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and child_image/mcuboot/prj.conf contains:&lt;/p&gt;
&lt;p&gt;CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000&lt;br /&gt;CONFIG_SETTINGS_NVS_SECTOR_COUNT=8&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For production, we will use NCS 2.4.1, or greater, and don&amp;#39;t need to go back to NCS 1.9.1.&lt;/p&gt;
&lt;p&gt;Thanks, for pointing me in the right direction.&lt;/p&gt;
&lt;p&gt;Mary&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT on SED reverts</title><link>https://devzone.nordicsemi.com/thread/455637?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 20:47:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b857c449-b0de-487d-b47e-2d00fede4053</guid><dc:creator>Amanda Hsieh</dc:creator><description>[quote user="Mary"]mcuboot_swap_type() should be returning&amp;nbsp;BOOT_SWAP_TYPE_REVERT , but it&amp;#39;s not.[/quote]
&lt;p&gt;What does&amp;nbsp;&lt;span&gt;mcuboot_swap_type return?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do you build two projects with the same memory partition?&lt;/p&gt;
&lt;p&gt;Can I suggest that you do this to do static partitioning?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First, build your application without static partitioning.&lt;/li&gt;
&lt;li&gt;Copy project/build/partitions.yml --&amp;gt; project/pm_static.yml
&lt;ol&gt;
&lt;li&gt;Note: pm_static.yml will automatically be detected by the build system, due to its specific name&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Copy project/pm_static.yml to both projects for v2.4.1 and v1.9.1&lt;/li&gt;
&lt;li&gt;Rebuild both applications.&lt;/li&gt;
&lt;li&gt;Flash first application.&lt;/li&gt;
&lt;li&gt;Now try DFU&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT on SED reverts</title><link>https://devzone.nordicsemi.com/thread/455612?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 16:03:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9711467-362a-4686-8b00-4d4d982c2220</guid><dc:creator>Mary</dc:creator><description>&lt;p&gt;There are modifications, many.&amp;nbsp; It is updating from MyApplication v0.6 to v0.5&lt;/p&gt;
&lt;p&gt;v0.5 is compiled with NCS 1.9.1&lt;br /&gt;v0.6 is compiled with NCS 2.4.1&lt;/p&gt;
&lt;p&gt;So, MCUBOOT is from NCS 2.4.1&lt;/p&gt;
&lt;p&gt;The SED&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;writes the update (v0.5) to external flash&lt;/li&gt;
&lt;li&gt;calls&amp;nbsp;&lt;span&gt;boot_request_upgrage(BOOT_UPGRADE_TEST)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;reboots&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;MCUBOOT runs the new firmware.&amp;nbsp; OK, so far&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;mcuboot_swap_type() should be returning&amp;nbsp;BOOT_SWAP_TYPE_REVERT , but it&amp;#39;s not.&amp;nbsp; So,&amp;nbsp; boot_write_img_confirmed() never get called.&amp;nbsp; On the next boot, MCUBOOT reverts to the previous version.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It should find an Active Dataset, but it doesn&amp;#39;t.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After reverting back to v0.6, it does find the Active Dataset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note the logs from fs_nvs in the reverted boot, but not the first one.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Console output:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/SED_5F00_ota_5F00_revert.txt"&gt;devzone.nordicsemi.com/.../SED_5F00_ota_5F00_revert.txt&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mary&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT on SED reverts</title><link>https://devzone.nordicsemi.com/thread/455594?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 15:14:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:582fcab2-f62a-4c07-84e7-a978bc6a521a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]&amp;nbsp;&amp;quot;Swap type : none&amp;quot;.[/quote]
&lt;p&gt;&lt;span&gt;This means the “usual” or “no upgrade” case; attempt to boot the contents of the primary slot.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Make sure to the update code with modifications.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>