<?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>DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/129300/dfu-target-api-on-ncs-v3-4-1</link><description>Dear Nordic team, 
 I am trying to set up OTA updates by using the DFU target API on an nRF9151 DK with MCUboot and TF-M partitions. (NCS v3.4.1) My goal is to use the immutable MCUboot bootloader and update both the application and the TF-M partition</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Sep 2026 14:07:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/129300/dfu-target-api-on-ncs-v3-4-1" /><item><title>RE: DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/thread/571772?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2026 14:07:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c7dfcb3-ed69-41bf-8b89-4e817b947cf5</guid><dc:creator>Tom01</dc:creator><description>[quote userid="5203" url="~/f/nordic-q-a/129300/dfu-target-api-on-ncs-v3-4-1/571754"]There are different boot-loader setups, and one has the name &amp;quot;SECURE_BOOT&amp;quot; and uses an immutable b0 boot-loader and additional mcuboot (2 stages). So the terms you used truggered me to clarify, what your intention is.[/quote]
&lt;p&gt;It&amp;#39;s a bit confusing, because the secure boot architecture documentation uses the term &amp;quot;immutable bootloader&amp;quot; for the bootloader selected for a single stage setup and the NSIB has &amp;quot;immutable bootloader&amp;quot; in its name... &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I tried your fix, but unless I have done something wrong it doesn&amp;#39;t solve the secure fault. Also, I think the partition selection might not be the issue, because the secure fault is triggered on the start of the flash range of my slot1 partition. That looks like slot1 is correctly selected, doesn&amp;#39;t it?&amp;nbsp;&lt;/p&gt;
[quote userid="5203" url="~/f/nordic-q-a/129300/dfu-target-api-on-ncs-v3-4-1/571754"]Not sure, what they mean by &amp;quot;image swap&amp;quot;[/quote]
&lt;p&gt;Image swap/swap mode seems to be the default mode for MCUboot, where the application always runs from the primary slot and the update is always written to the secondary slot. It made the impression that this case is best documented, so I wanted to start out there.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/thread/571754?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2026 11:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:688c5169-aad4-4f74-8002-e95271bdccf9</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Just to mention: I&amp;#39;m a developer and not related to Nordic ;-).&lt;/p&gt;
&lt;p&gt;There are different boot-loader setups, and one has the name &amp;quot;SECURE_BOOT&amp;quot; and uses an immutable b0 boot-loader and additional mcuboot (2 stages). So the terms you used truggered me to clarify, what your intention is.&lt;/p&gt;
&lt;p&gt;Your app crashes, because in your partition setup&amp;nbsp;&lt;span&gt;&amp;quot;flash_img.c&amp;quot; gets it wrong. It takes then the primary slot for upload and that crashes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At the begin of the year, it also toke the&amp;nbsp;primary slot&amp;nbsp;for the Thingy:91/X, but there the root cause was slightly different.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The patch is pretty small, you may even try to edit&amp;nbsp;&amp;quot;flash_img.c&amp;quot; to see, if that works for you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;gt;&amp;nbsp;&amp;nbsp;it is listed that NSIB only supports&amp;nbsp;Dual-slot direct-xip upgrades.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Not sure, what they mean by &amp;quot;image swap&amp;quot;, at least I&amp;#39;m mainly common with the&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;Dual-slot direct-xip&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but that swaps the slots as well, means, download to secondary slot, and on update swap primary and secondary. For that I write the app (tf-m + ns-app) to the secondary slot, and mucboot copies both to the primary and executes it from there.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Anyway, let me recommend, you start with the fix and we will see, if that is changing something.&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: DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/thread/571743?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2026 08:15:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6627b72-7b82-45fb-8194-86d34582de0c</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hey Achim,&lt;/p&gt;
&lt;p&gt;I saw that thread, but did not fully recognize it as being relevant here...&lt;/p&gt;
[quote userid="5203" url="~/f/nordic-q-a/129300/dfu-target-api-on-ncs-v3-4-1/571736"]Do you mean a two stage approach?[/quote]
&lt;p&gt;My understanding is probably lack-luster:&lt;/p&gt;
&lt;p&gt;I meant a single stage approach. The documentation for the secure bootloader chain (&lt;a href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader.html#architecture)"&gt;nrfconnectdocs.nordicsemi.com/.../bootloader.html&lt;/a&gt; states that &amp;quot;The first implementation (i.e. the ) provides the first stage in the chain, the immutable &lt;a class="reference internal" href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/samples/bootloader/README.html#bootloader"&gt;&lt;span class="std std-ref"&gt;nRF Secure Immutable Bootloader&lt;/span&gt;&lt;/a&gt;, which could be either nRF Secure Immutable Bootloader or &lt;a class="reference external" title="(in MCUboot v3.4.0)" href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/mcuboot/index-ncs.html"&gt;&lt;span class="xref std std-doc"&gt;MCUboot&lt;/span&gt;&lt;/a&gt;. It does not support bootloader upgradability, but it is useful if you need just the capability to update your application.&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Further down in the same documentation (&lt;a href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader.html#second-stage-upgradable-bootloader"&gt;https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader.html#immutable-bootloader&lt;/a&gt;) the following is stated: &amp;quot;You should add a second-stage bootloader only when necessary by the design or firmware upgrade needs. Adding the second stage bootloader for no reason will lead to a degradation of the system&amp;rsquo;s overall security, as attackers can exploit bugs that may exist in either bootloader.&amp;quot;.&lt;/p&gt;
&lt;p&gt;In this documentation (&lt;a href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.html#supported-features-and-configurations"&gt;https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.html#supported-features-and-configurations&lt;/a&gt;) it is listed that NSIB only supports&amp;nbsp;Dual-slot direct-xip upgrades.&lt;/p&gt;
&lt;p&gt;That would conflict with the secure-labeled TF-M partitions again, wouldn&amp;#39;t it?&lt;/p&gt;
&lt;p&gt;Therefore my approach was to go with a single stage approach using only MCUboot with image swapping.&lt;/p&gt;
&lt;p&gt;Do you or &lt;a href="https://devzone.nordicsemi.com/members/sigurd-hellesvik"&gt;Sigurd Hellesvik&lt;/a&gt;&amp;nbsp;have a different take on the documentation&amp;#39;s recommendation to not use a two stage approach if it is not strictly necessary?&lt;/p&gt;
&lt;p&gt;Or is my understanding false, that&amp;nbsp;Dual-slot direct-xip upgrades would conflict with secure partitions because the non-secure partition would have to write to a secure flash section?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Tom&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/thread/571736?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2026 05:17:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebfe61e9-ede8-402d-ad8a-09e468faa838</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; My goal is to use the immutable MCUboot bootloader&lt;/p&gt;
&lt;p&gt;Do you mean a two stage approach? Because&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;boot_partition: partition@0&lt;/p&gt;
&lt;p&gt;indicates, that only one is used.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;The code compiles and runs, but causes a &amp;quot;SECURE FAULT&amp;quot; when running&amp;nbsp;`dfu_target_write`:&lt;/p&gt;
&lt;p&gt;Yes, that&amp;#39;s the case since start of the year on different devices and NCS versions. It was caused by different issues, mainly failing to select the right partition to upload the update in &amp;quot;flash_img.c&amp;quot;. Maybe it works, if you really switch to the &amp;quot;immutable 2 stage&amp;quot; approach, because that seems to be the used one in the samples.&lt;/p&gt;
&lt;p&gt;For the single stage bootloader, the current issue is&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/129068/ncs-3-4-0-nrf91-dfu-without-external-flash-and-without-secure_boot-is-broken"&gt;NCS 3.4.0, nRF91, DFU without external flash and without SECURE_BOOT is broken&lt;/a&gt;&amp;nbsp;.&amp;nbsp;You may cherry-pick the patch from&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/118016"&gt;fix.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/thread/571702?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2026 09:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d076f58-dae5-459a-88ce-31dfacfe26a1</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hey Sigurd,&lt;/p&gt;
&lt;p&gt;thank you for the quick reply!&lt;/p&gt;
&lt;p&gt;So, you would update the slot1_partition as the following?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;slot1_partition: partition@80000 {
    compatible = &amp;quot;zephyr,mapped-partition&amp;quot;;
    label = &amp;quot;image-1&amp;quot;;
    reg = &amp;lt;0x00080000 0x70000&amp;gt;;
    ranges = &amp;lt;0x0 0x80000 0x70000&amp;gt;;
    #address-cells = &amp;lt;1&amp;gt;;
    #size-cells = &amp;lt;1&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Do I need to add something like this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    chosen {
        nordic,slot1_partition = &amp;amp;slot1_partition;
    };
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I tried combinations of the above, but I still get the same secure fault.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;May I ask you to explain which image number is required when using &amp;quot;dfu_target_init&amp;quot;?&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU target API on NCS v3.4.1</title><link>https://devzone.nordicsemi.com/thread/571700?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2026 09:21:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:259abd0b-541f-4581-b718-a251ae605c66</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;With normal MCUboot swap behaviour, MCuboot does not know about TF-M. It just swaps the application as one blob.&lt;/p&gt;
&lt;p&gt;The application uploads the DFU candidate to the secondary slot. And the application only has Non-Secure access.&lt;br /&gt;So the secondary slot needs to be fully Non-Secure.&lt;/p&gt;
&lt;p&gt;From your DTS file:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* 0x0008_0000 Secondary image area (448 KB):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*&amp;nbsp; &amp;nbsp; 0x0008_0000 Secure&amp;nbsp; &amp;nbsp; &amp;nbsp;image secondary (192 KB)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*&amp;nbsp; &amp;nbsp; 0x000b_0000 Non-secure image secondary (256 KB)&lt;br /&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;For a normal swap-based DFU, I would recommend not splitting the Secondary slot int two partitions; Just use one.&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>