<?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>nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80992/nrf-beacon-can-not-enter-bootloader-from-application</link><description>Hi support team, 
 I have a nrf 51822 beacon black version and developing with nRF5SDK1230. i&amp;#39;m learning about update firmware for it over BLE. i try to run example dfu/bootloader_sercure and create zip file by using nrfutil command. First i erase flash</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Oct 2021 10:42:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80992/nrf-beacon-can-not-enter-bootloader-from-application" /><item><title>RE: nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/thread/336412?ContentTypeID=1</link><pubDate>Thu, 28 Oct 2021 10:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5404e479-60f9-49bf-a3fa-c0e5ff355c3b</guid><dc:creator>Dien Nguyen</dc:creator><description>&lt;p&gt;Thanks Thorsrud, I was deep checking nrf libraries. For everyone, you guy can use as easiest sample to&amp;nbsp;enter bootloader from app using sdk12.3&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;nrf_dfu_settings.h&amp;quot;
#include &amp;quot;crc32.h&amp;quot;
#include &amp;quot;nrf_nvmc.h&amp;quot;

uint8_t  m_dfu_settings_buffer[CODE_PAGE_SIZE] __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS)))
                                               __attribute__((used));
nrf_dfu_settings_t s_dfu_settings;

//boot function
static uint32_t nrf_dfu_settings_calculate_crc(void)
{
    // the crc is calculated from the s_dfu_settings struct, except the crc itself and the init command
    return crc32_compute((uint8_t*)&amp;amp;s_dfu_settings + 4, sizeof(nrf_dfu_settings_t) - 4 - sizeof(s_dfu_settings.init_command), NULL);
}

void enter_boot(void) {
	s_dfu_settings.enter_buttonless_dfu = true;
	s_dfu_settings.crc = nrf_dfu_settings_calculate_crc();
	
	nrf_nvmc_page_erase(BOOTLOADER_SETTINGS_ADDRESS);
	nrf_nvmc_write_bytes(BOOTLOADER_SETTINGS_ADDRESS, (void*)&amp;amp;s_dfu_settings, sizeof(nrf_dfu_settings_t));
}
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/thread/336336?ContentTypeID=1</link><pubDate>Thu, 28 Oct 2021 07:37:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26e00c32-938a-40c9-a6c5-4f336ecd4974</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest you refer to ble_dfu.c, which implements this. For only the part that enters DFU mode, see how enter_bootloader() sets&amp;nbsp;&amp;nbsp;&lt;code&gt;s_dfu_settings.enter_buttonless_dfu = true&lt;/code&gt; and then calls&amp;nbsp;&lt;code&gt;nrf_dfu_settings_write()&lt;/code&gt; to write this to flash. Note that if you want a complete example that use this for buttonless DFU you can refer to the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/ble_sdk_app_buttonless_dfu.html"&gt;Experimental: Buttonless DFU Template Application&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively you can modify the bootloader to use GPREGRET instead, as is done in newer SDK versions. That is a very simple mechanism where you write to the GPREGRET in the application and read it in the bootloader. Remember that it is static and must be explicitly cleared. To see how this can be done, you can check a newer SDK example. Essentially you would just need to add a check in the bootloader in&amp;nbsp;&lt;code&gt;nrf_dfu_enter_check()&lt;/code&gt; in nrf_dfu.c, in the same was as a GPIO pin is read.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/thread/336317?ContentTypeID=1</link><pubDate>Thu, 28 Oct 2021 05:40:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fb11136-054b-41ad-9c71-b3c47f499a85</guid><dc:creator>Dien Nguyen</dc:creator><description>&lt;p&gt;Hi I found this thread &lt;a href="https://devzone.nordicsemi.com/f/nordic-qa/38611/setting-up-ota-for-sdk12"&gt;https://devzone.nordicsemi.com/f/nordic-qa/38611/setting-up-ota-for-sdk12&lt;/a&gt;, he used the same way to enter bootloader NRF_POWER -&amp;gt; GREGRET = 0xB1, but it&amp;#39;s not work with sdk12.3. you said i need to change the bootloader, write something to the settings page. Can you send me some simple code to enter bootloader from app. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/thread/336183?ContentTypeID=1</link><pubDate>Wed, 27 Oct 2021 11:45:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c0afa86-6b09-4e4e-9c33-dc827cc53d99</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see, I read your question too quickly. The issue is just with entering bootloader mode from application, then. Have you modified the bootloader? If not, the approach with writing a magic word to GPREGRET does not work, as it is not read by the bootloader in SDK 12.3, which has another approach for buttonless DFU. Unless you have changed this in the bootloader you need to write to the bootloader settings page to enter DFU mode, as is done by the buttonless BLE DFU service implementation in&amp;nbsp;components\ble\ble_services\ble_dfu\ble_dfu.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/thread/336088?ContentTypeID=1</link><pubDate>Wed, 27 Oct 2021 04:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbefd927-5450-4bab-8030-da4d4d374e50</guid><dc:creator>Dien Nguyen</dc:creator><description>&lt;p&gt;as i said, first beacon is in boot mode, and then i use dfu to update firmware. there is a 32768 crystals on board and it works&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20211027_5F00_115227.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf beacon can not enter bootloader from application</title><link>https://devzone.nordicsemi.com/thread/335713?ContentTypeID=1</link><pubDate>Mon, 25 Oct 2021 11:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63b06cbe-8949-4af1-9547-506ffbebeffa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The first thing that comes to mind as the application works but this fails when you try to enter DFU mode in the bootloader&amp;nbsp; is that the default example bootloader enables the 32.768 kHz crystal, but many simple boards does not have the 32.768 kHz crystal. In that case, the sdk_config.h of the bootloader must be adjusted to use internal RC instead of the crystal. Have you checked that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>