<?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 updates through SMP troubles</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106859/mcuboot-updates-through-smp-troubles</link><description>So im trying to have a mechanism to update my mcuboot images through SMP. 
 The original issue was this : we had devices that had a version 0.9.8 with the nordic sdk 2.2.0, everything was fine with it we had mcuboot and serial recovery. It was all good</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jan 2024 08:56:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106859/mcuboot-updates-through-smp-troubles" /><item><title>RE: Mcuboot updates through SMP troubles</title><link>https://devzone.nordicsemi.com/thread/462825?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 08:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6733046-12cd-47a2-8987-2a340f8117ea</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="KLarocqueEMFluids"]For some reason when I try to upload the image through -n2 it seems that I hang&amp;nbsp;[/quote]
&lt;p&gt;This is typical if you do not have set CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD. Have you set this for MCUboot?&lt;/p&gt;
&lt;p&gt;Also, did you&amp;nbsp; test the sample I sent you in my first reply?&lt;br /&gt;If you make it work with the unchanged sample first, you will be familiar with the process when you do it with your own project after.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot updates through SMP troubles</title><link>https://devzone.nordicsemi.com/thread/462754?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2024 15:24:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:854efdda-b855-4268-94ba-fb080deba48d</guid><dc:creator>KLarocqueEMFluids</dc:creator><description>&lt;p&gt;Okay I reread your answer sorry about that. For some reason when I try to upload the image through -n2 it seems that I hang&amp;nbsp;&lt;/p&gt;
&lt;p&gt;mcumgr.exe --conntype=serial --connstring=dev=COM6,baud=921600,mtu=512 image upload signed_by_mcuboot_and_b0_s1_image_update.bin -e -n2&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just get a NMP timeout. Although I made sure with a version with a lower&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FW_INFO_FIRMWARE_VERSION&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot updates through SMP troubles</title><link>https://devzone.nordicsemi.com/thread/462737?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2024 14:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62b22dae-f08b-4073-9d5b-4349645bcc68</guid><dc:creator>KLarocqueEMFluids</dc:creator><description>&lt;p&gt;Lets say I build my project and then I have these files generated. Here is a table of the files that I currently use and the understand I have of them, maybe from that perspective you would be able to help me lighten my understanding further.&lt;/p&gt;
&lt;table height="322" width="448"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Filename&lt;/td&gt;
&lt;td&gt;Desc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;merged.hex&lt;/td&gt;
&lt;td&gt;Bootloader + Mcuboot + app (everything) to flash through 10 pins connector on the board&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;app_update.bin&lt;/td&gt;
&lt;td&gt;App binaries for update through serial recovery or DFU update (but ONLY APP!)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;signed_by_mcuboot_and_b0_s0_image_update.bin&lt;/td&gt;
&lt;td&gt;Binaries to update mcuboot ? From B0 and Slot 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;signed_by_mcuboot_and_b0_s1_image_update.bin&lt;/td&gt;
&lt;td&gt;Binaries to update mcuboot ? From B0 and Slot 1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;[ For your information for our devices in production we are obligated to pass through serial recovery or Bluetooth SMP/DFU as our boards are potted, therefore we cannot have an access to that 10 pins port on the board for NRF91 (that would have simplified alot of things although it wipes the memory). So I want to avoid to brick a board to the most of my capabilities, and you know if you flash something with serial recovery and dont stop, you can kind of brick your board if you arent careful. Luckily with non potted board I can just recover the board with nrfjprog through the JLink probe ]&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So in our case, at first we had a firmware that we flashed that had serial recovery working.&amp;nbsp;After some changes overtime we created a more stable version of our firwmare and we wanted to release it on more devices, until we found out that serial recovery didnt seem to work anymore&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;So after attempts we found that it was possible to recover that feature through DFU by sending the signed_by_mcuboot_and_b0_s1_image_update.bin.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/95700/signed_by_b0_s1_image-bin-vs-signed_by_mcuboot_and_b0_s1_image_update-bin/405976"&gt;RE: signed_by_b0_s1_image.bin vs signed_by_mcuboot_and_b0_s1_image_update.bin&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From what I understood it was simple you just need to remember to use S0 or S1. Problem is that now we have 2 types of devices, those that had mcuboot with their keys working from the start and the other which needed a DFU update.&lt;/p&gt;
&lt;p&gt;If I have a device from the category 1&amp;nbsp;(the one that had a merged.hex that worked from the start with mcuboot) and use the &lt;em&gt;apache mynewt-cli&lt;/em&gt; tool for mcumgr and list the images (with a image list call).&lt;/p&gt;
&lt;p&gt;I get that output&lt;/p&gt;
&lt;p&gt;Images:&lt;br /&gt; image=0 slot=0&lt;br /&gt; version: 1.1.6&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 094da666c5288244f9278c8543c8502c81a41d7cce2e31b4bc8fe7522acad43f&lt;br /&gt; image=1 slot=0&lt;br /&gt; version: 1.1.6&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 56ce692212812fcc1d280f02d6b3c4f13c4078419fd0a1b157d18db0e7337b70&lt;br /&gt;Split status: N/A (0)&lt;/p&gt;
&lt;p&gt;I expect that version: 1.1.6 as it is the same as my&amp;nbsp;CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION.&lt;/p&gt;
&lt;p&gt;From what I understand one of those is mcuboot and the next one is the app. Tell me if Im wrong, that one of the thing I want to clarify.&lt;/p&gt;
&lt;p&gt;Then from category 2, let say we had a device with a wrong merged.hex with CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION that was set to 1.0.2. &lt;span&gt;&amp;nbsp;Im being able to run my command to list the image with my apache newt-cli tool. I get this result as expected&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Images:&lt;br /&gt; image=0 slot=0&lt;br /&gt; version: 1.0.2&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 8b1c7dcd78b8c1faefe01072c0089d50c07d4ee25e752f8972c3b8d74640c7d0&lt;br /&gt; image=1 slot=0&lt;br /&gt; version: 1.0.2&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 335aa8f9b3275ee27a1558fb752063f72922775a0c94ae6ee3a4d018017f89aa&lt;br /&gt;Split status: N/A (0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But now I am not able to flash a binary to update the app from those ports for whatever reason. If I use the same baudrate&amp;nbsp;(921600) and the same mtu (512), I get stuck at&amp;nbsp;&amp;nbsp;0 B / 292.28 KiB [--------------------------------------------------------------------------------------------------]&amp;nbsp; &amp;nbsp;0.00% and the firmware does not upload. Thats why I think serial recovery is not working for some reason? So therefore I would resort to that DFU update instead through bluetooth.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So to recover the serial recovery feature, here are the steps I would follow :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. I would increment the&amp;nbsp;CONFIG_FW_INFO_FIRMWARE_VERSION field in child_image\mcuboot.conf&lt;/p&gt;
&lt;p&gt;2. I would update my&amp;nbsp;&lt;span&gt;CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION to 1.1.6&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp; I would build my new firmware that I am sure that has working serial recovery through the nordic extension in vscode&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. Then I would get the &amp;quot;signed_by_mcuboot_and_b0_s1_image_update.bin&amp;quot;. (mentionned above)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;5. I would connect through bluetooth to my device&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;6. Then through the SMP server I would send the bits by bits of that file to update mcuboot.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;7. Then once its completed I would just need to restart the device&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;8. And now serial recovery works again like a charm.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;9. Then with the apache mynewt-cli tool I would list the images on my device and get this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Images:&lt;br /&gt; image=0 slot=0&lt;br /&gt; version: 1.0.2&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 8b1c7dcd78b8c1faefe01072c0089d50c07d4ee25e752f8972c3b8d74640c7d0&lt;br /&gt; image=0 slot=1&lt;br /&gt; version: 1.0.2&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 335aa8f9b3275ee27a1558fb752063f72922775a0c94ae6ee3a4d018017f89aa&lt;br /&gt; image=1 slot=0&lt;br /&gt; version: 1.0.2&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: d97f45512e795dba960fc20f2ce99b3228fa448fcd890f673b44d41351f9f912&lt;br /&gt; image=1 slot=1&lt;br /&gt; version: 1.0.2&lt;br /&gt; bootable: false&lt;br /&gt; flags:&lt;br /&gt; hash: 335aa8f9b3275ee27a1558fb752063f72922775a0c94ae6ee3a4d018017f89aa&lt;br /&gt;Split status: N/A (0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Its still the version 1.0.2 although now mcuboot works ??&amp;nbsp; and now I have two image and slots. I just want to know why that version is not being changed to 1.1.6. As the example mentionned before we need to be able to know which file to use either the signed_by_mcuboot_and_b0_s0_image_update.bin or the signed_by_mcuboot_and_b0_s1_image_update.bin and yet the version remains the same so I wouldnt know how to differentiate their version. Do you know if there is an alternative or if I am missing something there ? I guess maybe by the hash, but Im not sure how to decypher this or maybe if you have any link for that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;===========================&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also if I do an update through serial for mcuboot, would I still use that &amp;quot;signed_by_mcuboot_and_b0_s1_image_update.bin&amp;quot; or the other one ? For some reason when I do, when I power off and power back on my device now I cannot access my device. I can still get back to serial recovery though but my app seems to be gone now. I guess the bootloader see the newer firmware and try to go to that slot which has no firmware except that mcuboot upgrade.&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;p&gt;&lt;span&gt;So in conclusion I have 2 problems&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. DFU version is different from expected (or might be missing)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Serial recovery mcuboot update missing steps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot updates through SMP troubles</title><link>https://devzone.nordicsemi.com/thread/462619?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2024 07:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47948bc0-e93d-402f-9224-349afd213292</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;When you have enabled MCUboot and NSIB in an application, you will have 4 slots in your application:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;s0 (mcuboot)&lt;/li&gt;
&lt;li&gt;s1 (mcuboot)&lt;/li&gt;
&lt;li&gt;mcuboot_primary (app)&lt;/li&gt;
&lt;li&gt;mcuboot_secondary (app)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;MCUboot runs from either s0 or s1, whichever has the newest &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/dfu/dfu_image_versions.html"&gt;image version&lt;/a&gt; (&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_FW_INFO_FIRMWARE_VERSION"&gt;&lt;code&gt;&lt;span&gt;CONFIG_FW_INFO_FIRMWARE_VERSION&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;the app always runs from mcuboot_primary.&lt;/p&gt;
&lt;p&gt;For DFU, the mcumgr library only knows about mcuboot_primary (-n 0 / -n 1) and mcuboot_secondary (-n 2). &lt;br /&gt;To update the app over serial recovery, upload directly to mcuboot_primary.&lt;br /&gt;To update mcuboot over serial recovery, upload to mcuboot_secondary. On reset, mcuboot will see that a new bootloader has been uploaded, and swap mcuboot_secondary into s0 or s1.&lt;/p&gt;
&lt;p&gt;Does this answer your question?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot updates through SMP troubles</title><link>https://devzone.nordicsemi.com/thread/462499?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2024 13:04:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d05bdcdb-1f8d-4fb9-b0bd-0e1a782703b1</guid><dc:creator>KLarocqueEMFluids</dc:creator><description>&lt;p&gt;Yes thats what Im doing. Its just that I dont understand which slots goes to where. Like you have slots 0 and slots 1 and image 0 and image 1. So in theory you have like 4 differents spots for your images. The thing that I dont understand is that if in the future I need to update mcuboot for whatever reason, I want to know which slot I need to update without causing an issue. For some reason, after I did a few tests I noticed that the version field seemed to be random or not&amp;nbsp;be the same as with the version reported from the Kconfig value CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION. So I was wondering if these were in their correct version or is it because the version reported in that data from mcumgr.exe is not the same as that kconfig value from zephyr documentation. I want to know which version goes where, in case I need to program a tool in the future for our technicians that may be not as technical either. (Basically they would just press a button to upgrade the mcuboot bootloader without having to worry about which slots/image spots to use) I just need to figure out which is the appropriate slot/image spot in that matter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot updates through SMP troubles</title><link>https://devzone.nordicsemi.com/thread/461563?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2023 12:05:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0ee5ec2-1154-4f68-84e6-7ff3a501b5c8</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not sure if I understand exactly what is going wrong, so let me ask some questions to make it more clear to me:&lt;/p&gt;
&lt;p&gt;You are trying to update MCUboot with Serial Recovery, right?&lt;/p&gt;
&lt;p&gt;What is the thing that does not work?&lt;/p&gt;
&lt;p&gt;Here are some stuff which may be useful:&lt;/p&gt;
&lt;p&gt;My colleague has this sample: &lt;a href="https://github.com/aHaugl/samples_for_NCS/tree/main/DFU/serial_recovery_nsib"&gt;https://github.com/aHaugl/samples_for_NCS/tree/main/DFU/serial_recovery_nsib&lt;/a&gt;. See the readme for how to update the bootloader.&lt;/p&gt;
&lt;p&gt;You can see slot numbers from &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/adab597a0eb0eb9c030a7b797748a49ca89988c2/boot/zephyr/Kconfig.serial_recovery#L49-L63"&gt;CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD docs&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>