1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- @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=C:\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 bootloader名字
- set BOOTLOADER_NAME=%DFU_CONFIG_FILE_NAME%\central_and_peripheral_bootloader.hex
- rem 生成DFU文件的名字
- set DFU_FILE_NAME=%DFU_CONFIG_FILE_NAME%\bootloader_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 --bootloader-version 0x03 --bootloader %BOOTLOADER_NAME% --sd-req 0xcb --key-file .\dfu_readme\private.key %DFU_FILE_NAME%
- echo=
- echo 文件生成成功
- echo=
- echo ================固件信息============================
- echo | set /p="硬件版本 "
- findstr "\<HARDWARE_VERSION" %USR_CONFIG_PACH%
- echo | set /p="软件版本 "
- findstr "\<SOFTWARE_VERSION" %USR_CONFIG_PACH%
- if %RTT_DEBUG_EN_flag% equ 1 (
- echo RTT波形显示已经打开!!!!!!!!
- )
- if %USE_FIFO_FLAG% equ 1 (
- echo BLE发送,采用FIFO方式发送
- )
- echo | set /p="待机功耗时间间隔(ms) "
- findstr /c:"#define StandByPower_Interval" %USR_CONFIG_PACH%
- echo | set /p="心跳时间间隔(ms) "
- findstr /c:"#define HeartTime_Interval" %USR_CONFIG_PACH%
- echo | set /p="低功耗时间间隔(ms) "
- findstr /c:"#define LowPower_Interval" %USR_CONFIG_PACH%
- echo ===================================================
- echo=
- pause
- )
- )
- )
- echo !!!!!!!!!编译工程失败!!!!!!!!!!!!
- echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- if %BLE_DFU_ENANBLE_flag% equ 0 (
- echo 工程没有开启固件升级的功能,请确认
- )
- if %BleNameHoldOn_ENANBLE_flag% equ 1 (
- echo 工程已经开启蓝牙名字的固定功能,请确认
- )
- echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- echo=
- pause
|