<?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>[softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71708/softdevice-zigbee-problem-with-running-ble-dfu-on-top-of-a-zigbee-running-application</link><description>Hi everyone, 
 Currently, i am working with some zigbee devices using NRF52833 and zigbee SDK 4.1. Now, i want to use BLE DFU with it to update the firmware when needed. 
 There is an example of OTA zigbee server which was pretty helpful until i realized</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Feb 2021 11:42:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71708/softdevice-zigbee-problem-with-running-ble-dfu-on-top-of-a-zigbee-running-application" /><item><title>RE: [softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/thread/295311?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2021 11:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecfe8bee-cb7a-4092-a7a9-5c188a38d7df</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;FYI: When you set the status to Verified Answer, it no longer pops up in my queue if you write anything more in this ticket. If you need to, please either create a new ticket, or send me a PM here on DevZone to let me know about the update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/thread/295302?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2021 11:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdfe70b1-6fe2-42e9-9a6b-deaf2cfb6f97</guid><dc:creator>Edvin</dc:creator><description>[quote user="Tu Hoang"]because i can see that there is some argument for relating to zigbee in nrfutil pkg generate --help[/quote]
&lt;p&gt;&amp;nbsp;Yes it is, but if you are using the BLE bootloader, you should&amp;nbsp;&lt;strong&gt;not&lt;/strong&gt; use --zigbee. For the bootloader, this looks like a completely normal BLE application. It doesn&amp;#39;t need to know about the zigbee stack at all.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tu Hoang"]and i have another problem that bacause i&amp;nbsp; do not use softdevice in the main application, do i really have to include --sd-req in this command, also , my firmware is flash from 0x27000 to 0x6D000 in the memory[/quote]
&lt;p&gt;&amp;nbsp;This applies here as well. Your bootloader is not aware of the zigbee application, so you should use the --sd-req as if it was a BLE application. This is to make sure that the bootloader is not bricked in the future, and to tell the bootloader that it shouldn&amp;#39;t delete the softdevice when the application is received.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It looks like the bootloader is accepting the application, so I am not quite sure why it is not working. Just to make sure, you are using the bootloader found in SDKv4.1.0\examples\dfu\secure_bootloader\pca10056_s140_ble_debug, right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Perhaps you can try to use the attached .bat script from the folder location:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SDKv4.1.0\examples\dfu\secure_bootloader\pca10056_s140_ble_debug\armgcc\test.bat. (adjust it to use your own DK&amp;#39;s serial numbers:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/test.bat"&gt;devzone.nordicsemi.com/.../test.bat&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What it does is simply running a DFU to a BLE application. Just to check whether the issue is with the bootloader or the application.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you tried setting a breakpoint in the application to see if it is hit? Perhaps the application crashes before anything is logged.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can also see how the script generates and programs the bootloader settings. Try to apply the same with your application, and see if it boots up.&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: [softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/thread/295250?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2021 05:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92ecf9da-6684-4d3e-9fe3-ac7a85d15a2d</guid><dc:creator>Tu Hoang</dc:creator><description>&lt;p&gt;Hello Edwin,&lt;/p&gt;
&lt;p&gt;Thank you for your answer,&lt;/p&gt;
&lt;p&gt;I change the marco according to your recommendation and it works fine now may be that is the root of my problem. I am now able to run DFU and connect to my board and upload the new firmware. But there is another problem: after the transfer to 100% the device restart but not boot in to the application and it given out this log&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_dfu_ble: Shutting down BLE transport.

&amp;lt;debug&amp;gt; nrf_dfu_ble: Disconnecting.

&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;debug&amp;gt; app: Valid App

&amp;lt;debug&amp;gt; app: Enter nrf_dfu_app_continue

&amp;lt;debug&amp;gt; app: No copy needed

&amp;lt;debug&amp;gt; app: Setting app as valid

&amp;lt;debug&amp;gt; nrf_dfu_settings: Writing settings...

&amp;lt;debug&amp;gt; nrf_dfu_settings: Erasing old settings at: 0x0007F000

&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 0

&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0

&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;debug&amp;gt; app: App is valid

&amp;lt;debug&amp;gt; nrf_dfu_settings_svci: Erasing settings page additional data.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;it looks like it reset a couple time and does not go in to the application, i do not know why but i think that i have created the zip package wrong, so i want to ask if there is any extra steps for create a zigbee firmware package for DFU because i can see that there is some argument for relating to zigbee in nrfutil pkg generate --help. My memory setting for the app in .ld file is like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0x50000
  RAM (rwx) :  ORIGIN = 0x20000008, LENGTH = 0x1fff8
  uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
  mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
  bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
  uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the bootloader memory&amp;nbsp; is still the same as the example of pca10100_s140_ble_debug, the command i use to create the Zip file is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfutil pkg generate --hw-version 52 --application-version 2 --application _build/nrf52833_xxaa.hex --sd-req 0xCA --key-file app_private_key.pem app_dfu_package.zip&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and i have another problem that bacause i&amp;nbsp; do not use softdevice in the main application, do i really have to include --sd-req in this command, also , my firmware is flash from 0x27000 to 0x6D000 in the memory&lt;/p&gt;
&lt;p&gt;Please give me some hints for this,&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Tu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/thread/295117?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2021 13:40:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8808688-ff4e-4606-94b6-378871f2370a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tu,&lt;/p&gt;
&lt;p&gt;Is this log from before or after you tried to transfer the application to the nRF using the phone?&lt;/p&gt;
&lt;p&gt;What does it say when you try to transfer using the phone?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You say that your nRF52833 doesn&amp;#39;t have an external LFXTAL. Did you apply this into the applications sdk_config.h file? And did you apply it to the bootloader&amp;#39;s sdk_config.h file?&lt;/p&gt;
&lt;p&gt;The definitions that you should look for and change are the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_SDH_CLOCK_LF_SRC 0
#define NRF_SDH_CLOCK_LF_RC_CTIV 16
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
#define NRF_SDH_CLOCK_LF_ACCURACY 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please note the one with the accuracy. You must set this to 1 (500ppm).&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t work, can you please let me know what nRF Connect for iOS/Android says when you try to upload the new image? What does the log from the bootloader say? And what command did you use to generate the image that you are transferring?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please note that the *_debug bootloader project has it&amp;#39;s own sdk_config.h file. It is not the same as the non *_debug version.&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: [softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/thread/295052?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2021 10:39:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93a2dc53-da17-402f-bb9d-34b3c93cc8af</guid><dc:creator>Tu Hoang</dc:creator><description>&lt;p&gt;Hello Edwin,&lt;/p&gt;
&lt;p&gt;Thank you for your detailed answer, i decided to go with the second option of BLE bootloader.&lt;/p&gt;
&lt;p&gt;Earlier today, i tried to test the bootloader with only flashing the soft device and then the bootloader with my custom private key in, So basically, because there is no application inside, the MCU will enter DFU mode rightaway and i can flash my zip firmware package with Bluetooth through the NRF connect app from my phone. But it didn &amp;#39;t instead, after reset it takes like a minutes (sometimes more) to actually appear as a service on the mobile app. And even then, it is still unable to connect and the pings is very large like 15000ms. I turn on the log to see if there is any problem but it seems fine&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Inside main
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: In nrf_bootloader_init
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
00&amp;gt; 
00&amp;gt; &amp;lt;warning&amp;gt; nrf_dfu_settings: Resetting bootloader settings since neither the settings page nor the backup are valid (CRC error).
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Writing settings...
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_s&amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x7E000.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: No firmware to activate.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Boot validation failed. No valid app to boot.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: DFU mode because app is not valid.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; nrf_bootloader_wdt: WDT is not enabled
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: in weak nrf_dfu_init_user
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: timer_stop (0x20002AF4)
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: timer_activate (0x20002AF4)
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Entering DFU mode.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: Initializing transports (found: 1)
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Initializing BLE DFU transport
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Setting up vector table: 0x00072000
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Enabling SoftDevice.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Configuring BLE stack.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Enabling the BLE stack.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: No advertising name found
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Using default advertising name
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Advertising...
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: BLE DFU transport initialized.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
00&amp;gt; 
00&amp;gt; &amp;lt;debug&amp;gt; app: Enter main loop&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using a custom board with nrf52833 in it and it does not have an external crytal to drive the clock. and the example bootloader i used is inside dfu/secured_bootloader/pca10100_s140_ble_debug. When flashing the softdevice and bootloader i use the &amp;quot;make&amp;quot; command from makefile. Since i did not change a thing in the code, i want to ask is there any way that i did it wrong or is it because of my custom board?&lt;/p&gt;
&lt;p&gt;Thank you and please reply soon,&lt;/p&gt;
&lt;p&gt;Best regards, Tu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [softdevice+zigbee] Problem with running BLE DFU on top of a zigbee running application</title><link>https://devzone.nordicsemi.com/thread/294911?ContentTypeID=1</link><pubDate>Wed, 17 Feb 2021 15:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:371a8ff2-3583-4cfd-bad7-547da9a24f5d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tu,&lt;/p&gt;
&lt;p&gt;It is correct as you said, if your application is too large for dual bank, the Zigbee bootloader will not work out of the box, simply because it is designed to download the app in the background while the app is running, so you would need to fit both the old and the new application in the flash at once.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I see it, you have two options:&lt;/p&gt;
&lt;p&gt;1: Use a temporary zigbee application that is smaller than your current application, which only does the job to receive the new application. Then perhaps you can fit both applications in the flash at once, and you don&amp;#39;t need to have a BLE bootloader. Using a BLE bootloader would require you to program the softdevice (BLE stack) as well, so that would also require some flash.&lt;/p&gt;
&lt;p&gt;2: Use a BLE bootloader. As you mentioned, you need some way to tell the device to enter DFU mode. After that you can transfer the new image, with the only flash requirement being that you need to have space for the Softdevice, the bootloader and the new application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The advantage of the zigbee (background) DFU is that the application can download in the background, and it would only require a short reboot to swap the application. You can still use the old zigbee application while the new one is being downloaded. The draw is that the Zigbee transfer is relatively slow, compared to the BLE bootloader, which takes maximum a couple of minutes (but probably ~20-30 seconds) instead of 60 - 90 minutes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for running the &amp;quot;multiprotocol&amp;quot;:&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t need to actually run multiprotocol in your application. If you don&amp;#39;t need to run BLE in your application, all you need to do is to adjust the flash placement of your zigbee application, so that it starts after the softdevice. Then your application would be using Zigbee only, while the bootloader would use BLE only.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need to use BLE (e.g. to put the device in DFU mode, if you don&amp;#39;t want to do it another way, such as a button press or a custom Zigbee command), you can do so. For that, I would recommend you to check the multiprotocol examples from the SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know what you think, and we can go from there.&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>