The FT9xx can be accessed through DFU in three main cases:
- If the Flash has no application firmware programmed: FT9xx devices are supplied with the DFU code already included. Because the Flash has no application firmware, the device will enter DFU mode on start-up and will appear as a DFU device when connected to a computer. This is one approach for initial application firmware programming to be carried out in a production environment.
- When programmed with the main application in the field: Once the FT9xx is programmed with application firmware and is out in the field, DFU offers an easy way to do updates. A DFU code module can be included in the application firmware to support this. The DFU can be activated in several ways including:
-
- On each start-up: The FT9xx will appear as a DFU device for a period specified in the DFU code module (e.g. 5 seconds). During this time, the firmware update application on the computer can capture the DFU and begin communication with the bootloader.
- Always active: The DFU is always active and will appear as a DFU endpoint which can be opened at any time by the firmware update application on the computer
- Application code (via GPIO etc.) activation: The application code can activate the DFU. For example, this could be via the state of a GPIO connected to a pushbutton allowing the user to manually activate DFU
- If the Flash checksum fails: On power-up, the FT9xx verifies the flash against the checksum. In the event of failed programming, flash corruption or if an application error results in flash being written without updating the checksum, the checksum will fail and DFU will be activated, allowing the flash to be reprogrammed.
In order to provide DFU updates in the application, the following requirements must be considered:
- Device Side: The application firmware developed in the Eclipse IDE must include the DFU code module. The Bridgetek FT9xx Programming Utility (part of the FT9xx Toolchain) can be used to prepare a DFU compatible version of the resulting binary file by adding the required DFU Suffix. This binary can then be sent to the FT9xx over DFU by the firmware update application (refer to the Computer Side bullet point below). If the main application uses the FT9xx as a USB device already, the DFU will appear as an additional USB endpoint. If the application does not normally act as a USB device, the USB connector can be provided in the harwdare design to allow for it to be used for device firmware updates.
- Computer Side: A suitable application must be provided to the user which will perform the firmware update over DFU. Bridgetek provide the FT9xx Programming Utility (part of the FT9xx Toolchain) which includes a range of programming tools via a graphical user interface but this is not intended for consumers and end-users. Developers can create a user-friendly end-user application or integrate this functionality into their main application software. The functions in Bridgetek’s command line FT9xxProg.exe utility (which is also included with the toolchain) provide a simple way of opening and programming the device over DFU and can be called from the application. The firmware file can be provided to users to download or can be included in an application package, allowing users to perform the update later with no internet connection.
Note: The DFU supports programming but not debugging of the FT9xx. DFU is not recommended as the exclusive interface for the application development phase as DFU can be overwritten, should a version of the application code which does not include the DFU be accidentally programmed.
The Bridgetek UMFTPD2A Programming/Debug module is recommended for development as it supports debugging and provides access even when the DFU is not included in the application firmware. Providing a connector for the UMFTPD2A (or a PCB footprint) on production boards also allows access in future.
Note: Users should take care if preparing their own DFU firmware image manually. Bridgetek provide the FT9xx Programming Utility which helps users to create their firmware image for use with DFU. This tool checks the prefix and that the firmware file is of the correct size for the FT90x or FT93x. It is also possible to prepare a flash image manually using the associated dfu-util and dfu-prefix tools. If doing so, the user must ensure that their firmware is not larger than 252KB for FT90x and 124KB for FT93x to avoid the bootloader at the end of the flash being corrupted. Also, the FT90x/FT93x will enter DFU mode continuously if the application checksum is not calculated correctly or if the FTDI ID byte (0x03 0x04 crc-0 crc-1) is not present at the end of application partition.
For more information on the DFU and Bootloader, see https://brtchip.com/wp-content/uploads/2024/07/BRT_AN_063_FT9xx_Programming-Debugging-and-Troubleshooting.pdf