<?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>No merged.hex file when using ncs v3.3.0 without partition manager</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/128314/no-merged-hex-file-when-using-ncs-v3-3-0-without-partition-manager</link><description>Hello everyone, 
 I’m currently porting my old projects from NCS version 2.9.0 to 3.3.0. 
 In doing so, I no longer want to use the outdated Partition Manager; instead, I want to use Zephyr’s default device tree-based memory partitioning. 
 I converted</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Sep 2026 09:34:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/128314/no-merged-hex-file-when-using-ncs-v3-3-0-without-partition-manager" /><item><title>RE: No merged.hex file when using ncs v3.3.0 without partition manager</title><link>https://devzone.nordicsemi.com/thread/571259?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2026 09:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33adac69-c420-4965-897c-aef47468d131</guid><dc:creator>Erlend Isachsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I wanted to share some insight after experimenting with this for a while, since it&amp;#39;s not exactly straight forward.&lt;/p&gt;
&lt;p&gt;I run a NSIB+Upgradable MCUBoot+Upgradable app, using sysbuild, non-secure board variant, dts-style partition configuration on the nRF54L15, where keys are provisioned to the KMU. This configuration might sound specific, but it&amp;#39;s Nordic&amp;#39;s recommended configuration for a secure app setup (CRA compliance etc.). This results in 6 separate images, that can be compacted into two (like Achim Kraus experienced) using SB_CONFIG_MERGED_HEX_FILES=y.&lt;/p&gt;
&lt;p&gt;However, using nrfutil device program on each image separately will overwrite the others, so they need to be merged like Achim Kraus stated ({ZEPHYR_BASE}/scripts/build/mergehex.py). However, unlike &amp;quot;west flash&amp;quot;, the order of operations with nrfutil device program (and nrfjprog most likely) is essential. KMU provision must be done after nrfutil device program merged.hex, otherwise it will overwrite KMU and NSIB won&amp;#39;t boot MCUBoot. Furthermore, after flashing merged.hex it is important to ensure that no reset happens, since that could also cause invalidation of images. &lt;strong&gt;I.e. merge, flash, provision.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;The process of merging into a merged.hex can also be automated through CMake, although it is a bit tedious. I hope Nordic provide an easier way to do this in an upcoming SDK release. Since&amp;nbsp;SB_CONFIG_MERGED_HEX_FILES=y adds the board name to the hex name, I found it easier to set SB_CONFIG_MERGED_HEX_FILES=n, and select the images I needed individually. Please see the CMake snippet below (I have this at the end of my sysbuild/CMakeLists.txt) and adjust output directory, input files and PROJECTNR_APP_NAME according to needs:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Set the output directory for merged.hex
set(OUTPUT_DIR &amp;quot;${CMAKE_CURRENT_LIST_DIR}/../built_images&amp;quot;)
# Set build root
set(BUILD_ROOT &amp;quot;${CMAKE_CURRENT_BINARY_DIR}/..&amp;quot;)

# Find python installation
if(DEFINED WEST_PYTHON AND EXISTS &amp;quot;${WEST_PYTHON}&amp;quot;)
  set(MERGEHEX_PYTHON_EXECUTABLE &amp;quot;${WEST_PYTHON}&amp;quot;)
else()
  find_package(Python3 3.10 COMPONENTS Interpreter REQUIRED)
  set(MERGEHEX_PYTHON_EXECUTABLE &amp;quot;${Python3_EXECUTABLE}&amp;quot;)
endif()

# Set images to merge
set(MERGED_HEX_INPUTS
  ${BUILD_ROOT}/b0/zephyr/zephyr.hex
  ${BUILD_ROOT}/signed_by_b0_mcuboot.hex
  ${BUILD_ROOT}/signed_by_b0_mcuboot_s1_variant.hex
  ${BUILD_ROOT}/PROJECTNR_APP_NAME/zephyr/zephyr.signed.hex
  ${BUILD_ROOT}/app_provision.hex
  ${BUILD_ROOT}/bootconf.hex
)

# Merge
add_custom_target(merge_built_images ALL
  COMMAND &amp;quot;${MERGEHEX_PYTHON_EXECUTABLE}&amp;quot; $ENV{ZEPHYR_BASE}/scripts/build/mergehex.py
    -o ${OUTPUT_DIR}/merged.hex --overlap error ${MERGED_HEX_INPUTS}
  DEPENDS ${MERGED_HEX_INPUTS}
  COMMENT &amp;quot;Merging b0 + MCUboot (s0/s1) + application + provisioning + bootconf into ${OUTPUT_DIR}/merged.hex&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No merged.hex file when using ncs v3.3.0 without partition manager</title><link>https://devzone.nordicsemi.com/thread/570229?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2026 15:50:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d5f8528-3629-4d5b-8fd1-2c8af9fc96fe</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;That results in with NCS 3.4.0:&lt;/p&gt;
&lt;p&gt;&amp;quot;../merged_nrf9160dk_0_14_0_nrf9160.hex&amp;quot;&lt;/p&gt;
&lt;p&gt;is there a way to go back to &amp;quot;merged.hex&amp;quot;?&lt;/p&gt;
&lt;p&gt;Edited:&lt;/p&gt;
&lt;p&gt;Even worser, I don&amp;#39;t see the &amp;quot;merged.hex&amp;quot; from before, there are now two&amp;nbsp;&lt;/p&gt;
&lt;p&gt;merged_nrf9160dk_0_14_0_nrf9160_ns.hex&lt;/p&gt;
&lt;p&gt;merged_nrf9160dk_0_14_0_nrf9160.hex&lt;/p&gt;
&lt;p&gt;I guess, it&amp;#39;s now intended to have them merged by the customer ...&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No merged.hex file when using ncs v3.3.0 without partition manager</title><link>https://devzone.nordicsemi.com/thread/567260?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2026 11:25:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86453c72-8566-4bba-93c7-5db36e2293d5</guid><dc:creator>Chris__H</dc:creator><description>&lt;p&gt;Perfect!&lt;br /&gt;&lt;br /&gt;That is exactly what I needed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No merged.hex file when using ncs v3.3.0 without partition manager</title><link>https://devzone.nordicsemi.com/thread/567256?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2026 09:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bb3a94a-0cab-4462-94c4-85d8c8b7aaeb</guid><dc:creator>BertL</dc:creator><description>&lt;p&gt;You have to add this config to your sysbuild.conf:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;SB_CONFIG_MERGED_HEX_FILES=y&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>