<?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>nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58687/nrf52-serial-debug-dfu-does-not-work</link><description>Hello everyone, 
 Tools and Software: nRF52DK, nRF52832, SDK 15.3, Serial DFU UART Debug PCA10040, SD132 v6.1.1 
 Application: ble_app_uart_pca10040_s132.hex 
 I have tested the DFU Serial example successfully and it works. However, for development purposes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2020 11:25:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58687/nrf52-serial-debug-dfu-does-not-work" /><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/239079?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 11:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7a65346-bb00-4929-bb0d-6c036cc8f1a7</guid><dc:creator>Navin</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The problem seems to be with nRF Connect GUI programmer.&lt;/p&gt;
&lt;p&gt;Because, when I tried flashing the Bootloader DFU Firmaware using nrfjprog, it worked fine. The application loaded after DFU process completed. So, it doesn&amp;#39;t make much sense to look into the code.&lt;/p&gt;
&lt;p&gt;Anyway thanks for your help..&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Navin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238565?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 14:47:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcab3f52-ec0b-4de1-98d8-cc1ad73474ea</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I am trying to understand what&amp;#39;s going on here, but it doesn&amp;#39;t really make much sense to me.&lt;/p&gt;
&lt;p&gt;Can you check if the flow is something like the following:&lt;/p&gt;
&lt;p&gt;nrf_bootloader_init() -&amp;gt;&amp;nbsp;nrf_bootloader_fw_activate() which returns&amp;nbsp;ACTIVATION_NONE, due to your log (Can you check whether the&amp;nbsp;switch (p_bank-&amp;gt;bank_code) case is&amp;nbsp;NRF_DFU_BANK_INVALID or something else?)&lt;/p&gt;
&lt;p&gt;Then when&amp;nbsp;nrf_bootloader_init() returns ACTIVATION_NONE, it should call&amp;nbsp;dfu_enter_check(). Does this return? Is it called?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, the fault id 0x4002 is an assert. When you get the message:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;error&amp;gt; app: ASSERTION FAILED at /home/$USER/Test/nRF5_SDK_15.3_edit/components/libraries/bootloader/dfu/nrf_dfu_validation.c:988&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That is in the&amp;nbsp;nrf_dfu_validation_boot_validate() function in nrf_dfu_validation.c. What is the callstack at this point? And what is the&amp;nbsp;switch(p_validation-&amp;gt;type)? (What numerical/hexadecimal value?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238519?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 12:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e42400cf-f147-4637-91e1-e7c0125d5fb7</guid><dc:creator>Navin</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;Yes, I received a similar message when I added ASSERT(0) in the main.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;strong&gt;&amp;lt;error&amp;gt; app: ASSERTION FAILED at /home/$USER/Test/nRF5_SDK_15.3_edit/components/libraries/bootloader/dfu/nrf_dfu_validation.c:988&lt;/strong&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No I did not see a message mentioning fatal error. Although it mentioned &amp;quot;&lt;strong&gt;No firmware to activate.&lt;/strong&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/58687/nrf52-serial-debug-dfu-does-not-work/238499"]Can you try to unzip a new unmodified version of the SDK, and test the serial debug bootloader project there? Just to see whether there are any changes that you aren&amp;#39;t aware of.&amp;nbsp;[/quote]
&lt;p&gt;&lt;strong&gt;New SDK Zip&lt;/strong&gt;: I have unzipped a new SDK zip file and tested it. It behaves similarly to the version I tested before adding DEBUG to pre-processor define.&amp;nbsp; So, I believe that there are no modifications in the SDK version that I tested.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/58687/nrf52-serial-debug-dfu-does-not-work/238499"]What HW are you running this on? Is it an nRF52832 DK, or a custom board?[/quote]
&lt;p&gt;I am using nRF52832 DK for running the examples.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Debug Log&lt;pre class="ui-code" data-mode="text"&gt;Process: emStudio
&amp;lt;info&amp;gt; app: Inside main
&amp;lt;debug&amp;gt; app: In nrf_bootloader_init
&amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...
&amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x7E000.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate
&amp;lt;info&amp;gt; app: No firmware to activate.
&amp;lt;error&amp;gt; app: Received a fault! id: 0x00004002, pc: 0x00000000, info: 0x2000FFB8&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Navin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238499?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 11:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85cbcd99-e779-4ff3-bac3-bc621082cb7b</guid><dc:creator>Edvin</dc:creator><description>[quote user="Navin"]What is happening after I removed the function and added DEBUG to processor define?[/quote]
&lt;p&gt;&amp;nbsp;The bootloader projects are quite stripped down (even the debug version) in order to keep the size small. The difference between an application and the bootloader is that the application is placed&amp;nbsp;near the start&amp;nbsp;of the flash, and the bootloader is placed close to the end. Since both grows upwards, it is a bit more tricky to add functionality to the bootloader, because you need to move the entire bootloader down.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Either way, since the bootloader is a bit stripped down, I wanted you to remove the app_error_fault_handler because this is a simplified version of the error handler from the SDK. By removing the function from main.c it will use the _weak implementation of the same function in app_error_weak.h.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then, by adding the DEBUG define you will get some info on where in the project the assertion comes from, like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-66bea4f66bdc4425af67d07c31571a96/pastedimage1583492246936v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;(I just added &amp;quot;ASSERT(0)&amp;quot; in the main() function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Before you removed the DEBUG define, did you see anything else in the log? &amp;quot;Fatal Error&amp;quot;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect that some files in your SDK are changed. The last log doesn&amp;#39;t suggest that anything is wrong, but it stops before the application is started.&lt;/p&gt;
&lt;p&gt;Can you try to unzip a new unmodified version of the SDK, and test the serial debug bootloader project there? Just to see whether there are any changes that you aren&amp;#39;t aware of.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What HW are you running this on? Is it an nRF52832 DK, or a custom board?&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: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238479?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 10:10:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78eec1ef-f98c-4dd0-bb36-6a1a384e04dc</guid><dc:creator>Navin</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;I removed the app_error_fault_handler() from main amd added DEBUG to the processor defines.&lt;/p&gt;
&lt;p&gt;I am not able to find a line that says &amp;quot;ASSERTION FAILED&amp;quot; in the debug/info log messages.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is happening after I removed the function and added DEBUG to processor define?&lt;/p&gt;
&lt;p&gt;- After flashing the image, the controller stays in DFU mode. It is not switching to the APP, but unlike before it is not getting stuck in between DFU and APP switching.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Log from nrfutil:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/after_5F00_DEBUG.log"&gt;devzone.nordicsemi.com/.../after_5F00_DEBUG.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Image of the debug messages on RTT Client:&lt;/p&gt;
&lt;p&gt;&lt;img alt="After adding DEBUG to processor define" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/After_5F00_removing_5F00_errorHandler.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please take a look at these files?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Navin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238458?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 09:31:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2a4de1b-aa2c-45ee-b2f0-417f6d1b28e1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It looks like your bootloader asserts on the line saying:&lt;/p&gt;
&lt;p&gt;Received a fault! id: ...&lt;/p&gt;
&lt;p&gt;Based on the parameters it looks like an&amp;nbsp;NRF_FAULT_ID_SDK_ASSERT.&lt;/p&gt;
&lt;p&gt;Have you done any changes to your bootloader? Remember that some changes you did in the normal bootloader project can affect the debug bootloader as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you try the following:&lt;/p&gt;
&lt;p&gt;Remove the&amp;nbsp;app_error_fault_handler from main.c (comment it out), and define DEBUG in the preprocessor defines in your debug bootloader project. Does the log say something like:&lt;/p&gt;
&lt;p&gt;ASSERTION FAILED at &amp;quot;file name&amp;quot; &amp;quot;line number&amp;quot; ? If so, what assertion does it point to?&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: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238336?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 14:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef0d08ca-f305-404d-a84d-e4b012550559</guid><dc:creator>Navin</dc:creator><description>&lt;p&gt;Please see the log file attached here ... &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/serialDFU_5F00_debug.log"&gt;devzone.nordicsemi.com/.../serialDFU_5F00_debug.log&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238333?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 14:39:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e897c520-c94b-43e2-a027-861f56c3e394</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you please tell me what it prints in the command window after you entered the command:&lt;/p&gt;
&lt;p&gt;&amp;quot;nrfutil -vvvv dfu serial -pkg app_dfu_package.zip -p /dev/ttyACM3 -b 115200&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238321?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 13:58:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cacced6e-3da9-4fb4-a66e-94181a7475ff</guid><dc:creator>Navin</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;I am using Segger Embedded Studio to build the code. I am combining the HEX files using mergehex and using nRF programmer to flash.&lt;/p&gt;
&lt;p&gt;nrfutil says the device is programmed (in the end)..&lt;/p&gt;
&lt;p&gt;Commands used:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nrfutil keys generate private.key&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nrfutil keys display --key pk --format code private.key --out_file public_key.c&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nrfutil settings generate --family NRF52 --application ble_app_uart_pca10040_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nrfutil pkg generate --hw-version 52 --application-version 1 --application ble_app_uart_pca10040_s132.hex --sd-req 0xB7 --key-file private.key app_dfu_package.zip\&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nrfutil -vvvv dfu serial -pkg app_dfu_package.zip -p /dev/ttyACM3 -b 115200&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No, I ran this example out of the box, with RTT as the backend. Please find the SDK config file here. &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6330.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../6330.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The regular version (Without Debug) works fine. The problem is occuring when the image is about to be loaded after the DFU process.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After the update LED 1 is supposed to blink indicating that the App has started. Also, I am not able to put the device into bootloader mode again by pressing Button 4.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you need more information..&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Navin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Serial Debug DFU does not work</title><link>https://devzone.nordicsemi.com/thread/238318?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 13:48:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5278cb6c-aa62-4b9a-ac82-471b2495012d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Out of curiousity, what IDE are you using?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What does nrfutil say when you transfer the image?&lt;/p&gt;
&lt;p&gt;Also, can you please let me know what commands you used to generate the packet? And did you do any other changes in the SDK files? Does the same happen if you start with a fresh unmodified copy of the SDK? Remember that some files are shared, so if you change them in one project, it may affect other projects as well.&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>