<?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>Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122335/image-upload-over-mcuboot-serial-recovery-not-bootable</link><description>Hi 
 I&amp;#39;ve an application running on nRF Conenct SDK 3.0.2 on an nRF52840DK. Now I tried to enable update support over serial recovery of MCUBoot using the USB ACM. 
 First I&amp;#39;ve setup sysbuild to use MCUboot in sysbuild.conf file: 
 # Enable bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Jun 2025 13:56:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122335/image-upload-over-mcuboot-serial-recovery-not-bootable" /><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/540220?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2025 13:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4d90fd6-6cf2-46f6-89a7-89f8aba736e7</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;:-) That was a&amp;nbsp;nice trick. It works when aplied as you said. As soon as I moved the folder to a subdirectory and renamed it it didn&amp;#39;t work somehow. Anyway I use it as proposed by now.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/540211?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2025 13:02:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07a0c8f4-2685-4ff7-997e-e2a3254a2ea3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad to hear that this has improved the scenario.&lt;/p&gt;
&lt;p&gt;The USB transport has a 64 byte EP, which means that increasing the MTU size will effectively send &amp;#39;n&amp;#39; amount of packets of 64 bytes.&lt;/p&gt;
&lt;p&gt;As you shared, there&amp;#39;s two methods of improving speed:&lt;/p&gt;
&lt;p&gt;1. increase mtu&lt;/p&gt;
&lt;p&gt;2. decrease dwell-time between each requested MTU.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Adrian"]I&amp;#39;ve one thing that is not working. We have own implementaiton for the serial number over USB. In the MCUboot at the moment we have the default USB serial number. How can I override weak methods (e.g. &amp;quot;usb_update_sn_string_descriptor&amp;quot; in my mcuboot image? All attempts I&amp;#39;ve made did not work.[/quote]
&lt;p&gt;The default behavior is that the function reads out the FICR.DEVICEID and applies this as the serial number:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/usb/device/usb_descriptor.c#L328-L355"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/usb/device/usb_descriptor.c#L328-L355&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I checked around with colleagues, and there is no straight-forward way to add a .c file to mcuboot without forking the repo.&lt;/p&gt;
&lt;p&gt;So, I did an exercise to&amp;nbsp;bend sysbuild a bit.&lt;/p&gt;
&lt;p&gt;What you can do is to workaround this by treating your .c file as a out-of-tree driver specific to mcuboot.&lt;/p&gt;
&lt;p&gt;Create sysbuild.cmake file containing:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;set(mcuboot_EXTRA_ZEPHYR_MODULES &amp;quot;${CMAKE_CURRENT_LIST_DIR}/test_usb_sn_override&amp;quot; CACHE INTERNAL &amp;quot;test_module directory&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then handle &amp;quot;test_usb_sn_override&amp;quot; as a out-of-tree directory by specifying test_usb_sn_override/zephyr/module.yml:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;build:
  cmake: .
  kconfig: Kconfig
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then add a small conditional in &lt;span&gt;test_usb_sn_override/&lt;/span&gt;CMakeLists.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(DEFINED CONFIG_BOOT_SERIAL_CDC_ACM)
    message(&amp;quot;Adding override function for USB serial number&amp;quot;)
    zephyr_library_sources(test.c)
endif()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where test.c holds:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/sys/byteorder.h&amp;gt;
#include &amp;lt;zephyr/sys/__assert.h&amp;gt;
#include &amp;lt;zephyr/usb/usb_device.h&amp;gt;

uint8_t *usb_update_sn_string_descriptor(void)
{
	/* SN is 16 bytes */
	static char hex[] = &amp;quot;CAFECAFECAFECAFE&amp;quot;;
	return (uint8_t*)hex;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;lsusb -d 2fe3:0100 -v

Bus 001 Device 042: ID 2fe3:0100 NordicSemiconductor MCUBOOT
Couldn&amp;#39;t open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 [unknown]
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x2fe3 NordicSemiconductor
  idProduct          0x0100 MCUBOOT
  bcdDevice            4.00
  iManufacturer           1 ZEPHYR
  iProduct                2 MCUBOOT
  iSerial                 3 CAFECAFECAFECAFE
  ...
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a hello_world that does this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_sysbuild_5F00_mcuboot_5F00_override_5F00_usb_5F00_sn2.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_sysbuild_5F00_mcuboot_5F00_override_5F00_usb_5F00_sn2.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I used the nrf7002dk board for this exercise, so the board files in sysbuild/mcuboot/boards must be altered to match your chosen one.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;PS: remove sysbuild.conf &amp;quot;SB_CONFIG_MCUBOOT_MODE_SINGLE_APP=y&amp;quot; if testing on nRF5340.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/540115?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2025 20:17:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d14eef02-3fb5-499a-ab95-113235cb1cc5</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Increasing the MTU did have also a hugh impact. That&amp;#39;s fine for now. We will probably go with an MTU of 512. It works now almost as expected.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve one thing that is not working. We have own implementaiton for the serial number over USB. In the MCUboot at the moment we have the default USB serial number. How can I override weak methods (e.g. &amp;quot;usb_update_sn_string_descriptor&amp;quot; in my mcuboot image? All attempts I&amp;#39;ve made did not work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539996?ContentTypeID=1</link><pubDate>Fri, 20 Jun 2025 10:00:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f568dde2-ab55-44a0-9ad4-354e4b941679</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Adrian"]Somehow only MTU sizes up to ~130 work.[/quote]
&lt;p&gt;I believe this can be changed via mcuboot&amp;#39;s CONFIG_BOOT_MAX_LINE_INPUT_LEN.&lt;/p&gt;
[quote user="Adrian"]The baudrate seems to be irrelevant. [/quote]
&lt;p&gt;Yes, you&amp;#39;re right. With CDC, this has no effect on the overall transmission. Sorry for the confusion.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Adrian"]What MTU size does the nRF Connect Programmer use?[/quote]
&lt;p&gt;it uses nrfutil to write the image:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/pc-nrfconnect-programmer/blob/main/src/actions/mcubootTargetActions.ts#L71-L81"&gt;https://github.com/NordicSemiconductor/pc-nrfconnect-programmer/blob/main/src/actions/mcubootTargetActions.ts#L71-L81&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I believe that the mtu does not have much of an effect here, it is more related to timing between each packet.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did you try the fix proposed in the former linked thread? ie. reduce the wait-time between each payload?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539937?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 19:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eba696c-7438-4aa0-97d4-3c032c2607e9</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Somehow only MTU sizes up to ~130 work. With higher values it doesn&amp;#39;t work. What MTU size does the nRF Connect Programmer use? The baudrate seems to be irrelevant. That could be because it is a virtual Uart device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539932?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 16:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c88b600-20ad-44dd-b878-6e2ec9492ca7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Adrian"]Currently we get 3.5kB/s with the newtmgr client.[/quote]
&lt;p&gt;This might be a &amp;quot;feature&amp;quot; of the newtmgr CLI tool, as it seems to have a larger sleep between each payload:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86191/mcuboot-slow-with-nrf52840-zephyr-usb-cdc_acm-protocol/359893"&gt;RE: MCUBOOT slow with nRF52840 / Zephyr / USB CDC_ACM protocol&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Adrian"]Is there something that can be configured around the MTU size? [/quote]
&lt;p&gt;You could adjust the mtu via the connstring:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;--connstring=COMx,baud=115200,mtu=512&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another option would also be to adjust the baudrate.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539928?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 15:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f3abf84-d76a-4b71-966e-4f1053b7c37f</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;1) I think it&amp;#39;s ok. As it is only a single image setup the mechanisms that are used over BLE with MCUBoot (Pending,Confirm,Hash, etc.) are not necessairy.&lt;/p&gt;
&lt;p&gt;2) Currently we get 3.5kB/s with the newtmgr client. With the nRF Connect Programmer App it the throughput is around 10kB/s. It&amp;#39;s ok, but a bit more would be nice.&lt;br /&gt;Is there something that can be configured around the MTU size? With the newtmgr tool a MTU can be selected, but I don&amp;#39;t know what the max supported value would be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539886?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 12:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:616d4d7b-5e95-41ec-a323-5f66f54ed9d5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Adrian,&lt;/p&gt;
[quote user="Adrian"]Thanks for the input. That was the problem. After using the &amp;quot;&lt;span&gt;build-folder/application-name/zephyr/zephyt.signed.bin&amp;quot; file it worked as expected. It also works with nRF Connect Desktop Programmer MCUBoot Support, but then the &amp;quot;build-folder/application-name/zephyr/zephyt.signed.hex&amp;quot; file needs to be used.&lt;/span&gt;[/quote]
&lt;p&gt;Yes, it is true that the mcumgr/newtmgr takes in a binary file, while our nRF tools primarily favors .hex files. In this case, a dfu_application.zip file can also be used for the nRF Programmer application.&lt;/p&gt;
[quote user="Adrian"]&lt;br /&gt;1) What isn&amp;#39;t there a hash or bootable flag in the MCUboot image? I see this info with the &amp;quot;image list&amp;quot; command.&lt;br /&gt;The output then is:&lt;br /&gt;&lt;em&gt;Images:&lt;/em&gt;&lt;br /&gt;&lt;em&gt; image=0 slot=0&lt;/em&gt;&lt;br /&gt;&lt;em&gt; version: 2.1.2&lt;/em&gt;&lt;br /&gt;&lt;em&gt; bootable: false&lt;/em&gt;&lt;br /&gt;&lt;em&gt; flags:&lt;/em&gt;&lt;br /&gt;&lt;em&gt; hash: Unavailable&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Split status: N/A (0)&lt;/em&gt;[/quote]
&lt;p&gt;mcuboot serial recovery is a function that does not provide boot flags or similar options, and it also does not provide you with a hash of the img.&lt;/p&gt;
&lt;p&gt;This is typically aimed towards a failsafe, where you want to overwrite the whole of the application with a new one, either for recovery purposes or upgrade purposes. This will check the signature, and apply if verified.&lt;/p&gt;
[quote user="Adrian"]2)&amp;nbsp;Are there any options to increase the speed for the download?[/quote]
&lt;p&gt;What is the current speed that you&amp;#39;re seeing?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539796?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 04:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd16ab61-cc8d-4e1a-a8bd-6e2c30afc8d2</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Hi Hakon&lt;/p&gt;
&lt;p&gt;Thanks for the input. That was the problem. After using the &amp;quot;&lt;span&gt;build-folder/application-name/zephyr/zephyt.signed.bin&amp;quot; file it worked as expected. It also works with nRF Connect Desktop Programmer MCUBoot Support, but then the &amp;quot;build-folder/application-name/zephyr/zephyt.signed.hex&amp;quot; file needs to be used.&lt;br /&gt;&lt;br /&gt;Why does the nRF Connect App need a different file? I assume it uses the same SMP protocol &amp;quot;image upload&amp;quot; commands to download the application to the device in MCUboot.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Maybe you can give me a short info about theses related questions:&lt;br /&gt;&lt;br /&gt;1) What isn&amp;#39;t there a hash or bootable flag in the MCUboot image? I see this info with the &amp;quot;image list&amp;quot; command.&lt;br /&gt;The output then is:&lt;br /&gt;&lt;em&gt;Images:&lt;/em&gt;&lt;br /&gt;&lt;em&gt; image=0 slot=0&lt;/em&gt;&lt;br /&gt;&lt;em&gt; version: 2.1.2&lt;/em&gt;&lt;br /&gt;&lt;em&gt; bootable: false&lt;/em&gt;&lt;br /&gt;&lt;em&gt; flags:&lt;/em&gt;&lt;br /&gt;&lt;em&gt; hash: Unavailable&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Split status: N/A (0)&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2)&amp;nbsp;Are there any options to increase the speed for the download?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards Adrian&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: Image upload over MCUBoot serial recovery not bootable</title><link>https://devzone.nordicsemi.com/thread/539682?ContentTypeID=1</link><pubDate>Wed, 18 Jun 2025 10:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90438a23-d77c-4173-aa87-85cf907c39e8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]By pressing the Button 1 on startup I&amp;#39;m able to enter the MCUBOOT serial revovery now. Also reading the image status work properly. But if I download the created &amp;quot;dfu_application.zip&amp;quot; file by using the&amp;nbsp;newtmgr CLI client the system shows me on RTT log the there is no startable image found. Somehow the downloaded image is not startable.[/quote]
&lt;p&gt;I haven&amp;#39;t used the mynewt CLI tool, but I believe mcumgr requires that you give in a .bin file.&lt;/p&gt;
&lt;p&gt;Could you try to transfer the build-folder/application-name/zephyr/zephyt.signed.bin file and see if this runs as expected afterwards?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>