This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB DFU – Bootloader Update Process (Nano 33 BLE)

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 kit. I’m using Segger Embedded Studio and I’ve successfully ran some of the examples within the nRF5 SDK, on my DK.

The official development kit seems awesome, but I also need to transfer binary image executables to my Nano 33 BLEs (…flash program through USB). I’ve also been referring to the following pages amongst others…

Device Firmware Update process

The update process refers to “DFU controller” (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?) and “DFU target” (i.e., any of my Nano 33 BLEs).

  1. 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., “firmware update standard…Using a Microcontroller’s DFU Mode, 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?
  2. Via this process of replacing the bootloader, is it possible to “brick” a Nano such that it can’t be recovered easily?

Secure DFU Bootloader over Serial Link (UART/USB)

  1. Paragraph 2: “The example bootloader accepts images…”. I’m guessing that this is referring to binary images (e.g., my own compiled programs) that can be transferred to the DFU target (my Nanos) via nRF Util (Documentation) (which acts as a DFU controller) running on my PC? … Prior to this it seems like my DK acts as a DFU controller which is used to replace the bootloader in my Nano?
  2. Setup: (a)\examples\dfu\secure_bootloader\pca10056_usb”. Providing I fix the following issue “#error "Debug public key not valid for production. Please see …/README.md to generate it"”, I’m guessing that if I select “Build and Run” in SES, it will then turn my DK into a DFU controller that is capable of replacing the bootloader?
  3. Setup: (b) 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's probe pins, SWDIO, SWCLK, etc)? and then hold down button 4 on my DK and turn it on?
  4. USB Setup: “After connecting the USB cable, the development kit enumerates as a COMx port on Windows…”. Does this basically mean that my Nano sees the DK, the same as it sees being connected to a PC?
  5. Testing: (a)DFU procedure” within “Device Firmware Update process”, further up, refers to Creating a firmware package with nrfutil, which seems to follow on from the steps that I’ve mentioned so far by me now using this nRF Util tool. But there are also 10 testing steps listed here under “Testing” (which I appreciate overlap with other areas of Nordic's info centre that I've linked to). Referring to 1.If you want to create your own firmware package for testing:” – so for example, this will be each time I’ve created some program that I want to run on a Nano? i.e., every time? Referring to 2. Libraries “micro-ecc & Cryptography” – because these two libraries are part of this setup/testing process, I'm assuming that I need to install them before I can transfer any of my own programs to my Nanos? Referring to 5.Program the HEX file.” – it looks like I don’t need to do anything because I’m using SES?
  6. Testing: (b) is Open Bootloader with DFU a good alternative? Are there fewer steps involved (the linked example doesn'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's "Legacy – Uses a simple structure and no security" – therefore maybe this option along with Open Bootloader will work well? (I'm tempted to give it a go now, but I'll wait and hope for some advice... don't want to Brick! a Nano).

Edit: I'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. Is this correct? And if so, is it the same for when using a DK as the controller? I'm wondering about what is connected to what at any given time – conceivably there could be an independent communication between the DK and the Nano which takes care of replacing the bootloader (i.e., PC not involved)? In any case, after the bootloader has been replaced, can programs then be transfered from the PC to the Nano without the DK being involved, like is done by default when using the Arduino bootloader?

  • Awesome! Ah the wrong text, lol.

    I'll mark your last but 1 reply as the verified answer, since I can only select 1, but obviously all your answers are correct.

    I'll finish by saying thank you... "thank you", and wishing myself good luck. Cheers!

Related