<?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>USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82922/usb-dfu-bootloader-update-process-nano-33-ble</link><description>Good Saturday evening, 
 Up until now I’ve been accessing the registers directly in my Nano 33 BLEs to experiment with Timers, GPIOTE and PPI, all via the Arduino development environment. However, I’ve now got a Nordic nRF52840-DK official development</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Dec 2021 15:37:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82922/usb-dfu-bootloader-update-process-nano-33-ble" /><item><title>RE: USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/thread/344659?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 15:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:067dd092-b8b7-4cf2-83da-1334ed2f16f9</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;Awesome! Ah the wrong text, lol.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll mark your last but 1 reply as the verified answer, since I can only select 1, but obviously all your answers are correct.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll finish by saying thank you... &amp;quot;thank you&amp;quot;, and wishing myself good luck. Cheers!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/thread/344627?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:20:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61a28b1e-450e-4303-9077-33bbc59608f1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Good to hear &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; I was referring to my remark here:&lt;/p&gt;
[quote user="GaryDT"]&lt;span&gt;&lt;/span&gt;&lt;span&gt;Except we tend not to use the term &amp;quot;DFU&amp;quot; when using the chip&amp;#39;s deticated debug interface for programming.&lt;/span&gt;[/quote]
&lt;p&gt;But I see now that I quoted the wrong text.&lt;/p&gt;
[quote user="GaryDT"]Please confirm about my layman&amp;#39;s guess regarding the relationship of transferring data, i.e., use SES to compile bootloader on PC; use SES to initiate/instruct DK to program (effectively transfer) the bootloader to the nano via the DK?[/quote]
&lt;p&gt;Yes, this is correct. The DK will automatically detect when an external board (nano) is connected, and then program that chip instead of the nRF chip on the DK. SES will not know the difference.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/thread/344439?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 17:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c5f4ff8-bbda-4ab0-9904-1f5b43338803</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;It&amp;#39;s my own humour that&amp;#39;s not very good... please don&amp;#39;t laugh = please feel free to&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f609.svg" title="Wink"&gt;&amp;#x1f609;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s great information and clarification with respect to defining DFU... thank you kindly.&lt;/p&gt;
[quote]&lt;span&gt;nrfutil is only for DFU. For programming with J-link you can use the same tools you use to program the DK (segger embedded studio, nrfjprog, Programmer app in nRF connect for desktop,..)&lt;/span&gt;[/quote]
&lt;p&gt;So I only need SES to do the programming. Final question if I may please...&lt;/p&gt;
&lt;p&gt;Please confirm about my layman&amp;#39;s guess regarding the relationship of transferring data, i.e., use SES to compile bootloader on PC; use SES to initiate/instruct DK to program (effectively transfer) the bootloader to the nano via the DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/thread/344437?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 17:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dee052ab-f1b3-462e-8c0e-7ea8a1f62ba7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I would define it as &amp;quot;DFU&amp;quot; if the nRF gets programmed through any other interface than the SWD, because then you are relying on some existing FW being present (typically a bootloader) on the chip to both enable the interface and store received FW data to flash. While with SWD you can you always re-program the chip as everything is handled in HW.&lt;/p&gt;
&lt;p&gt;The nRF52840 IC are &amp;quot;blank&amp;quot; when they leave our factory, but the module vendors will often ship the modules with a per-preprogrammed bootloader to allow customers to program their application without a J-link programmer.&lt;/p&gt;
[quote user="GaryDT"]But to get to this stage (even when not using BLE), my understanding is that I&amp;#39;ll first need to program my nano to have a Nordic bootloader, and that my DK is used to achieve this. Therefore I&amp;#39;m now thinking that I&amp;#39;ll need to connect the DK&amp;#39;s debug output pins to the nano&amp;#39;s&amp;nbsp;SWDIO, SWCLK, etc?[/quote]
&lt;p&gt;Yes, I think this would be the easiest if not only approach to get the nano board to run the same FW with the same memory layout as the DK.&lt;/p&gt;
[quote user="GaryDT"]My understanding now is that once I have a Nordic bootloader in my nano, I can then program it either by debug and trace, or by DFU USB like I have been so far.[/quote]
&lt;p&gt;Yes. You should always be able to re-program the chip via the the debug interface no matter what SW state the chip is in.&lt;/p&gt;
[quote user="GaryDT"]I&amp;#39;ve read that my DK can be used to program/replace the Arduino bootloader, and therefore I&amp;#39;ve been assuming that I&amp;#39;ll need to use my DK to do that, as I&amp;#39;ve mentioned above. I&amp;#39;ve been imagining (&lt;span style="text-decoration:underline;"&gt;please don&amp;#39;t laugh too much&lt;/span&gt;) that your bootloader examples perform two tasks: 1) make my DK the DFU controller, and 2) transferred&amp;nbsp;DFU receiver functionality to my Nano. I understand now that that is completely wrong. Sorry for any confusion caused.[/quote]
&lt;p&gt;Sorry, that probably came out wrong. What I really wanted to point out that programming via the debug interface is not considered to be the same as DFU for the reason mentioned at the beginning of this post.&lt;/p&gt;
[quote user="GaryDT"]So then I will need to use my DK (I don&amp;#39;t yet have a J-Link)&amp;nbsp;to program one of your bootloaders to my nano?[/quote]
&lt;p&gt;Yes, you can use the DK for this. The on-board J-link has mostly the same features as you get on a standalone J-link.&lt;/p&gt;
[quote user="GaryDT"]Does nRF Util instruct the DK to program the nano, such that the compiled bootloader is residing on the PC, which is then transferred via the DK to the nano? If not, then please kindly explain this part of the process.[/quote]
&lt;p&gt;nrfutil is only for DFU. For programming with J-link you can use the same tools you use to program the DK (segger embedded studio, nrfjprog, Programmer app in nRF connect for desktop,..)&amp;nbsp;&lt;/p&gt;
[quote user="GaryDT"]To summarise, that would then be: DK (or J-Link) connect to PC via a USB lead, and DK&amp;#39;s debug output pins connected to nano&amp;#39;s&amp;nbsp;&lt;span&gt;SWDIO, SWCLK, etc, pins?&lt;/span&gt;[/quote]
&lt;p&gt;This summaries the setup. Also remember to connect ground and Vref on target to VTG (pin next to SWDIO) on the DK.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit: &lt;/strong&gt;forgot to add that it&amp;#39;s voltage on VTG that makes the DK detect if an external board is connected:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;When the external board is powered, the interface MCU will detect the supply voltage of the board and program/debug the target chip on the external board instead of the onboard &lt;span&gt;nRF52840&lt;/span&gt; &lt;a title="A microchip that integrates all the necessary electronic circuits and components of a computer or other electronic systems on a single integrated circuit." href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/dita_common/glossary/glossary.html#soc"&gt;&lt;dfn&gt;SoC&lt;/dfn&gt;&lt;/a&gt;.&amp;quot;&lt;/em&gt;&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: USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/thread/344423?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 15:44:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db82467b-0e91-4327-ae28-fffda64b0b29</guid><dc:creator>GaryDT</dc:creator><description>[quote]Programming via DFU will limit your debugging options, have a slower transfer rate, and it will prevent you from doing full chip erase (you cannot erase the bootloader itself).[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The debug and trace option sounds very interesting. I hadn&amp;#39;t heard of that before.&lt;/p&gt;
[quote]Your PC will act as the DFU controller when you do serial DFU (BLE DFU requires a devkit to provide the BLE connectivity), and the board you have connected via USB will be the DFU target. nrfutil can only program one target at a time.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But to get to this stage (even when not using BLE), my understanding is that I&amp;#39;ll first need to program my nano to have a Nordic bootloader, and that my DK is used to achieve this. Therefore I&amp;#39;m now thinking that I&amp;#39;ll need to connect the DK&amp;#39;s debug output pins to the nano&amp;#39;s&amp;nbsp;SWDIO, SWCLK, etc?&lt;/p&gt;
[quote]Do you have a hex file for the arduino bootloader? In that case, you can restore the original bootloader by re-programming it with the J-link in case it does become &amp;quot;bricked&amp;quot; in the process.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Last night I did manage to find a few references showing how to restore Arduino bootloaders, although I&amp;#39;m not really intending to revert back to Arduino. Assuming that it is debug output to SWDIO, etc (please correct me if I&amp;#39;m mistaken), I&amp;#39;m guessing that by accessing the board via that connection, a bricked board is always recoverable (in that you can program it to have a new bootloader) as long as the hardware isn&amp;#39;t damaged of course?&lt;/p&gt;
[quote]The bootloader will make the board capable of receiving FW images over the selected DFU transports (USB, UART, BLE,..). In other words, make it become a DFU target. We do not have any official examples to make the board act as a DFU controller.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve read that my DK can be used to program/replace the Arduino bootloader, and therefore I&amp;#39;ve been assuming that I&amp;#39;ll need to use my DK to do that, as I&amp;#39;ve mentioned above. I&amp;#39;ve been imagining (&lt;span style="text-decoration:underline;"&gt;please don&amp;#39;t laugh too much&lt;/span&gt;) that your bootloader examples perform two tasks: 1) make my DK the DFU controller, and 2) transferred&amp;nbsp;DFU receiver functionality to my Nano. I understand now that that is completely wrong.&lt;/p&gt;
&lt;p&gt;My understanding now is that once I have a Nordic bootloader in my nano, I can then program it either by debug and trace, or by DFU USB like I have been so far.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote]&lt;span&gt;Correct&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f600.svg" title="Grinning"&gt;&amp;#x1f600;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Except we tend not to use the term &amp;quot;DFU&amp;quot; when using the chip&amp;#39;s deticated debug interface for programming.&lt;/span&gt;[/quote]
&lt;p&gt;Yes, lol... I see what you mean&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f602.svg" title="Joy"&gt;&amp;#x1f602;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But my paragraph continued...&lt;/p&gt;
[quote]...Is this correct? &lt;span style="text-decoration:underline;"&gt;And if so, is it the same for when using a DK as the controller?&lt;/span&gt;[/quote]
&lt;p&gt;&lt;span&gt;So then I will need to use my DK (I don&amp;#39;t yet have a J-Link)&amp;nbsp;to program one of your bootloaders to my nano?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Does nRF Util instruct the DK to program the nano, such that the compiled bootloader is residing on the PC, which is then transferred via the DK to the nano? If not, then please kindly explain this part of the process.&lt;/p&gt;
&lt;p&gt;To summarise, that would then be: DK (or J-Link) connect to PC via a USB lead, and DK&amp;#39;s debug output pins connected to nano&amp;#39;s&amp;nbsp;&lt;span&gt;SWDIO, SWCLK, etc, pins?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB DFU – Bootloader Update Process (Nano 33 BLE)</title><link>https://devzone.nordicsemi.com/thread/344362?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 12:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55f24735-6788-42fa-bac4-f9c40b1f7cd0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;For development and debugging it&amp;#39;s generally better to load the FW images directly through the debug interface (&lt;span&gt;&lt;a title="Debug and trace" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/dif.html?cp=4_0_0_3_7"&gt;Debug and trace&lt;/a&gt;&lt;/span&gt;) over the SWD bus instead of doing DFU through a serial bootloader.&amp;nbsp; This will allow you to program and debug your nano from the Segger IDE.&lt;/p&gt;
&lt;p&gt;Programming via DFU will limit your debugging options, have a slower transfer rate, and it will prevent you from doing full chip erase (you cannot erase the bootloader itself).&lt;/p&gt;
&lt;p&gt;You should be able to program the nano using the &lt;span&gt;&lt;a title="Debug output" href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/dk/hw_debug_out.html?cp=4_0_4_7_9"&gt;Debug output&lt;/a&gt;&lt;/span&gt; pins on your nRF52840DK. These pins are connected to the on-board Jlink debugger.&lt;/p&gt;
[quote user=""]The update process refers to “&lt;em&gt;DFU controller&lt;/em&gt;” (i.e., my DK. But, does my PC work in conjunction with my DK, such that the DK, PC, and Nano, are all communicating simultaneously?)[/quote]
&lt;p&gt;Your PC will act as the DFU controller when you do serial DFU (BLE DFU requires a devkit to provide the BLE connectivity), and the board you have connected via USB will be the DFU target. nrfutil can only program one target at a time.&lt;/p&gt;
[quote user=""]Considering an nRF52840 chip that’s currently using an Arduino bootloader, communicating with another nRF52840 chip that’s currently using a Nordic Bootloader. Is it DFU mode itself that makes communication possible (i.e., “&lt;em&gt;firmware update standard&lt;/em&gt;” &lt;a href="https://www.digikey.co.uk/en/articles/update-firmware-field-using-microcontroller-dfu-mode" rel="noopener noreferrer" target="_blank"&gt;…Using a Microcontroller’s DFU Mode&lt;/a&gt;, an excellent! article), such that by putting my DK and Nano each into DFU mode, the DK can then replace the Nano’s Arduino bootloader with a Nordic bootloader?[/quote]
&lt;p&gt;It depends on whether the arduino bootloader support updates of itself or not. As this is an arduino implementation, I think it&amp;#39;s likely that it only supports application updates for simplicity&amp;#39;s sake. &lt;/p&gt;
[quote user=""]Via this process of replacing the bootloader, is it possible to “&lt;span style="color:rgba(181, 54, 54, 1);"&gt;&lt;u&gt;brick&lt;/u&gt;&lt;/span&gt;” a Nano such that it can’t be recovered easily?[/quote]
&lt;p&gt;Do you have a hex file for the arduino bootloader? In that case, you can restore the original bootloader by re-programming it with the J-link in case it does become &amp;quot;bricked&amp;quot; in the process.&lt;/p&gt;
[quote user=""]Prior to this it seems like my DK acts as a DFU controller which is used to replace the bootloader in my Nano?[/quote]
&lt;p&gt;The PC is always be the DFU controller when you use nrfutil. The DK will howver act as a connectivity bridge when you are doing over-the-air DFU with Bluetooth.&lt;/p&gt;
[quote user=""]I’m guessing that if I select “&lt;em&gt;Build and Run&lt;/em&gt;” in SES, it will then turn my DK into&amp;nbsp;a DFU controller that is&amp;nbsp;capable&amp;nbsp;of replacing the bootloader?[/quote]
&lt;p&gt;The bootloader will make the board capable of receiving FW images over the selected DFU transports (USB, UART, BLE,..). In other words, make it become a DFU target. We do not have any official examples to make the board act as a DFU controller. &lt;/p&gt;
[quote user=""]&lt;u&gt;Setup&lt;/u&gt;: &lt;strong&gt;(b)&lt;/strong&gt; Should I now put my Nano into bootloader mode and connect it to my DK via a micro-USB to micro-USB cable (or do I need to connect to the Nano&amp;#39;s probe pins, SWDIO, SWCLK, etc)? and then hold down button 4 on my DK and turn it on?[/quote]
&lt;p&gt;The nano bootlaoder will probably have a different mechansism to enter bootloader mode. Button 4 is what we use in our bootloader to enter dfu mode (Note: there are other methods to allow buttonless entry into dfu mode as well).&lt;/p&gt;
[quote user=""]&lt;u&gt;USB Setup&lt;/u&gt;: “&lt;em&gt;After connecting the USB cable, the development kit enumerates as a COMx port on Windows…&lt;/em&gt;”. Does this basically mean that my Nano sees the DK, the same as it sees being connected to a PC?[/quote]
&lt;p&gt;Sorry, I&amp;#39;m not sure I understand the question. Both boards will enumare as a COM port when connected to a PC. But neither the nano board or DK has a usb host like the PC has. So you can&amp;#39;t connect them toghether like you can with a PC.&lt;/p&gt;
[quote user=""]&lt;u&gt;Testing&lt;/u&gt;: &lt;strong&gt;(b)&lt;/strong&gt; is &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_open_bootloader.html?cp=8_1_4_4_2" rel="noopener noreferrer" target="_blank"&gt;Open Bootloader with DFU&lt;/a&gt;&amp;nbsp;a good alternative?&amp;nbsp;Are there fewer steps involved (the linked example doesn&amp;#39;t state much compared to the Secure DFU Bootloader example)? Is Open Bootloader generally considered easier to set up than the Secure DFU Bootloader being referred to in this thread? For nRF Util, I can see there&amp;#39;s &amp;quot;Legacy – Uses a simple structure and no security&amp;quot; – therefore maybe this option along with Open Bootloader will work well? (I&amp;#39;m tempted to give it a go now, but I&amp;#39;ll wait and hope for some advice... don&amp;#39;t want to Brick! a Nano).[/quote]
&lt;p&gt;The open bootloader will require the same number of steps. The difference with this bootloader is that it allowed unsiged application and softdevice updates. That is, you don&amp;#39;t have to provide the private key when generating the DFU distribution packet.&lt;/p&gt;
[quote user=""]&lt;strong&gt;&lt;/strong&gt;I&amp;#39;ve read about when using a J-link as the DFU controller for example, that it is connected to a PC via USB lead, and that the DFU target (such as a Nano 33 BLE) connects to the J-Link. [/quote]
&lt;p&gt;Correct &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; Except we tend not to use the term &amp;quot;DFU&amp;quot; when using the chip&amp;#39;s deticated debug interface for programming. &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>