<?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>Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103522/application-debbuging-with-secure-dfu-bootloader</link><description>Hello, 
 I want to use the secure DFU bootloader (for OTA update) found in SDK 17.1.0 with a nRF52840-DK board. 
 I try the bootloader and the application named &amp;quot;ble_app_button_less_dfu_pca10056_s140&amp;quot;. When the bootloader is loaded, it run correctly,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Sep 2023 11:34:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103522/application-debbuging-with-secure-dfu-bootloader" /><item><title>RE: Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/445392?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2023 11:34:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f15b8d9d-3d64-49bc-9e60-b5b58278686d</guid><dc:creator>vonRollChristophe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your precise answer. Currently I download (in the order) softDevice, Bootloader, Bootloader settings, and application. And that works. I will try your others solutions.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/445390?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2023 11:26:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:481dbf31-0d28-4e1f-a733-f42eeb887e06</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;ble_dfu_buttonless_async_svci_init() will return an error if the Bootloader is not present (which much be the case if&amp;nbsp;UICR[0] is set to 0xFFFFFFFF). So it seems the flash was erased during or while programming the application when starting the debug session.&lt;/p&gt;
&lt;p&gt;One way around it, could be to load the bootloader as well as the SoftDevice when you start debugging, as you do.&lt;/p&gt;
&lt;p&gt;there are also other problems that can show up when debugging with a bootloader. Perhaps most importantly is that it will check the integrity of the application, and if it has changes (compared to the CRC in the bootloader setting page), the application will not be started. So making a modification and programming, the bootloader would stay in DFU mode and not start the application.&lt;/p&gt;
&lt;p&gt;There are a few ways around that. One is to simply debug without the bootloader, and skip the call to&amp;nbsp;ble_dfu_buttonless_async_svci_init for debug builds, for example by encapsulating with #ifdef DEBUG ... #endif, and then simply don&amp;#39;t program the bootloader when you debug your application. Another is to modify the bootloader to ignore the CRC check, by for instance making&amp;nbsp;app_is_valid() in nrf_bootloader.c in the bootloader always return true if y ou are using a special debug bootloader. A third is to always &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_settings_generate_display.html"&gt;generate and program a bootloader settings page&lt;/a&gt; after flashing a modified application before you start to debug it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/445381?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2023 11:10:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5aebbb9-291c-4ed3-9c6a-8534df1e21b9</guid><dc:creator>vonRollChristophe</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I solved the problem. I download the secure bootloader, the SoftDevice and Bootloader settings before downloaded the application (See attached picture).&lt;br /&gt;That seems work, but I do not know if it is the right way.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Capture-d_1920E900_cran-2023_2D00_09_2D00_11-130757.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/445378?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2023 11:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2316e06-cb36-40c6-8765-5968fd8859bc</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry for late response. I have asked one of our DFU/Bootloader expert to see if he has any opinion here. Will be right back when he suggests/comments on this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/444907?ContentTypeID=1</link><pubDate>Thu, 07 Sep 2023 11:39:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c0dadc5-84eb-4c36-8621-963e0da4cd75</guid><dc:creator>vonRollChristophe</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The problem is in &amp;quot;ble_app_buttonless_dfu_pca10056_s140&amp;quot; project, in main function, when the&amp;nbsp;ble_dfu_buttonless_async_svci_init() function is call, it returns an error in &amp;quot;err_code&amp;quot; variable and the application stops.&lt;/p&gt;
&lt;p&gt;And that&amp;#39;s only in debug. When I download the application with bootloader and NrfConnect, it is run correctly.&lt;/p&gt;
&lt;p&gt;In debbug mode, with Segger IDE, I can see that the&amp;nbsp;&lt;span&gt;ble_dfu_buttonless_async_svci_init() function set an error because the UICR[0] is set to 0xFFFFFFFF. Normaly this register is set to 0x000F8000, the bootloader address.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To reproduce this, you download the &amp;quot;secure_bootloader_ble_s140_pca10056&amp;quot; project in the nRF52840-DK board and after you download the&amp;nbsp;&amp;quot;ble_app_buttonless_dfu_pca10056_s140&amp;quot; application to debug it. And when you read the UICR[0]&amp;nbsp;&lt;/span&gt;register, it is set to 0xFFFFFFFF.&lt;/p&gt;
&lt;p&gt;I hope it will be more clear for you.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I use the Segger IDE version 7.32, a nRF52840-DK (PCA10056 / 3.0.1 / 2023.16 / 1050298998) and the&amp;nbsp;nRF5_SDK_17.1.0_ddde560, if that can help you to understand my problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for your help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Christophe&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application debbuging with secure DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/444884?ContentTypeID=1</link><pubDate>Thu, 07 Sep 2023 10:53:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae850b05-008b-4071-8e14-31b23bb46a0c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Which UICR register reads 0xFFFFFFFF?&amp;nbsp;&lt;br /&gt; Only the bootloader hex file has UICR register addresses in it and the application hex should not touch UICR by default during a DFU. It is reconfigurable in the bootloader as to which UICR_NFW register you want to use.&lt;/p&gt;
&lt;p&gt;It is not clear to me why UICR register gets cleared when you are debugging the application. Can you provide steps to reproduce this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>