5.2 Device Firmware Update (DFU) over UART
The WILCS02 modules are secured parts, and all traditional programming interfaces are disabled. These modules can only execute the firmwares which are authorized by Microchip’s signer. As all the programming interfaces are disabled, the WILCS02 Modules enable a special mode called the DFU mode to perform the firmware update. The WILCS02 module provides fail-safe device firmware upgrade by having two image slots in the Flash map. The WILCS02 Modules shipped from Microchip use the image1 partition to store the default firmware.
These firmware images contain a 4-bytes sequence number in the header, which the boot ROM uses to determine which image to boot on every power-up. The boot ROM always chooses the firmware image with the lowest sequence number among the two partitions, but if both images have the same sequence number, it boots the one in the higher memory address (0x600F0000) or from image2 partition.
The sequence number with all zeros and all 0xFFs are reserved (invalid) sequence numbers. During the DFU programming, the boot ROM validates the firmware and checks the authenticity by verifying the signature. If the firmware is not authentic (in other words, not signed by Microchip), the boot ROM invalidates the image by setting the sequence number to zero and thereby rejects these firmware images.