The DFU utility is a Python-based tool that supports erase and write operations on the WINCS02IC Flash memory. It also enables modification of image sequence number and source address in the header section. For more details on the DFU utility, go to WINCS02PE (rnwf-utilities-vx.x.x\dfu).Figure 2-8. DFU Utility Path
To use the DFU utility, the user needs to meet certain hardware and software requirements. The following are the hardware and software requirements:
Hardware
The following are the hardware requirements:
PIC32WM-BW1 Curiosity Board or PIC32WM-BW1Wi-Fi® and Bluetooth® Low Energy Combo MCU Module
For Linux (Ubuntu): The Linux operating system loads the Virtual COM Port (VCP) driver (by default), during the process the script takes care of loading the appropriate driver D2XX/VCP.
Note:sudo permissions are required to run the script.
For more details about the D2XX driver installation, refer to the AN_220 FTDI Drivers Installation Guide for Linux (FT_000723).
The PIC32WM-BW1 Curiosity Board/PIC32WM-BW1 Wi-Fi and Bluetooth Low Energy Combo MCU Module exposes the following pins to perform DFU. To perform the DFU on the PIC32WM-BW1 Wi-Fi and Bluetooth Low Energy Combo MCU Module, the user needs to set up the hardware as follows:
Table 2-1. PIC32WM-BW1Wi-Fi® and Bluetooth® Low Energy Combo MCU Module Pin Descriptions for DFU
PIC32WM-BW1Wi-Fi® and Bluetooth® Low Energy Combo MCU Module
Pin
Description
Pin# on FTDI Header (J8) from PIC32WM-BW1 Curiosity Board
W_MCLR
52
Master Clear Reset (MCLR)
J8.2
DFU_Rx/Strap1/W_PB0
54
DFU pattern clock/UART Rx
J8.4
DFU_Tx/Strap2/W_PB1
53
DFU pattern data/UART Tx
J8.5
GND
32 or 33
GND
J8.1
Note: While performing the DFU, the PIC32WM-BW1 Curiosity Board/PIC32WM-BW1Wi-Fi® and Bluetooth® Low Energy Combo MCU Module must be powered ON.
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
The 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
Figure 2-9. PIC32WM-BW1 Curiosity Board DFU Setup
The following section provides command examples for flashing and erasing the different image partitions.
Update Single/Combined Image
The single image update flashes both image1 and image2 partitions along with the file system (certificate store). The user can specify the partition as low or by its starting address (0x60000000).
The OTA image only includes the header and the firmware image and does not include the filesystem. The OTA image can be updated in the image1 (low) partition or image2 (high) partition.
The DFU utility is flexible to erase only the given partition of the Flash map. Use the -e option to erase either low (image1) or high (image2). The erase option is useful to switch the bootable image from other partitions of the Flash map.
python do_dfu.py -e high
Figure 2-12. Erase Partition
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.