<?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>Firmware updates via the serial port without loosing half the code space</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83658/firmware-updates-via-the-serial-port-without-loosing-half-the-code-space</link><description>SDK Environment: nRF Connect SDK v1.8.0 Target: Decawave DWM1001-DEV. This uses the nRF52832 
 My application uses more than half the flash size of the nRF52832. 
 Using mcuboot and smp it appears you need to have a working slot and a download slot for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jan 2022 13:11:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83658/firmware-updates-via-the-serial-port-without-loosing-half-the-code-space" /><item><title>RE: Firmware updates via the serial port without loosing half the code space</title><link>https://devzone.nordicsemi.com/thread/349538?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 13:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba0672ff-77ce-4bcb-9910-05fd207236ce</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello David,&lt;/p&gt;
[quote user="dwalton65"]The version is displaying correctly in serial recovery mode, but not the flags or the hash.[/quote]
&lt;p&gt;I believe flags and hash should be supported on serial recovery as well, but it probably hasn&amp;#39;t been implemented in order for the code to be minimal. When you use serial recovery you probably wouldn&amp;#39;t care what the version was anyway. This is recovery, so you are in a bad state and want out of it, and will upload the latest, or upload it from another device (in which you would manage the versions anyway, so why duplicate this effort). In the case of dev-to-dev upload the version is allready overkill. SHA is mainly useful for tests because the user should use some versioning, rather than relying on the SHA, which is read from a header and not calculated on the device.&lt;/p&gt;
&lt;p&gt;You could implement all of this, SHA reading etc., using KConfig options, but it will take more space. The new use for recovery, where you are actually using it for direct DFU, from PC, rather than other dev, and manage software that way should work fine with versions, and does not seem to require hash; the hash will not fix user&amp;#39;s configuration management where same app versions have different hashes.&lt;/p&gt;
[quote user="dwalton65"]It now turns out that one of the devices I am working on does not have any buttons, so unfortunately that counts out serial recovery mode.[/quote]
&lt;p&gt;I see. Considering flash size issues I should also mention that there are some updates that are coming with NCS 1.9 that might shrink the Soft Device Controller, depending on your application.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware updates via the serial port without loosing half the code space</title><link>https://devzone.nordicsemi.com/thread/348809?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 21:48:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:891ca532-6b80-4468-b45e-e6b76cd231eb</guid><dc:creator>dwalton65</dc:creator><description>&lt;p&gt;It now turns out that one of the devices I am working on does not have any buttons, so unfortunately that counts out serial recovery mode.&lt;/p&gt;
&lt;p&gt;I had a similar problem with a project using the esp32. With this device the two image slots do not have to be equal size. The first smaller slot contained a small image that used the equivalent of SMP. The main project went into the second larger slot. When a request to upgrade firmware was detected, the main image in the second slot would mark its image as invalid and then reboot. The processor would then run the only valid image left which was the smaller image that had the equivalent of SMP available.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware updates via the serial port without loosing half the code space</title><link>https://devzone.nordicsemi.com/thread/348808?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 21:35:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c40bdf8d-f8c2-4f49-8c06-3c8c3eb76ce7</guid><dc:creator>dwalton65</dc:creator><description>[quote userid="103347" url="~/f/nordic-q-a/83658/firmware-updates-via-the-serial-port-without-loosing-half-the-code-space/348774#348774"]It doesn&amp;#39;t seem like you have set CONFIG_MCUBOOT_IMAGE_VERSION anywhere in your test project.[/quote]
&lt;p&gt;I don&amp;#39;t know why, but when I tried it, it did not seem to work in serial recovery mode. I just tried again adding &lt;code&gt;CONFIG_MCUBOOT_IMAGE_VERSION=&amp;quot;0.1.2+3&amp;quot;&lt;/code&gt; to the start of &amp;quot;prj.conf&amp;quot; and this time it worked. I have had a few things like this lately.&lt;/p&gt;
&lt;p&gt;For a test of the difference in the output of mcumgr image list when using smp vs serial recovery mode, I created the project &amp;quot;hello-world-ser-smp&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_2D00_world_2D00_ser_2D00_smp.zip"&gt;devzone.nordicsemi.com/.../hello_2D00_world_2D00_ser_2D00_smp.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;mcumgr --conntype=serial --connstring=COM8 image list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;Images:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;image=0 slot=0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version: 0.1.2.4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bootable: true&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flags: active confirmed&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hash: 18e97e07e825a0b8b2a1f2d999222377c7f63236eeaf5fb8b6fe276bfe19b78d&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;image=0 slot=1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version: 0.1.2.3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bootable: true&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flags:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hash: d3f4b4c572f84707bda19c2680cc23a716b0b6f51c2d21b6a94ab40d1d38bc0d&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;Split status: N/A (0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now after rebooting in serial recovery mode&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;mcumgr --conntype=serial --connstring=COM8 image list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;Images:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;image=0 slot=0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version: 0.1.2.4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bootable: false&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flags:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hash: Unavailable&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;image=0 slot=1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version: 0.1.2.3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bootable: false&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flags:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hash: Unavailable&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;Split status: N/A (0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The version is displaying correctly in serial recovery mode, but not the flags or the hash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware updates via the serial port without loosing half the code space</title><link>https://devzone.nordicsemi.com/thread/348774?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 15:22:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9887813d-c19f-4e13-b928-c01c5cc478d1</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello David!&lt;/p&gt;
&lt;p&gt;Unfortunately we don&amp;#39;t provide any other alternative to what you mentioned.&lt;/p&gt;
&lt;p&gt;If you need support for more commands those needs to be ported from the generic mgmt subsystem, but that is not trivial since mcuboots port is mostly written from scratch. However, setting the application version should work, &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_fw_update.html?highlight=config_mcuboot_image_version#preventing-downgrades-using-mcuboot"&gt;see here for info on how. &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t seem like you have set CONFIG_MCUBOOT_IMAGE_VERSION anywhere in your test project.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware updates via the serial port without loosing half the code space</title><link>https://devzone.nordicsemi.com/thread/348100?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 15:07:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79b2201a-95c0-4968-ab28-f677c8653e8a</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello David,&lt;/p&gt;
&lt;p&gt;I will have to get back to you on this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>