<?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>Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95505/multiple-issues-with-mcuboot-serial-recovery</link><description>In the process of adapting mcuboot serial recovery mechanism to enable upgrade of a coprocessor from a main CPU (both 52840s or 5340s) I ran in to a number of issues that should be addressed. 
 1) BIG Issue: Building a single-slot application with mcuboot</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Aug 2023 13:23:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95505/multiple-issues-with-mcuboot-serial-recovery" /><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/441170?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2023 13:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4d7c955-9e08-49b2-b146-f3471326545a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;As you have thought, firmware upgrade over serial is already available for the nRF5340.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The serial recovery for application core is enabled with &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.10.0-ncs1/boot/zephyr/Kconfig.serial_recovery#L7-L19"&gt;CONFIG_MCUBOOT_SERIAL&lt;/a&gt;, and &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.4.1/modules/mcuboot/boot/zephyr/Kconfig#L130-L144"&gt;CONFIG_NRF53_RECOVERY_NETWORK_CORE&lt;/a&gt;&amp;nbsp;for network core. It&amp;#39;s only CONFIG_SINGLE_APPLICATION_SLOT that is not working at the moment. There seem to be some build system issue. As noted,&amp;nbsp;fixing it and ironing out all the&amp;nbsp;wrinkles is in progress.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/441158?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2023 12:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7463fe8-e748-44a6-a50c-52d41bb4c655</guid><dc:creator>gfgf2400a</dc:creator><description>&lt;p&gt;Thanks for the update, Hieu. I would thought this firmware upgrade over serial is the first feature that any embedded MCU product should support before entering production.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/441151?ContentTypeID=1</link><pubDate>Mon, 14 Aug 2023 12:23:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f388463-fa1b-4adf-843a-8feae69bf7dd</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;/p&gt;
&lt;p&gt;Unfortunately, CONFIG_SINGLE_APPLICATION_SLOT still does not work with the nRF5340.&amp;nbsp;It is in the work,&amp;nbsp;but I cannot comment on when it will be supported.&lt;/p&gt;
&lt;p&gt;Our apology for the inconvenience.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/440354?ContentTypeID=1</link><pubDate>Tue, 08 Aug 2023 15:50:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bea56ebc-6ba8-424f-9259-9a148259f1ea</guid><dc:creator>gfgf2400a</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am seeing the same issue with my nRF5340 of:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) BIG Issue: Building a single-slot application with mcuboot (CONFIG_SINGLE_APPLICATION_SLOT=y in mcuboot.conf)&amp;nbsp; for the 5340dk doesn&amp;#39;t build properly&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Where do we stand in this issue?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Dennis&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404940?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 07:43:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33f3c708-a908-4ed1-80dc-032d81e2dc52</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;I have sent this to our developers, so they are now aware of the PR.&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: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404852?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2023 15:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:385d2f5d-bf31-4261-bcc4-606564f7af06</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/mcu-tools/mcuboot/pull/1576"&gt;github.com/.../1576&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404729?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2023 08:30:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39c604c8-01ce-4db9-b860-a47d7520f8a7</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are making good points.&lt;/p&gt;
[quote user="bdodge09"]Perhaps I can make a PR for this to sdk-mcuboot?[/quote]
&lt;p&gt;A PR would be very welcome indeed!&lt;/p&gt;
&lt;p&gt;But not to sdk-mcuboot.&lt;br /&gt;sdk-mcuboot is just our fork of upstream mcuboot.&lt;/p&gt;
&lt;p&gt;Since this is an improvement to only mcuboot, could you make a PR to &lt;a href="https://github.com/mcu-tools/mcuboot"&gt;https://github.com/mcu-tools/mcuboot&lt;/a&gt; instead?&lt;br /&gt;If you would rather make an issue on it, you can do so to the same upstream repo.&lt;br /&gt;Then if you link to the result here, I will point our developers to it, which might speed up the process.&lt;/p&gt;
&lt;p&gt;Thanks a lot for showing interest in improving our tools, it is appreciated!&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: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404626?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 15:46:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6da8432f-c5d1-4709-bc08-270f861b5545</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;Our real products won&amp;#39;t have nice things like jlink, etc.&amp;nbsp; We wouldn&amp;#39;t want to expose a console in any case for security. For just dev-kit use I wouldn&amp;#39;t have problems using zephyr-console in this case. In a real product that contains multiple nrf chips (and other chips) we want to use one uart for fwup and another for another purpose. The SDK should *not* limit us on which uart we want to use for which function especially since the issue it trivially solved with a few lines of code in the SDK.&amp;nbsp; Perhaps I can make a PR for this to sdk-mcuboot?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404539?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 11:54:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc8e21cb-1f82-47e4-8973-822fc938e595</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="bdodge09"]And we also have potential h/w designs that use both uarts for non-console uses.[/quote]
&lt;p&gt;In that case you can use something else that &amp;quot;zephyr,console&amp;quot; for those non-console uses, right?&lt;/p&gt;
[quote user="Sigurd Hellesvik"]Is it that you want to use another UART instance to print from the bootloader at the same time as doing serial recovery?[/quote]
&lt;p&gt;By the way, would RTT solve this issue for you?&lt;br /&gt;Then you can let the Serial Recovery use zephyr,console while logging over RTT&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: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404533?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 11:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:288a7546-bad0-44aa-a58b-7810059eebb1</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;Yes.&amp;nbsp; And we also have potential h/w designs that use both uarts for non-console uses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404478?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 08:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e19f99d2-3508-4934-a5b2-5f4d15ffaf64</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user=""]2) MEDIUM Issue: There is no support for non-console UARTs in mcuboot serial recovery.&amp;nbsp; serial_adapter.c uses only chosen &amp;quot;zephyr-console&amp;quot; to get the UART device for upload.&amp;nbsp; It should be something like alias recovery-uart or mcuboot-recovery-uart and if that&amp;#39;s not OK in dts then use zephyr-console.&amp;nbsp; Isn&amp;#39;t this the whole point of using device trees?&amp;nbsp; Also, the error disallowing serial boot and console together is wrong if the uart isn&amp;#39;t zephyr-console.[/quote]
&lt;p&gt;While I do think that you have a point here, I want to understand the issue a bit more.&lt;/p&gt;
&lt;p&gt;What are you trying to do?&lt;br /&gt;Is it that you want to use another UART instance to print from the bootloader at the same time as doing serial recovery?&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: Multiple issues with mcuboot + serial recovery</title><link>https://devzone.nordicsemi.com/thread/404110?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2023 13:42:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bdee331-8a0a-4854-b6ee-aba6630702a7</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
[quote user=""]1) BIG Issue: Building a single-slot application with mcuboot (CONFIG_SINGLE_APPLICATION_SLOT=y in mcuboot.conf)&amp;nbsp; for the 5340dk doesn&amp;#39;t build properly.&amp;nbsp; See error:[/quote]
&lt;p&gt;I am able to reproduce this.&lt;br /&gt;I will check with our developers if we have support for single slot serial recovery of the nRF5340.&lt;/p&gt;
[quote user=""]2) MEDIUM Issue: There is no support for non-console UARTs in mcuboot serial recovery.&amp;nbsp; serial_adapter.c uses only chosen &amp;quot;zephyr-console&amp;quot; to get the UART device for upload.&amp;nbsp; It should be something like alias recovery-uart or mcuboot-recovery-uart and if that&amp;#39;s not OK in dts then use zephyr-console.&amp;nbsp; Isn&amp;#39;t this the whole point of using device trees?&amp;nbsp; Also, the error disallowing serial boot and console together is wrong if the uart isn&amp;#39;t zephyr-console.[/quote]
&lt;p&gt;I have not seen this one before, so I will have to look into it.&lt;/p&gt;
[quote user=""]3) MINOR Issue: The mcuboot build doesn&amp;#39;t use the device tree from the app build when built as a child image.&amp;nbsp; This is a bit surprising.&amp;nbsp; I can&amp;#39;t image someone wanting to build mcuboot and their application for their platform using the default device tree just for the boot-loader&amp;nbsp; portion.&amp;nbsp; Wouldn&amp;#39;t it make more sense to use the application&amp;#39;s device tree by default?&amp;nbsp; You can work around this by forcing the proper device tree for the mcuboot build stage but still it seems wrong to have to do that.[/quote]
&lt;p&gt;You must set devicetree for child images as well. See &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/samples/zigbee/light_switch"&gt;ZigBee light switch sample&lt;/a&gt; for the folder structure for this.&lt;/p&gt;
&lt;p&gt;It is a bit weird since:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Overlay: child_image/mcuboot.conf&lt;/li&gt;
&lt;li&gt;Overwrite: child_image/mcuboot/prj.conf&lt;/li&gt;
&lt;li&gt;Overlay: child_image/mcuboot/boards/&amp;lt;board_name&amp;gt;.overlay&lt;/li&gt;
&lt;li&gt;Dont know which: child_image/mcuboot/boards/&amp;lt;board_name&amp;gt;.conf&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &amp;quot;base&amp;quot; prj.conf is &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/prj.conf"&gt;mcuboot/boot/zephyr/prj.conf&lt;/a&gt;. Overlays add to this, while overwrites will replace all of it as far as I know.&lt;/p&gt;
[quote user=""]4) MINOR Issue: The mcuboot serial protocol (base64 encoded data CBOR encoded fimrware + headers + SMP encoding with added cmd-&amp;gt;rsp makes data transfer about 1000 times slower than it could be.&amp;nbsp; The SMP wrapper says it specifies a 127 byte maximum packet.&amp;nbsp; That leaves only 32 bytes of firmware per message (to stay aligned to flash buffers)&amp;nbsp; The mcuboot code however can take up to 512 bytes which works, so either the comments about SMP should be updated or the code changed.&amp;nbsp; A configurable buffer size might be nice here.&amp;nbsp; boot-loader has almost all of RAM to use during a recovery right?[/quote]
&lt;p&gt;Have a look at &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/84887/how-to-increase-packet-size-in-dfu-on-ios"&gt;How to increase packet size in DFU on IOS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86191/mcuboot-slow-with-nrf52840-zephyr-usb-cdc_acm-protocol"&gt;MCUBOOT slow with nRF52840 / Zephyr / USB CDC_ACM protocol&lt;/a&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></channel></rss>