<?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>Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125277/release-build-with-mcuboot-occasionally-bricks-custom-board</link><description>I&amp;#39;m developing for a custom board that has an nRF52832 and an FM25W04 external flash. My application uses nRF Connect SDK v2.9.2. I have a debug build that doesn&amp;#39;t use a bootloader, and a release build that uses MCUboot as the bootloader. I&amp;#39;ve set up</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Dec 2025 13:28:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125277/release-build-with-mcuboot-occasionally-bricks-custom-board" /><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/556976?ContentTypeID=1</link><pubDate>Mon, 15 Dec 2025 13:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acb0091f-b04e-4f71-8b5a-7a0f2f6d7738</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you please try to remove the configs CONFIG_STACK_CANARIES=y and CONFIG_ENTROPY_GENERATOR (if that makes the issue happen again), and then try to add&amp;nbsp;CONFIG_DEBUG_THREAD_INFO=y in that same file, to see if you can determine what thread that is causing this issue. The idea then is to try to increas this thread&amp;#39;s stack size. It is typically done through a Kconfig option, but I don&amp;#39;t know which one to search for without knowing the name of the thread that caused the issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/556800?ContentTypeID=1</link><pubDate>Thu, 11 Dec 2025 17:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5029ed45-fe60-4c8a-a007-4282476eb5de</guid><dc:creator>jyv</dc:creator><description>&lt;p&gt;Hi Edvin, sorry for the delay. I had to work on other stuff and am just getting back to this now. I have been making sure that the&amp;nbsp;&lt;span&gt;CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION value is higher than the current value when I perform a DFU. I&amp;#39;ve also been erasing the secondary image slot on the external flash, but that doesn&amp;#39;t fix the &amp;quot;bricking&amp;quot; issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ve been doing some more debugging by trying to look at the bootloader logs and I was able to capture these log messages once on a bricked board:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.599,395] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****
[00:00:00.599,700] &amp;lt;err&amp;gt; os:   Imprecise data bus error
[00:00:00.600,006] &amp;lt;err&amp;gt; os: r0/a1:  0x8bbbf596  r1/a2:  0x1abd4294  r2/a3:  0x00000128
[00:00:00.605,468] &amp;lt;err&amp;gt; os: r3/a4:  0x00000001 r12/ip:  0x00000040 r14/lr:  0x0000a5db
[00:00:00.605,895] &amp;lt;err&amp;gt; os:  xpsr:  0x21000000
[00:00:00.606,170] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0000a1b6
[00:00:00.606,567] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 26: Unknown error on CPU 0
[00:00:00.606,964] &amp;lt;err&amp;gt; os: Current thread: 0x20000660 (unknown)
[00:00:00.607,299] &amp;lt;err&amp;gt; os: Halting system&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I then ran addr2line:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;% arm-zephyr-eabi-addr2line -e build-release/mcuboot/zephyr/zephyr.elf 0x0000a1b6
/opt/nordic/ncs/v2.9.2/modules/crypto/mbedtls/library/bignum.c:936&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So it looks like there was a fault in this function in mbedtls:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Compare signed values
 */
int mbedtls_mpi_cmp_mpi(const mbedtls_mpi *X, const mbedtls_mpi *Y)
{
    size_t i, j;

    for (i = X-&amp;gt;n; i &amp;gt; 0; i--) {
        if (X-&amp;gt;p[i - 1] != 0) {
            break;
        }
    }

    for (j = Y-&amp;gt;n; j &amp;gt; 0; j--) {
        if (Y-&amp;gt;p[j - 1] != 0) {
            break;
        }
    }

    if (i == 0 &amp;amp;&amp;amp; j == 0) {
        return 0;
    }

    if (i &amp;gt; j) {
        return X-&amp;gt;s;
    }
    if (j &amp;gt; i) {
        return -Y-&amp;gt;s;
    }

    if (X-&amp;gt;s &amp;gt; 0 &amp;amp;&amp;amp; Y-&amp;gt;s &amp;lt; 0) {
        return 1;
    }
    if (Y-&amp;gt;s &amp;gt; 0 &amp;amp;&amp;amp; X-&amp;gt;s &amp;lt; 0) {
        return -1;
    }

    for (; i &amp;gt; 0; i--) {
        if (X-&amp;gt;p[i - 1] &amp;gt; Y-&amp;gt;p[i - 1]) {
            return X-&amp;gt;s;
        }
        if (X-&amp;gt;p[i - 1] &amp;lt; Y-&amp;gt;p[i - 1]) {
            return -X-&amp;gt;s;
        }
    }

    return 0;
}&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have not been able to determine any more information from this though and am still working on it.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, another thing I have found is that enabling the compiler stack canary in my child_image/mcuboot/prj.conf:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ENTROPY_GENERATOR=y
CONFIG_STACK_CANARIES=y&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Seems to consistently make the application properly boot on a bricked board. If I flash a release build again on to the same board, this time with the stack canaries disabled, the board will brick again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am still working on this to try and figure out more info, but in the meantime do you have any ideas on:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Why I&amp;#39;m hitting that bus fault in the bootloader?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Why does enabling compiler stack canaries let my application boot normally?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/553034?ContentTypeID=1</link><pubDate>Fri, 31 Oct 2025 13:56:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2aa3a37-0799-46c9-8e6d-737a2a78a1fa</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;One thing to check is that the&amp;nbsp;CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION=&amp;quot;0.0.1&amp;quot; is higher than the previous one. If it is lower, it will be rejected. However,&amp;nbsp;if you erase the chip (nrfutil device erase) then there should be no traces of another application image with a higher application sign version.&lt;/p&gt;
&lt;p&gt;Let me know what you find!&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/552930?ContentTypeID=1</link><pubDate>Thu, 30 Oct 2025 16:59:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f10377f-ebbe-4a0b-ad68-6b794cc2a8d1</guid><dc:creator>jyv</dc:creator><description>&lt;p&gt;Yes, if I flash a debug build to a bricked board it will run as normal, which leads me to believe that the hardware itself is fine as well as the application.&lt;/p&gt;
&lt;p&gt;Reproduction is one of the issues I am facing in debugging this problem as I have not found any clear reproduction steps. Most of the time when I flash a release build it runs fine, and occasionally it bricks.&lt;/p&gt;
&lt;p&gt;I have not made any changes to the bootloader. Besides the Kconfigs (child_image/mcuboot/prj.conf) and Devicetree properties (child_image/mcuboot.overlay) that I included earlier, I also have a child_image/mcuboot.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;quot;/Users/jyv/Projects/my_project/keys/secret.pem&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also have a release.conf (which extends my application&amp;#39;s prj.conf) that has some bootloader related Kconfigs set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ASSERT=n

CONFIG_WATCHDOG=y
CONFIG_BRICK_GUARD=y
CONFIG_BRICK_GUARD_TIMEOUT=60000

CONFIG_FLASH_LOG_LEVEL_WRN=y

CONFIG_ARCH_LOG_LEVEL_OFF=y
CONFIG_KERNEL_LOG_LEVEL_OFF=y
CONFIG_MPU_LOG_LEVEL_OFF=y

CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_LTO=y
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE=y
CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION=&amp;quot;0.0.1&amp;quot;
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y

CONFIG_ZCBOR=y
CONFIG_MCUMGR=y
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y

CONFIG_STREAM_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y

CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y
CONFIG_MCUMGR_GRP_IMG_STATUS_HOOKS=y

CONFIG_BT_CTLR_ASSERT_OVERHEAD_START=n

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=3072&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I uploaded an image to the device using the nRF Connect for Mobile App, I would use the app_update.bin file generated by my build configuration and I would select the test and confirm option. This process would usually take about a minute to complete (image upload, new image is moved to primary slot, board resets and confirms new image version via logs).&lt;/p&gt;
&lt;p&gt;I have not tried performing a DFU via the nRF Device Manager app, I will try that and get back to you.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/552910?ContentTypeID=1</link><pubDate>Thu, 30 Oct 2025 13:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60fb0a0e-c52c-4eb4-ba97-0337110c233f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;But, if you flash a &amp;quot;debug build&amp;quot; (without a bootloader) to one of the bricked boards, they run as normal, right? So the HW itself is working, right? And apparently also the application?&lt;/p&gt;
&lt;p&gt;I guess there is no way for me to reproduce what you are seeing using a DK?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did you do any changes to the bootloader?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How did you upload it? You mentioned the nRF Connect for Mobile App, but when you did, did you select &amp;quot;test&amp;quot;, &amp;quot;run&amp;quot;, &amp;quot;validate&amp;quot; or something like that? Can you please try uploading it using the nRF Device Manager for mobile?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/552822?ContentTypeID=1</link><pubDate>Wed, 29 Oct 2025 20:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0efd4abd-afd6-479d-b812-47209aa6f6ee</guid><dc:creator>jyv</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for getting back to me.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/125277/release-build-with-mcuboot-occasionally-bricks-custom-board/552769"]1: If you flash the release build, and it &amp;quot;bricks&amp;quot;, and you flash the release build once more, without flashing anything else in between. Is it still bricked? Even if you erase the chip in between? And does it brick immediately, or after a little while?[/quote]
&lt;p&gt;Yes, if I reflash the release build the device is still bricked, even if I erase the chip in between. I usually erase the chip using one of these commands:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfutil device erase
nrfutil device recover&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The device bricks immediately (the application never starts so I believe the bricked devices are getting stuck in the bootloader).&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/125277/release-build-with-mcuboot-occasionally-bricks-custom-board/552769"]2: If you flash the bricked release build to another identical board, and it doesn&amp;#39;t brick, does it behave completely like normal?[/quote]
&lt;p&gt;Yes, the second board that doesn&amp;#39;t brick behaves completely like normal.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/125277/release-build-with-mcuboot-occasionally-bricks-custom-board/552769"]3: Before the brick. Was there ever done a DFU (since the last time the device was reprogrammed using a debugger)?&amp;nbsp;[/quote]
&lt;p&gt;I have been performing DFU&amp;#39;s on our devices with the release build using the Android version of the nRF Connect mobile app. However, I cannot say for sure that all of the bricked boards (currently 3) have had DFU&amp;#39;s performed on them.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/125277/release-build-with-mcuboot-occasionally-bricks-custom-board/552769"]4: What are the symptoms of a bricked device? Do you have any log output?[/quote]
&lt;p&gt;There are a few symptoms I see:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We have set up our application to use the Zephyr logging API via RTT, but I don&amp;#39;t see any logs&lt;/li&gt;
&lt;li&gt;Our application plays an LED sequence on startup, but I do not see this occurring&lt;/li&gt;
&lt;li&gt;Our application has a vibration motor triggered via a touch sensor, this is unresponsive&lt;/li&gt;
&lt;li&gt;An unbricked device can be discovered via the nRF Connect mobile app, but a bricked device will not show up in the app&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;jyv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Release build with MCUboot occasionally bricks custom board</title><link>https://devzone.nordicsemi.com/thread/552769?ContentTypeID=1</link><pubDate>Wed, 29 Oct 2025 13:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fd812db-2dca-49a3-855d-e38ea546e284</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]&lt;p&gt;This is not a true brick however, because if I flash a debug build onto the bricked board the app will run fine, but then if I reflash the release build the board will brick again. Flashing an identical release build onto an identical custom board will usually not brick the second board.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;In this case:&lt;/p&gt;
&lt;p&gt;1: If you flash the release build, and it &amp;quot;bricks&amp;quot;, and you flash the release build once more, without flashing anything else in between. Is it still bricked? Even if you erase the chip in between? And does it brick immediately, or after a little while?&lt;/p&gt;
&lt;p&gt;2: If you flash the bricked release build to another identical board, and it doesn&amp;#39;t brick, does it behave completely like normal?&lt;/p&gt;
&lt;p&gt;3: Before the brick. Was there ever done a DFU (since the last time the device was reprogrammed using a debugger)?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;4: What are the symptoms of a bricked device? Do you have any log output?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>