<?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>Understanding DFU, DFU Trigger Library, and crypto keys for DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79165/understanding-dfu-dfu-trigger-library-and-crypto-keys-for-dfu</link><description>I have an application that I can install and run on the nRF52840 dongle. But to program the dongle, I need to press the reset button and use nRF Connect. So I am looking at how to do that without pressing the reset button. DFU appears to be the key along</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Oct 2021 07:08:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79165/understanding-dfu-dfu-trigger-library-and-crypto-keys-for-dfu" /><item><title>RE: Understanding DFU, DFU Trigger Library, and crypto keys for DFU</title><link>https://devzone.nordicsemi.com/thread/332475?ContentTypeID=1</link><pubDate>Tue, 05 Oct 2021 07:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bba1146-b34d-4196-b0f2-21a48309a2ab</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are not many exmaples in the SDK that use it, but you can refer to&amp;nbsp;examples\connectivity\ble_connectivity\main.c. There you see it includes&amp;nbsp;nrf_dfu_trigger_usb.h and calls&amp;nbsp;nrf_dfu_trigger_usb_init() when built for pca10059 (nRF52840 dongle). You should also look at the project file under&amp;nbsp;examples\connectivity\ble_connectivity\pca10059\ser_s140_usb_hci\ as well as the sdk_config.h for configuration (search for &amp;quot;TRIGGER&amp;quot;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding DFU, DFU Trigger Library, and crypto keys for DFU</title><link>https://devzone.nordicsemi.com/thread/332412?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 15:30:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c68305f8-f16f-43d6-bf0b-19f1243370a2</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Sorry, but I have gotten no where. I just ditched everything with trying to understand the examples and hoped there would be clear documentation on how to take an existing nRF52840 dongle project and add the trigger library. No such luck. I posted again from that point of view.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding DFU, DFU Trigger Library, and crypto keys for DFU</title><link>https://devzone.nordicsemi.com/thread/327602?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 12:10:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5227fc8b-e31f-4d52-8a15-7c175a081473</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Somehow I add these to my application and I will be able to program the dongle without pressing any buttons[/quote]
&lt;p&gt;Yes. That is a library for the application that makes it possible to trigger DFU mode via DFU.&lt;/p&gt;
[quote user=""]Since I know nothing about DFU and how it works, the tutorials have not been much help as they assume a level of knowledge I simply don&amp;#39;t have. So I decided to look at the open bootloader example here \examples\dfu\open_bootloader in the SDK. I tried to build it and get the cant use debug public key error.[/quote]
&lt;p&gt;If you just want to experiment to learn, then you can stick with the debug key. The problem with that is that you do not have the corresponding private key, so you can only use example upgrade images from the SDK. To use your own upgrade images, you must use your own key pair.&lt;/p&gt;
[quote user=""]Now it looks like I have to download a slew of applications and this project to generate a public key.[/quote]
&lt;p&gt;You just need nrfutil. If you have python on your computer you install it easily using pip: &amp;quot;&lt;code&gt;pip install nrfutil&lt;/code&gt;&amp;quot;. You will anyway need nrfutil to generate upgrade images for the bootloader later (even the open bootloader use signing for the bootloader image itself). Also note that you cannot now update this from nRF Connect programmer, as that is hard coded with the private key that corresponds to the public key used in the bootloader the dongle ships with.&lt;/p&gt;
[quote user=""]&lt;p&gt;If I generate my own keys instead of dealing with the instructions shown here&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/README.md"&gt;https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/README.md&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;can I use that public key instead? &lt;/p&gt;[/quote]
&lt;p&gt;As long as you generate valid key pairs and get it in a pem format for use by nrfutil and a raw key you can use in your bootloader it should work. I expect this will give you more work though, instead of just using nrfutil as instructed. You simply have to copy-paste two commands from the &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_keys_generate_display.html"&gt;documentation&lt;/a&gt;, so there is no learning curve to speak of.&lt;/p&gt;
[quote user=""]What do I do with my private key?[/quote]
&lt;p&gt;The private key is input to nrfutil to sign upgrade images. As you use the open bootloader it is only needed for bootloader upgrades.&lt;/p&gt;
[quote user=""]What are the requirements on these keys?[/quote]
&lt;p&gt;It must be a&amp;nbsp;secp256r1 key pair.&amp;nbsp;&lt;/p&gt;
[quote user=""]Any info/tutorials on understanding DFU from the ground up would be appreciated.[/quote]
&lt;p&gt;&amp;nbsp;The &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_bootloader_modules.html"&gt;bootloader documentation in the SDK&lt;/a&gt; is quite extensive. There are also some tutorials out there, but hey are high level and typically focus on BLE.&lt;/p&gt;
&lt;p&gt;Note that you often do not need to have deep knowledge of the DFU implementation to use it in your product, as the SDK implementations are quote complete and well tested. You can mostly use them as is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>