USB Device Firmware Update (DFU) Bootloader

The device firmware update (DFU) bootloader is a fully functional, ready-to-use application that provides the ability to update a device's software using a USB interface. The bootloader utilizes the USB DFU interface provided by the USB device stack for communications.

Supported Demo Boards

The Embedded SDK kits include a fully functional USB DFU bootloader for the following boards:

Step 1. Install Bootloader

Using the toolchain of your choice, build the provided demo project 'USB-Boot'. This is a bootloader application that supports a USB DFU interface. The bootloader can optionally support receiving encrypted data files. To enable encryption, set CFG_ENCRYPTION in main.c to TRUE or '1'. If CFG_ENCRYPTION is enabled, the bootloader will only accept encrypted data files. Now program the USB-Boot application into the device using your IDE/debugger interface.

The first time this application runs, it may incorrectly decide that there is a valid runtime application that it can launch. This can happen because the demo bootloader simply checks if the memory is non-blank to determine whether a runtime application exists. If this occurs, the bootloader can launch an application that ultimately crashes or hangs. Most of the demo bootloaders contain a manual way (i.e. a physical button) that will force the bootloader to execute. Look at the table below see which button will manually force the bootloader to execute.

Evaluation Board Force Boot Button
NXP LPC1549 LPCXpressoSW1
NXP LPC1769 LPCXpressoSW4
NXP LPC1788 OEMJoystick Center
NXP LPC1857P4_0

Step 2. Create the Runtime Data File

Again, using the toolchain of your choice, build the demo 'USB-Runtime' application. This is an application that can be launched and updated via the bootloader. Depending upon the toolchain, the output data file will either be in binary, Intel hex, or Motorola s-record format.

At this point, the runtime application can be downloaded into the device using the IDE/debugger. The application can be used and debugged as normal but upon reset, it will be running the bootloader for a brief moment until it launches the runtime application.

Step 3. Download the Data File

If the bootloader has been configured to accept encrypted data files (CFG_ENCRYPTION = TRUE), use the Programmer or the Command-Line Programmer application to encrypt the runtime data file prior to downloading it to the device.

The Programmer or the Command-Line Programmer application can be used to download the data file to the device. The demo DFU applications support switching between the bootloader and runtime applications, therefore the programmer application will manage the entire process of downloading the data file and launching the updated application.

Step 4. Custom .NET Application

Create your own .NET application to download data files to the device using the USB Devices Library. Reference the included demo application to learn how to use the library.