<?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>Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97084/direct-xip-mcuboot-both-images-have-the-same-version</link><description>Trying to use XIP FOTA updates with nrf connect sdk and nrf52832 to get the extra flash sector (4KB) in space. 
 Starting with the smp_srv sample, adding bt fragment, and 
 
 CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT =y to the proj.conf 
 as well as 
 
 CONFIG_BOOT_DIRECT_XIP_REVERT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Mar 2023 17:30:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97084/direct-xip-mcuboot-both-images-have-the-same-version" /><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/413624?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 17:30:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:725f4358-0627-4c49-80c8-06784a5c3b87</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi markuckermann,&lt;/p&gt;
&lt;p&gt;A quick update: I got in touch with the author of the Direct-XIP variant building feature, and they are now checking it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412825?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 17:29:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bce17f4f-1026-485f-9abe-8ad22483cc8e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/markuckermann"&gt;markuckermann&lt;/a&gt;&amp;nbsp;It seems you have made a lot of progresses. Your findings look right to me.&amp;nbsp;Let me double check them with the bootloader team tomorrow and get back to you.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412809?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 15:56:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15cac913-e9fe-49c9-94f8-5c4aa969ec49</guid><dc:creator>markuckermann</dc:creator><description>&lt;p&gt;I just realised that the &amp;quot;two versions are the same&amp;quot; isn&amp;#39;t a problem at all. The way the find_slot_with_highest_version() function in MCUboot&amp;#39;s loader.c handles the comparison it just loads the first slot. The problem really lies with the final merge command in NCS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412795?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 15:03:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3a4d873-ccf3-4769-b46b-d54aaca888ec</guid><dc:creator>markuckermann</dc:creator><description>&lt;p&gt;I think there are two solutions:&lt;br /&gt;&lt;br /&gt;1. Flash a confirmed image (and only one slot)&lt;br /&gt;&lt;br /&gt;So after the build:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# confirm image
C:\ncs\toolchains\v2.2.0\opt\bin\python.exe C:/ncs/v2.2.0/bootloader/mcuboot/scripts/imgtool.py sign --key C:/ncs/v2.2.0/bootloader/mcuboot/root-rsa-2048.pem --header-size 0x200 --align 4 --version 0.0.2+33 --pad-header --slot-size 0x35000 --pad --confirm &amp;lt;path&amp;gt;/smp_svr/build/zephyr/mcuboot_primary_app.hex &amp;lt;path&amp;gt;/smp_svr/build/zephyr/app_confirmed.hex

# merge bootloader + confirmed image
C:\ncs\toolchains\v2.2.0\opt\bin\python.exe C:/ncs/v2.2.0/zephyr/scripts/build/mergehex.py -o &amp;lt;path&amp;gt;/smp_svr/build/zephyr/merged.hex --overlap=replace &amp;lt;path&amp;gt;/smp_svr/build/mcuboot/zephyr/zephyr.hex &amp;lt;path&amp;gt;/smp_svr/build/zephyr/app_confirmed.hex

# flash without rebuild
west flash --skip-rebuild&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. Flash a test image and confirm it in application&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# merge bootloader + test image
C:\ncs\toolchains\v2.2.0\opt\bin\python.exe C:/ncs/v2.2.0/zephyr/scripts/build/mergehex.py -o &amp;lt;path&amp;gt;/smp_svr/build/zephyr/merged.hex --overlap=replace &amp;lt;path&amp;gt;/smp_svr/build/mcuboot/zephyr/zephyr.hex &amp;lt;path&amp;gt;/smp_svr/build/zephyr/app_test_update.hex

# flash without rebuild
west flash --skip-rebuild

# in application main.c
boot_write_img_confirmed();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you just flash a test image it only works once. &lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/members/vthieu"&gt;Hieu&lt;/a&gt; once you confirm the above, can you ask if this will be fixed upstream? Or show me how I can change it so a Flash / Build action in VSCode results in a flashable merge.hex.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412771?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 13:52:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca36938f-ed5d-4ac3-b797-d45ac3f96a3d</guid><dc:creator>markuckermann</dc:creator><description>&lt;p&gt;I&amp;#39;ve looked at the shell comands run by the build (using west -v build) and the last one consists of:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;mergehex.py
-o &amp;lt;path&amp;gt;/smp_svr/build/zephyr/merged.hex 
--overlap=replace 
&amp;lt;path&amp;gt;/smp_svr/build/mcuboot/zephyr/zephyr.hex                 // 29952 bytes   That&amp;#39;s the bootloader
&amp;lt;path&amp;gt;/smp_svr/build/zephyr/mcuboot_primary.hex                // 208388 bytes  Primary app (but not signed)
&amp;lt;path&amp;gt;/smp_svr/build/zephyr/mcuboot_secondary.hex              // 209236 bytes  Secondary app (but signed)
&amp;lt;path&amp;gt;/smp_svr/build/zephyr/zephyr.hex                         // 208388 bytes  Same file (same CRC) as mcuboot_primary.hex
&amp;lt;path&amp;gt;/smp_svr/build/zephyr/mcuboot_secondary_app_signed.hex   // 209236 bytes  Same file (same CRC) as mcuboot_secondary.hex
&amp;lt;path&amp;gt;/smp_svr/build/zephyr/app_signed.hex                     // 209236 bytes  Ever so slightly bigger than mcuboot_primary =&amp;gt; Primary app signed
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So that doesn&amp;#39;t seem right at all.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve also added lot&amp;#39;s of statements to MCUboot and found that even when I change the logic to select any of the images it doesn&amp;#39;t boot because the active_swap_state-&amp;gt;magic is set to BOOT_MAGIC_UNSET instead of BOOT_MAGIC_GOOD.&lt;br /&gt;&lt;br /&gt;So then the bootloader deletes the slots :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412614?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 21:57:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c91f24a-c694-45f3-8b0f-796196f13995</guid><dc:creator>markuckermann</dc:creator><description>&lt;p&gt;Great, glad you could reproduce it. Yes, agreed, both being included is the issue I think. I don&amp;#39;t know if MCUboot &amp;quot;doesn&amp;#39;t like the image&amp;quot; but it certainly doesn&amp;#39;t boot them because they both have the same version.&lt;br /&gt;&lt;br /&gt;Well, the documentation is rather sparse. It&amp;#39;s not so much inaccuracies, but just a lack of.&amp;nbsp; &lt;a id="" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/bootloaders_and_dfu/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/bootloaders_and_dfu/index.html&lt;/a&gt; suggests in the Table that Direct-XIP is supported. Then in &lt;a id="" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-ncs.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-ncs.html&lt;/a&gt; it also suggests that all you have to do is enable the CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT. &lt;br /&gt;&lt;br /&gt;Then on the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/90995/mcuboot-direct_xip/382058"&gt;RE: MCUboot DIRECT_XIP&lt;/a&gt; ticket, the question of if &lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;, Helvetica, Arial, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;"&gt;MCUBOOT_DIRECT_XIP_REVERT&lt;/span&gt; is supported, the answer was to just look at &lt;a id="" href="https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/Kconfig"&gt;https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/Kconfig&lt;/a&gt; but no indication if presence means that I should expect it to work.&lt;br /&gt;&lt;br /&gt;The tutorial blog: &lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu"&gt;Add DFU support to your application&lt;/a&gt; doesn&amp;#39;t mention XIP at all. It would be nice to have something like that for XIP&lt;br /&gt;&lt;br /&gt;Also, it would be very good to get information on whether the SMP server can verify that the image being sent is for the right slot. I think some of that is discussed in the github issue but it seems to have just been closed without the PR being merged?&lt;br /&gt;&lt;br /&gt;In general, I ran into &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/78984/big-primary-image-prevents-fota"&gt;Big primary image prevents FOTA&lt;/a&gt; (again, no mention of this in the docs but it turns out you need at least 4KB of space free. The build passes fine and the image transfers but then doesn&amp;#39;t start) I&amp;#39;m looking at XIP to get the extra 4KB of space back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412612?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 21:39:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74fe9462-75c7-4a82-8ebd-fa25b759854f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Update: I notice that I chose to put &lt;span&gt;CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT in a Kconfig fragment instead of prj.conf, then failed to include it. I can reproduce your problem exactly now. Sorry for before.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It looks like&amp;nbsp;there are two issues:&lt;br /&gt;- The merged.hex includes images for both the primary and secondary slot&lt;br /&gt;- MCUboot does not like the images and delete them both, one at a time&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will continue to look into it. It might take a while, but I will keep you updated every 2-3 days.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please share the info on the documentation though. I will take care of that&amp;nbsp;concurrently.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412609?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 21:08:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:337c9cd4-a48d-4f52-a330-89216722a934</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi markuckermann,&lt;/p&gt;
&lt;p&gt;I followed your steps and my result is a little different.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v3.2.99-ncs1 ***
I: Starting Direct-XIP bootloader
I: Primary   slot: version=0.0.0+0
I: Image 0 Secondary slot: Image not found
I: No slot to load for image 0
E: Unable to find bootable image&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It still is an issue and I will continue to look into it. However, to be on the same page, could you please let me know&lt;br /&gt;- What NCS version are you using? From your log, I am guessing v2.2.0?&lt;br /&gt;- How in details did you flash the device? Could it be that by flashing, you meant a DFU operation?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="markuckermann"]I found an open issue on zephyr which seems to have had some nordic involvement: &lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/27673"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/27673&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;It&amp;#39;s left me a bit confused about whether Direct XIP is as well-supported as the NCS documentation suggests.[/quote]
&lt;p&gt;I am a&amp;nbsp;bit unfamiliar with the details discussed in this GitHub issue. Let me&amp;nbsp;do some research on it and feedback to you in a later reply.&lt;/p&gt;
&lt;p&gt;By the way, which Direct-XIP documentation are you referring to here?&amp;nbsp;If there are any inaccuracies in our docs, we will get to correct them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412604?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 19:37:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b18165a6-2572-4f96-90a2-eb977a026f5a</guid><dc:creator>markuckermann</dc:creator><description>&lt;p&gt;Hi Hieu, great, looking forward to it.&lt;br /&gt;&lt;br /&gt;I found an open issue on zephyr which seems to have had some nordic involvement: &lt;a id="" href="https://github.com/zephyrproject-rtos/zephyr/issues/27673"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/27673&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;It&amp;#39;s left me a bit confused about whether Direct XIP is as well-supported as the NCS documentation suggests.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Direct-XIP MCUboot both images have the same version</title><link>https://devzone.nordicsemi.com/thread/412359?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 20:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71982099-0d96-4206-aeb0-aa3b3bcb705c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi markuckermann,&lt;/p&gt;
&lt;p&gt;I will support you with this question. I will need to look into this topic a little bit before answering you.&lt;/p&gt;
&lt;p&gt;However, I am partially out of office in the first half of this week, so my answer will be a little delayed. I will follow up latest by the end of Wednesday Mar 1.&lt;/p&gt;
&lt;p&gt;Sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>