<?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 won&amp;#39;t boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101365/mcuboot-won-t-boot-image-in-2-4-0</link><description>I have an application I have been developing in NCS v2.3.0. I&amp;#39;m trying now to updata to v2.4.0. 
 The application targets NRF5340. 
 It uses NSIB (b0/b0n) and for the application processor also includes mcuboot. 
 It also uses TF-M and I have implemented</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Nov 2024 12:48:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101365/mcuboot-won-t-boot-image-in-2-4-0" /><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/512752?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2024 12:48:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:219624e3-94e2-49c7-bd39-639729aeada3</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Thank you, that patch worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/511267?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2024 11:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f546c138-074e-4c77-b5b2-134b780613c4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Benjamin,&amp;nbsp;&lt;br /&gt;This is an old ticket. Have you tried to test with the patch applied ?&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/vidarbe/sdk-nrf/commit/00ee7b3e0a562304dca7c8da2d3ad4c5b6cc3e9d"&gt;https://github.com/vidarbe/sdk-nrf/commit/00ee7b3e0a562304dca7c8da2d3ad4c5b6cc3e9d&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you used the patch and it still doesn&amp;#39;t solve the problem for you , please create a new ticket.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/510888?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2024 13:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0f3cbf4-4f44-4e80-8f1d-b7ffbc464723</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think I may be having a similar issue when updating my nrf5340_ns project to ncs v2.4.4.&lt;/p&gt;
&lt;p&gt;Does the patch being discussed here just involve changing all instances of &amp;quot;BOOT_HOOK_REGULAR&amp;quot; in &amp;quot;nrf53_hooks.c&amp;quot; to &amp;quot;FIH_BOOT_HOOK_REGULAR&amp;quot; ?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/434795?ContentTypeID=1</link><pubDate>Wed, 05 Jul 2023 19:29:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d17fd716-a61a-4f1d-a2f7-9e1fdaafe361</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Primary issue with mcuboot not working when running with nrf5340dk_nrf5340_cpuapp_ns is resolved after fixing the issue in nrf53_hooks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope that Nordic can add more testing to the releases to avoid future regressions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/434756?ContentTypeID=1</link><pubDate>Wed, 05 Jul 2023 14:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bab96253-c7f5-45a1-830b-3be5de6845a1</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Anthony,&lt;/p&gt;
&lt;p&gt;I will continue helping in this case.&lt;/p&gt;
[quote user="anthony.asterisk"]&lt;p&gt;Also it would be wonderful if somehow VSCode would be aware of nrf53_hooks., I had to a perform a global&amp;nbsp;grep&amp;nbsp;of the entire v2.4.0 code base from the shell to locate nrf53_hooks.c, and its still unclear to me how/when this files is used.&amp;nbsp; With SES at least we always had easy access to all of the source code that was included.&amp;nbsp; Now its a complete mystery.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Even worse VSCode actually shows incorrect macro values, I have to determine the correct values by logging them at run time.&amp;nbsp; For example the value of &lt;span&gt;FIH_BOOT_HOOK_REGULAR reports as 1 in VSCode but reports as&amp;nbsp;0x19c1f6e1 at run time.&amp;nbsp; I suppose this is probably an artifact of child images having different&amp;nbsp;config&amp;nbsp;settings.. there needs to be a way to deal with that.&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;For what it&amp;#39;s worth, I agree that our extensions search features have potential for improvement.&lt;br /&gt;I will convey your feedback to our VS Code team, thank you for sharing your thoughts!&lt;/p&gt;
&lt;p&gt;Seems to me that you have solved some of the issues in this case.&lt;br /&gt;To avoid misunderstandings:&lt;br /&gt;Do you need help with anything else in this ticket?&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><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/434001?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 16:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa2e3491-0456-4a0a-a78f-1dd9e5a12470</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Yes I can confirm that after modifying nrf53_hooks.c mcuboot detected the primary slot as valid.&lt;/p&gt;
&lt;p&gt;It would be great if in addition to fixing this, they actually included the nrf5340dk_nrf5340_cpuapp_ns in the regression testing.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also it would be wonderful if somehow VSCode would be aware of nrf53_hooks., I had to a perform a global&amp;nbsp;grep&amp;nbsp;of the entire v2.4.0 code base from the shell to locate nrf53_hooks.c, and its still unclear to me how/when this files is used.&amp;nbsp; With SES at least we always had easy access to all of the source code that was included.&amp;nbsp; Now its a complete mystery.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Even worse VSCode actually shows incorrect macro values, I have to determine the correct values by logging them at run time.&amp;nbsp; For example the value of &lt;span&gt;FIH_BOOT_HOOK_REGULAR reports as 1 in VSCode but reports as&amp;nbsp;0x19c1f6e1 at run time.&amp;nbsp; I suppose this is probably an artifact of child images having different&amp;nbsp;config&amp;nbsp;settings.. there needs to be a way to deal with 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;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/433989?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 15:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a54e14fb-7a6b-4a6b-afba-00b0ec903da7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the updates. I notice that the &amp;#39;nrf5340dk_nrf5340_cpuapp_ns&amp;#39; target is not being tested for the smp_srv sample; only the &amp;#39;nrf5340dk_nrf5340_cpuapp&amp;#39; target is being tested. If you patch nrf53_hooks.c, would you be able to make it work for now? I&amp;#39;ll discuss this further with the developers when they return to the office on Monday.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/433808?ContentTypeID=1</link><pubDate>Thu, 29 Jun 2023 23:26:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1325fe85-b8ae-4c24-a7b6-0a75cca9faf9</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Confirmed...&lt;/p&gt;
&lt;p&gt;v2.4.0/nrf/modules/mcuboot/hooks/nr53_hooks.c is returning BOOT_HOOK_REGULAR instead of FIH_BOOT_HOOK_REGULAR.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not clear on how/when nrf53_hooks.c gets pulled in, but it seems it has not been tested with mcuboot with FIH.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/433807?ContentTypeID=1</link><pubDate>Thu, 29 Jun 2023 23:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bda86f63-725f-4797-b9f6-a5fddf53e52f</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;It looks like wherever boot_image_check_hook is coming from, it has not been updated to work with the Fault Injection Hardening FIH.&amp;nbsp; FIH is changing the&amp;nbsp;&lt;span&gt;FIH_BOOT_HOOK_REGULAR to&amp;nbsp;0x19C1F6E1 as I can see from this modified log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;*** Booting Zephyr OS build v3.3.99-ncs1 ***&lt;br /&gt;I: Starting bootloader&lt;br /&gt;I: Swap type: none&lt;br /&gt;I: Swap type: none&lt;br /&gt;E: boot_image_check_hook returned 0x1 regular is 0x19c1f6e1&lt;br /&gt;E: Image in the primary slot is not valid!&lt;br /&gt;E: header is valid and rc is 1&lt;br /&gt;E: Unable to find bootable image&lt;br /&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;Are there different boot_image_check_hooks for nrf5340 ?&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do I need to disable the FIH profile for mcuboot to work?&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;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT won't boot image in 2.4.0</title><link>https://devzone.nordicsemi.com/thread/433805?ContentTypeID=1</link><pubDate>Thu, 29 Jun 2023 22:49:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24194a15-3167-4dbd-8360-26281f7ec8c5</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;I modified my config, removing:&lt;/p&gt;
&lt;p&gt;CONFIG_LOG_DEFAULT_LEVEL=0&lt;/p&gt;
&lt;p&gt;and I now get a few more relevant logs.&amp;nbsp; I further extended the logging in bootloader/mcuboot/boot/bootutil/loader.c, adding logs:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    BOOT_HOOK_CALL_FIH(boot_image_check_hook, FIH_BOOT_HOOK_REGULAR,
                       fih_rc, BOOT_CURR_IMG(state), slot);
    BOOT_LOG_ERR(&amp;quot;boot_image_check_hook returned %d&amp;quot;, fih_rc);
    if (FIH_EQ(fih_rc, FIH_BOOT_HOOK_REGULAR))
    {
        FIH_CALL(boot_image_check, fih_rc, state, hdr, fap, bs);
        BOOT_LOG_ERR(&amp;quot;boot_image_check returned %d&amp;quot;, fih_rc);
    }
    if (!boot_is_header_valid(hdr, fap) || FIH_NOT_EQ(fih_rc, FIH_SUCCESS))
    {
        if ((slot != BOOT_PRIMARY_SLOT) || ARE_SLOTS_EQUIVALENT())
        {
            flash_area_erase(fap, 0, flash_area_get_size(fap));
            /* Image is invalid, erase it to prevent further unnecessary
             * attempts to validate and boot it.
             */
        }
#if !defined(__BOOTSIM__)
        BOOT_LOG_ERR(&amp;quot;Image in the %s slot is not valid!&amp;quot;,
                     (slot == BOOT_PRIMARY_SLOT) ? &amp;quot;primary&amp;quot; : &amp;quot;secondary&amp;quot;);
        BOOT_LOG_ERR(&amp;quot;header %s valid and rc is %d&amp;quot;,
                     (boot_is_header_valid(hdr, fap) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;),
                     fih_rc);
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and here are the logs I&amp;#39;m getting&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;*** Booting Zephyr OS build v3.3.99-ncs1 ***&lt;br /&gt;I: Starting bootloader&lt;br /&gt;I: Swap type: none&lt;br /&gt;I: Swap type: none&lt;br /&gt;E: boot_image_check_hook returned 1&lt;br /&gt;E: Image in the primary slot is not valid!&lt;br /&gt;E: header is valid and rc is 1&lt;br /&gt;E: Unable to find bootable image&lt;/p&gt;
&lt;p&gt;The log indicates the boot_image_check_hook is returning 1 (e.g.&amp;nbsp;FIH_BOOT_HOOK_REGULAR)&amp;nbsp; but for some reason I&amp;#39;m not getting the log reporting the return value of boot_image_check..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>