8.1 DFU Utility

The DFU utility is a python-based tool and is used to communicate with the bootloader running on the RNWF11 via UART interface. It supports configuring the RNWF11 module into the Bootloader mode and performing write operations on the RNWF11 module’s Flash memory for DFU over the UART interface. The DFU utility is available as part of the RNWF11 release

Hardware and Software Dependencies

Following are the dependencies of the tool.
  • Hardware
    • RNWF11 module
    • PC
  • Software
    • Python 3.x and higher
    • The btl_host.py utility used for DFU is part of the rnwf11_utilities_vX.X.X.zip package available in the RNWF11 product web page.
    • It requires pyserial package to communicate with device over UART. Use the following command to install the pyserial package.
      pip3 install pyserial

Hardware Setup

The RNWF11 module uses following UART pins to perform DFU.
Table 8-1. Pin Description
RNWF11 ModulePinDescription
U1TX29UART Tx
U1RX30UART Rx
An USB-To-UART converter (MCP2200) is embedded on the RNWF11 Add On board and connects the UART pins (29 an 30) to the USB port. User can connect to the USB port on the Add On Board to perform DFU over UART interface.
Note:

Select J5 connector to the jumper “PC 3v3” on Add On board for the use of the USB port.

(Or)

Select “Host 3v3” if the DFU is performed with the Host MCU.

DFU Setup

Figure 8-2. DFU Setup
Following is the DFU utility command syntax:
>python btl_host.py -h
Usage: btl_host.py [options]

Options:
  -h, --help            show this help message and exit
  -v, --verbose         enable verbose output
  -r BAUD, --baud=BAUD  UART baudrate
  -u PARITY, --parity=PARITY
                        UART Parity (none/even/odd)
  -t, --tune            auto-tune UART baudrate
  -i PATH, --interface=PATH
                        communication interface
  -f FILE, --file=FILE  binary file to program
  -a ADDR, --address=ADDR
                        destination address (0x90000000)
  -b, --boot            enable write to the bootloader area

The user can find the images in the RNWF11_Firmware_vX.X.X.zip package from the RNWF11 product web page or the directory ota_demo\tools in the Host MCU examples of the RNWF11 for DFU tests.

Following are two image types:
  1. at_cmd_app_rtos.X.production.ota.bin – the image which contain the default FLFS contents. The FLFS contents include the certificates and keys for secure connection.
  2. at_cmd_app_rtos.X.production.without_flfs.ota.bin – the image which do not contain the FLFS contents. This image is used when the user prefer to retain the FLFS contents after DFU is performed.
The following is the command examples for flashing the image:
python btl_host.py -v -i COM32 -a 0x90000000 -f at_cmd_app_rtos.X.production.ota.bin
Note: The application’s start address of the RNWF11 is always 0x90000000.
Figure 8-3. DFU Utility log