<?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>Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70882/creating-custom-op-code-for-the-dfu</link><description>Hello, 
 I&amp;#39;m currently working on a custom DFU op-code that allows the MCU to send a &amp;quot;pause&amp;quot; op-code, similar to the op-codes found in the DFU protocol. 
 The steps I&amp;#39;ve taken to complete this are following cloning the pc_nrfconnect_ble (v2.5.0) repository</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Jan 2021 14:42:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70882/creating-custom-op-code-for-the-dfu" /><item><title>RE: Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/thread/291830?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 14:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e97b794-eee4-42b8-8b9e-e7c0edac2882</guid><dc:creator>PF-JohnF</dc:creator><description>&lt;p&gt;I would agree with you that making a modified version of NRF connect is somewhat overkill. We might instead modify nrfutil with a custom characteristic like you stated.&lt;/p&gt;
&lt;p&gt;I assumed that all the DFU programs didn&amp;#39;t try to reconnect to the device if something went wrong, such as a power outage or an error. I&amp;#39;ll have to make sure that nrfutil doesn&amp;#39;t do this, because the best temporary solution may be to decrease the NRF_BL_FW_COPY_PROGRESS_STORE_STEP size and allow the DFU to autoreconnect when it powers off.&lt;/p&gt;
&lt;p&gt;Your suggestions have been very helpful, and we really appreciate it. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/thread/291666?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 07:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:379a73ae-de54-4307-8d30-7ccd3501f11d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;So you are using a computer to perform the DFU, right? And you want to create your own version of nRF Connect for Desktop?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know if we are the best to help you with javascript. And if you are only going to use it for DFU, perhaps it is a bit overkill. I suggest you look into nrfutil. We mostly work on the applications on the nRF, and we don&amp;#39;t have many people working with javascript, apart from the team that writes these tools for us. If you want to build nRF Connect for Desktop on your own, I suggest you see if you can find someone who is experienced with javascript.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="PF-JohnF"]However the issue that we are trying to avoid is a reboot, because this means that the user initiating the DFU will have to reconnect to the DFU target, select the file, and resume the DFU.[/quote]
&lt;p&gt;&amp;nbsp;That of course depends on the application performing the DFU, and what it does when the device disconnects. If it just starts looking for the same device that it disconnected from, and then resume the operation with the same application image when it reconnects, the user doesn&amp;#39;t have to do anything.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I thought that the device would turn off because it ran out of power, as it is an energy harvesting device? But perhaps I misunderstood.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I believe the easiest workaround if you need the pause functionality is to add a custom characteristic that you can write to, that the DFU master (the device that performs the DFU on the DFU target) can enable notifications on, and then pause the update when it receives a message saying so. However, you would still need to modify nRF Connect for Desktop or nrfutil.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In case you are a company that works mostly with embedded FW, I suggest you look into the &lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil"&gt;implementation of nrfutil&lt;/a&gt;. Either way, I suggest you try it out to perform a regular dfu on a DK, to see how it is workin.&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: Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/thread/291568?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 15:18:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8269bb2-8932-4c42-a598-5571acc13f5a</guid><dc:creator>PF-JohnF</dc:creator><description>&lt;p&gt;You are correct that the DFU target is the energy harvesting board.&lt;/p&gt;
&lt;p&gt;We are already using the NRF_DFU_SAVE_PROGRESS_IN_FLASH setting, which is super useful when the DFU does not reach completion due to timeouts or the power running out. I had not seen anything relating to NRF_BL_FW_COPY_PROGRESS_STORE_STEP, but I will test it out.&lt;/p&gt;
&lt;p&gt;However the issue that we are trying to avoid is a reboot, because this means that the user initiating the DFU will have to reconnect to the DFU target, select the file, and resume the DFU.&lt;/p&gt;
&lt;p&gt;What we are proposing is instead the DFU can pause and still be connected to the device that initiated the DFU. That way there is less user input and the process is more automatic once initiated.&lt;/p&gt;
&lt;p&gt;Going back to what I asked in the original post, would it be better to add to the DFU op-codes, or should I instead add a custom service?&lt;/p&gt;
&lt;p&gt;Thank you for your help thus far.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/thread/291459?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 09:58:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:880c5efb-5584-4f7b-af50-b8a9822c45d9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So let me see if I understand:&lt;/p&gt;
&lt;p&gt;The DFU target is the energy harvesting board, right?&lt;/p&gt;
&lt;p&gt;By default, the bootloader and nrfutil is supposed to handle disconnects, but the behavior depends on the bootloader projects sdk_config.h settings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is a setting called&amp;nbsp;NRF_DFU_SAVE_PROGRESS_IN_FLASH. It saves the progress, and currently received image in flash. When the device runs out of power, it will continue from where it left off when it resumes. This is initially intended in case of disconnects, but I guess it will work in your case as well. The amount of data that is received before storing it in flash is determined by the definition&amp;nbsp;NRF_BL_FW_COPY_PROGRESS_STORE_STEP.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Test it out and see if that is something that you can use, and if this is sufficient. If not, figure out what you need in addition to this. Perhaps you don&amp;#39;t need to change anything in nrfutil at all.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="PF-JohnF"]I will look at nrfutil, but I haven&amp;#39;t been able to get the OTA BLE operation to work using nrfutil in the past.[/quote]
&lt;p&gt;&amp;nbsp;I guess you already use nrfutil to generate the DFU images. To perform the DFU using nrfutil you need an extra DK/dongle, and you perform the update by using:&lt;/p&gt;
&lt;p&gt;nrfutil dfu ble ...&lt;/p&gt;
&lt;p&gt;Use the command &amp;quot;nrfutil dfu ble --help&amp;quot; to see the options that you have.&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: Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/thread/291358?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 17:52:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5bb6305-520b-4f57-90f6-f1db584580c6</guid><dc:creator>PF-JohnF</dc:creator><description>&lt;p&gt;We are developing an energy harvesting board that is very low power (&amp;lt;100uA). The energy storage on board is around 500uF and we can&amp;#39;t guarantee a set current into the capacitors. When the capacitors get low they will trigger an event that will alert the DFU to pause so the capacitors can charge back up and then resume normal DFU operation once above a certain voltage.&lt;/p&gt;
&lt;p&gt;The previous application only needs to be started again if the DFU process fails or is aborted. The previous application does not need to be started if the DFU is paused so the capacitors can regain charge.&lt;/p&gt;
&lt;p&gt;I will look at nrfutil, but I haven&amp;#39;t been able to get the OTA BLE operation to work using nrfutil in the past.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating custom op-code for the DFU</title><link>https://devzone.nordicsemi.com/thread/291273?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 13:13:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9341cf26-82cb-4ddb-9cbf-f879060b8150</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I think that you need to start by looking into nrfutil, as this is the default tool used to connect to, and perform DFU. I have never compiled it myself. You would also need to implement the new opcodes in the bootloader FW.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Why do you want to pause it? What should happen when you pause the DFU process? Do you need it to start the previous application again?&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>