Updating Firmware via USB DFU Based on RT1170
Development Environment
Preparing dfu-util
Steps to Prepare dfu-util
Running the Demo
Using Prebuilt Firmware from SDK
Using Custom Firmware
Performing microcontroller (MCU) firmware upgrades in the field without the aid of external programming tools is a necessary feature.
For MCUs that support USB device controllers, the USB Device Firmware Update (DFU) class offers a solution. the USB_DFU bootloader requires only a PC and a USB cable.
The RT series also provides this feature. In the case of the RT1170, for example, a DFU project is provided in the SDK under the USB class. The project is based on the MCUXpresso IDE. by running the dev_dfu_freertos_cm7 project in the SDK, the RT1170 will be enumerated as a dfu device, and after connecting it to the Host PC via another USB cable, the user can use the “dfu-util” utility to download a firmware to this device.
Software Environment:
Hardware Environment:
dfu-util is used to download Firmware to a DFU device, but it does not add CRC32 to the Firmware. Since the DFU demo in the SDK verifies the CRC32 to ensure the Firmware written to Flash is free from bit errors, modifications to the dfu-util source code are necessary.
After these steps, the newly built tool will be located in the /build/bin folder.
Open cmd for Windows. Run the following command with the new dfu-suffix.exe and CRC32 will be added to the Firmware.
dfu-suffix.1 exe -a your_Firmware
The SDK provides a prebuilt Firmware binary (dev_hid_mouse_bm.bin) that already includes CRC32. Follow these steps:
After downloading, the DFU demo will verify the CRC32 and execute the new Firmware in RAM. The device will be enumerated as a USB mouse, moving in a rectangular pattern on the screen.
When using custom Firmware, ensure that the image is loaded at the correct address (e.g., 0x10000). If the offset is incorrect, the DFU demo will fail to load the Firmware, even if the CRC check passes.
To build and load custom Firmware:
Use the modified dfu-util tool to append CRC32 to the binary and download it to the board. Verify that the custom Firmware executes correctly.
For Chinese version and demo, please check this link:
https://www.nxpic.org.cn/module/forum/forum.php?mod=viewthread&tid=803149&fromuid=3253523