@echo off rem The process of generating DFU files set name="yingying" set BLE_DFU_ENANBLE_flag=0 set BleNameHoldOn_ENANBLE_flag=0 set BleNameHoldOn_ENANBLE_flag=0 set RTT_DEBUG_EN_flag=0 set USE_FIFO_FLAG=0 chcp 65001 echo= echo **********************生成DFU文件***************** echo= cd .. rem KEIL工具的安装目录 set UV=E:\keil530\Keil_v5\UV4\UV4.exe rem 当前目录 set Front_PRO_PATH=%cd% rem 工程目录 set UV_PRO_PATH=%Front_PRO_PATH%\pca10040\s132\arm5_no_packs\ble_app_uart_c_pca10040_s132.uvprojx rem 工程编译的输出目录 set BUILD_HEX_NAME=%Front_PRO_PATH%\pca10040\s132\arm5_no_packs\_build\nrf52832_xxaa.hex rem 工程使能DFU的文件名字 set USR_CONFIG_PACH=%Front_PRO_PATH%\system\usr_config.h rem 存放dfu文件和设置的目录 set DFU_CONFIG_FILE_NAME=%cd%\dfu_readme rem 生成DFU文件的名字 set DFU_FILE_NAME=%DFU_CONFIG_FILE_NAME%\app_dfu_package.zip rem 清除之前的DFU文件和编译的HEX文件 if exist %DFU_FILE_NAME% del %DFU_FILE_NAME% if exist %BUILD_HEX_NAME% del %BUILD_HEX_NAME% findstr /c:"BleNameHoldOn_ENANBLE 1" %USR_CONFIG_PACH%>nul if %errorlevel% equ 0 set /a BleNameHoldOn_ENANBLE_flag=1 findstr /c:"BLE_DFU_ENANBLE 1" %USR_CONFIG_PACH%>nul if %errorlevel% equ 0 set /a BLE_DFU_ENANBLE_flag=1 findstr /c:"JS_RTT_DEBUG_EN 1" %USR_CONFIG_PACH%>nul if %errorlevel% equ 0 set /a RTT_DEBUG_EN_flag=1 findstr /c:"USEFIFO 1" %USR_CONFIG_PACH%>nul if %errorlevel% equ 0 set /a USE_FIFO_FLAG=1 if %BLE_DFU_ENANBLE_flag% equ 1 ( if %BleNameHoldOn_ENANBLE_flag% equ 0 ( echo= echo 正在执行编译固件---------------- echo= %UV% -j0 -b %UV_PRO_PATH% -l %cd%\build_log.txt if exist %BUILD_HEX_NAME% ( nrfutil pkg generate --hw-version 52 --application-version 2 --application %BUILD_HEX_NAME% --sd-req 0xcb --key-file .\dfu_readme\private.key %DFU_FILE_NAME% echo= echo 文件生成成功 echo= echo ================固件信息============================ echo | set /p="硬件版本 " findstr "\