The DFU utility is a python based tool, it supports the erase and write operations on
WINCS02PC module’s Flash memory. It also enables
modification of image sequence number and source address in the header section. The
DFU utility is available in the WINCS02 Silicon Product Page
(rnwf-utilities-vx.x.X\dfu).Figure 8-4. DFU Utility Path
The WINCS02PC module exposes following pins to
perform DFU.
Table 8-1. Pin Description
WINCS02PC
Module
Pin
Description
MCLR_N
4
Master clear Reset, active-low
DFU_Rx/Strap1/PB0
26
DFU pattern clock/UART Rx
DFU_Tx/Strap2/PB1
10
DFU pattern data/UART Tx
WINCS02 Add On Board
The WINCS02 Add On Board design has interconnected
UART1_Tx to PB1/DFU_Tx and UART1_Rx with PB0_Rx to enable both Mission mode and DFU
operation over the single UART interface
Note:
The customer hardware
design can adopt single interface, only if the UART lines can be
multiplexed as a GPIO to trigger the DFU pattern
While performing the DFU,
the module must be powered through the mikroBUS interface (in other
words, Figure 6-1)
Figure 8-5. DFU Setup
The DFU utility simplifies the dependencies installation by providing a requirement
file with all the necessary python modules.
Before running the DFU utility, navigate to
rnwf_utilities_vX.X.X\dfu and install all the requirements
using the following python
command
>python -m pip install -r requirements.txt
Following is the DFU utility command syntax:
> python do_dfu.py [-h] [-b BIN_FILES BIN_FILES | -e ERASE [ERASE ...]] [-s SEQ_NUM] [-p PORT] [-v]
options:
-h, --help show this help message and exit
-b BIN_FILES BIN_FILES
Write option: Erase and write binary file to hexadecimal starting address or section (low,
high, file-system).
-e ERASE [ERASE ...] Erase option: Provide either the hexadecimal starting address and whole number of 4096 byte
pages to erase, or just the section to erase (low, high, file-system).
-s SEQ_NUM Modifies image sequence number. Example format: -s 0xffeeddcc
-p PORT, -port PORT User specific serial number of the FTDIport, else autodetect mechanism will be used.
-v, -verbose
Following section provides the command examples for flashing and erasing the
different image partitions
Update Single/Combined Image
Figure 8-6. Update Single/Combined
Image
Single Image update will Flash both Image1 and Image2 partitions along with
the File system (certificate store). The partition can be specified as low or by its
starting address
(0x60000000).
The OTA Image only include the header and firmware image and does not include
the File-System. The OTA Image can be updated in Image1 (Low) partition or Image2
(High)
partition
The DFU utility is flexible to erase only the given partition of the Flash map. The
-e option is used and either low (Image1) or high (Image2) can be erased. The erase
option is useful to switch the bootable image from other partition of the Flash
map.