<?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>Unable to enter bootloader after flashing new firmware with Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61707/unable-to-enter-bootloader-after-flashing-new-firmware-with-segger-embedded-studio</link><description>Hi, 
 I am working on a product based around an nRF52832 (SDK 15.3, S112 v6.1). 
 I am using the Secure Bootloader and I have a script that is used to merge hex files and handle bootloader settings : 
 
 Currently if I flash the firmware_with_bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 May 2020 12:17:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61707/unable-to-enter-bootloader-after-flashing-new-firmware-with-segger-embedded-studio" /><item><title>RE: Unable to enter bootloader after flashing new firmware with Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/251713?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 12:17:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a33aea1-6c72-45dd-9c84-9d2a113aed7a</guid><dc:creator>Nathan O.</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;I have setup post-build command to generate and load the bootloader settings page (see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34212/howto-flash-bootloader-settings-for-dfu-using-ses-at-debug-time"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/34212/howto-flash-bootloader-settings-for-dfu-using-ses-at-debug-time&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The ability to disable the checksum validation in the settings page is actually quite interesting. I might switch to this solution instead of the post-build commands then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to enter bootloader after flashing new firmware with Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/251712?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 12:11:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ef610c5-1097-4e94-a036-de37fb831354</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;SES lets you add custom post-build steps that you can use to automate the generation of the settings page. However, there is also an option to select no boot validation when you generate the settings page. So another easier option could be to create a settings page to use during development which has boot validation of the application disabled. This settings page can be loaded automatically like we do with the Softdevice.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-397b8c67fbeb474089981b5aaa31a65c/pastedimage1590494808802v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to enter bootloader after flashing new firmware with Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/251552?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 15:39:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6295beee-ada8-4cea-9e0a-9877ddc5f06d</guid><dc:creator>Nathan O.</dc:creator><description>&lt;p&gt;Thanks for the response.&lt;br /&gt;&lt;br /&gt;I have tried your proposition :&lt;/p&gt;
&lt;p&gt;I erased all flash on my device, flashed again the hex file containing everything (Bootloader, settings, softdevice and firmware). After that I used SES to flash my device with the firmware only (after removing the softdevice from the Loader settings). The device then restart into bootloader mode and stays there.&lt;/p&gt;
&lt;p&gt;It seems the bootloader is not able to detect the new firmware flashed with SES. Is there anything I have missed ?&lt;/p&gt;
&lt;p&gt;Should I also re-regenerate a bootloader settings page everytime I update my firmware from SES ?&lt;/p&gt;
&lt;p&gt;EDIT : I confirm that this restart in bootloader mode and getting stuck only occurs if the firmware I am trying to flash with SES is different than the one from the merge hex file. Maybe there is a checksum stored somewhere ?&lt;/p&gt;
&lt;p&gt;EDIT2: Ok so it seems that&amp;#39;s it : When starting, the bootloader computes a CRC over the firmware stored in bank 0. After I flash a new version with SES, the checksum fails (obviously).&lt;/p&gt;
&lt;p&gt;If I modify the crc_on_valid_app_required function like this, the firmware starts without problem and I can flash new firmwares with SES without any problem :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static bool crc_on_valid_app_required(void)
{
    bool ret = true;
    if (NRF_BL_APP_CRC_CHECK_SKIPPED_ON_SYSTEMOFF_RESET &amp;amp;&amp;amp;
        (nrf_power_resetreas_get() &amp;amp; NRF_POWER_RESETREAS_OFF_MASK))
    {
        nrf_power_resetreas_clear(NRF_POWER_RESETREAS_OFF_MASK);
        ret = false;
    }
    else if (NRF_BL_APP_CRC_CHECK_SKIPPED_ON_GPREGRET2 &amp;amp;&amp;amp;
            ((nrf_power_gpregret2_get() &amp;amp; BOOTLOADER_DFU_GPREGRET2_MASK) == BOOTLOADER_DFU_GPREGRET2)
            &amp;amp;&amp;amp; (nrf_power_gpregret2_get() &amp;amp; BOOTLOADER_DFU_SKIP_CRC_BIT_MASK))
    {
        nrf_power_gpregret2_set(nrf_power_gpregret2_get() &amp;amp; ~BOOTLOADER_DFU_SKIP_CRC);
        ret = false;
    }
    else
    {
        // Change here
        ret = false;
    }

    return ret;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have looked at the bootloader settings and there does not seem to be any option to skip entirely the CRC check on boot. NRF_BL_APP_CRC_CHECK_SKIPPED_ON_SYSTEMOFF_RESET and NRF_BL_APP_CRC_CHECK_SKIPPED_ON_GPREGRET2 do not seem to be what I want. Any recommendations ? How are people usually doing it ?&lt;/p&gt;
&lt;p&gt;Without the code change in the bootloader, I am able to load a new firmware if I generate (with nrfutil) a new bootloader settings page and flash it after the firmware. with J-flash Lite. Not very practical. Maybe I could automate the generation of the settings page and load it as part of the SES flash process ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to enter bootloader after flashing new firmware with Segger Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/251525?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 14:07:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6367f56f-d252-4d03-976b-1749c784801c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In SDK 15.3.0 we started to store the bootloader start address inside the MBR section at 0xFF8+0xFFC instead of using the UICR as we had done before. The motivation was to have the parameters placed in the main flash region that can be protected by the BPROT/ACL peripheral (ACL is not available on 52832). Unfortunately, this change made it very easy to inadvertently erase the address settings. E.g., if you re-programmed the Softdevice after programming the bootloader. And this is actually what happens when you use SES. It automatically loads the Softdevice hex along with the application hex so the bootloader start address gets erased when you program the app project.&lt;/p&gt;
&lt;p&gt;One way to avoid this is to disable the automatic programming of the Softdevice as shown in the screenshot below.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-397b8c67fbeb474089981b5aaa31a65c/pastedimage1590415403168v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;We did fix this in SDK 16.0.0 by letting the bootloader store the settings inside the MBR at runtime. The change described in the SDK release notes:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Bootloader start address is now placed in UICR at compile time, and the MBR page is&lt;br /&gt;populated at runtime. This is to mitigate problems with flashing&lt;br /&gt;where the MBR was erased.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>