# dfu_file_create **Repository Path**: duapple/dfu_file_create ## Basic Information - **Project Name**: dfu_file_create - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-29 - **Last Updated**: 2022-03-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # dfu file create 给Simplicity Studio IDE生成的蓝牙.gbl升级文件添加自定义头部信息,用于网关接收升级文件后,确认版本信息,对比Target的版本信息,再决定要不要升级。 头部信息为: ```c typedef struct { uint16_t ncp_ver; uint16_t software_ver; uint16_t hardware_ver; uint8_t reserve[2]; } dev_info_t; ``` create_dfu_file.exe会读取**config.json**文件,改文件包含: ```json { "otaFile": "full_121.gbl", "newOtaFileBaseName": "BGApp", "VersionFile": "user_cmd.h", "headerSize": 32, "isSpecifyVersion": true, "fileVersion": { "ncpVersion": 1, "softwareVersion": 2, "hardwareVersion": 1 } } ``` 指定升级文件路径,指定版本信息文件。如果使用自定义的头部信息,就完善 `isSpecifyVersion` 及后面的内容。 ### 示例 ```bash $ ./create_dfu_file.exe ``` ``` river@SHIELD-HJ:/mnt/g/work/dfu_file_create$ ./create_dfu_file create dfu file version information: [0 1 0 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] create dfu file OK! ``` 将create_dfu_file.exe和配置文件放到工程中,添加上面的命令到gbl生成脚本中,每次编译就可以自动生成需要的升级文件了。