!!!!固定名字 生成固件 右.bat 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @echo off
  2. rem The process of generating DFU files
  3. set name="yingying"
  4. set BLE_DFU_ENANBLE_flag=0
  5. set BleNameHoldOn_ENANBLE_flag=0
  6. set BleNameHoldOn_ENANBLE_flag=0
  7. set RTT_DEBUG_EN_flag=0
  8. set USE_FIFO_FLAG=0
  9. chcp 65001
  10. echo=
  11. echo **********************生成DFU文件*****************
  12. echo=
  13. cd ..
  14. rem KEIL工具的安装目录
  15. set UV=C:\Keil_v5\UV4\UV4.exe
  16. rem 当前目录
  17. set Front_PRO_PATH=%cd%
  18. rem 工程目录
  19. set UV_PRO_PATH=%Front_PRO_PATH%\pca10040\s132\arm5_no_packs\ble_app_uart_c_pca10040_s132.uvprojx
  20. rem 工程编译的输出目录
  21. set BUILD_HEX_NAME=%Front_PRO_PATH%\pca10040\s132\arm5_no_packs\_build\nrf52832_xxaa.hex
  22. rem 工程使能DFU的文件名字
  23. set USR_CONFIG_PACH=%Front_PRO_PATH%\system\usr_config.h
  24. rem 存放dfu文件和设置的目录s
  25. set DFU_CONFIG_FILE_NAME=%cd%\dfu_readme
  26. rem 生成DFU文件的名字
  27. set DFU_FILE_NAME=%DFU_CONFIG_FILE_NAME%\app_dfu_package_Right.zip
  28. rem 清除之前的DFU文件和编译的HEX文件
  29. if exist %DFU_FILE_NAME% del %DFU_FILE_NAME%
  30. if exist %BUILD_HEX_NAME% del %BUILD_HEX_NAME%
  31. findstr /c:"BLE_DFU_ENANBLE 1" %USR_CONFIG_PACH%>nul
  32. if %errorlevel% equ 0 set /a BLE_DFU_ENANBLE_flag=1
  33. findstr /c:"JS_RTT_DEBUG_EN 1" %USR_CONFIG_PACH%>nul
  34. if %errorlevel% equ 0 set /a RTT_DEBUG_EN_flag=1
  35. findstr /c:"USEFIFO 1" %USR_CONFIG_PACH%>nul
  36. if %errorlevel% equ 0 set /a USE_FIFO_FLAG=1
  37. if %BLE_DFU_ENANBLE_flag% equ 1 (
  38. if %BleNameHoldOn_ENANBLE_flag% equ 0 (
  39. echo=
  40. echo 正在执行编译固件----------------
  41. echo=
  42. %UV% -j0 -b %UV_PRO_PATH% -l %cd%\build_log.txt
  43. if exist %BUILD_HEX_NAME% (
  44. nrfutil pkg generate --hw-version 52 --application-version 2 --application %BUILD_HEX_NAME% --sd-req 0xcb --key-file .\dfu_readme\private_cp.key %DFU_FILE_NAME%
  45. echo=
  46. echo 文件生成成功
  47. echo=
  48. echo ================固件信息============================
  49. echo | set /p="硬件版本 "
  50. findstr "\<HARDWARE_VERSION" %USR_CONFIG_PACH%
  51. echo | set /p="软件版本 "
  52. findstr "\<SOFTWARE_VERSION" %USR_CONFIG_PACH%
  53. if %RTT_DEBUG_EN_flag% equ 1 (
  54. echo RTT波形显示已经打开!!!!!!!!
  55. )
  56. if %USE_FIFO_FLAG% equ 1 (
  57. echo BLE发送,采用FIFO方式发送
  58. )
  59. echo | set /p="待机功耗时间间隔(ms) "
  60. findstr /c:"#define StandByPower_Interval" %USR_CONFIG_PACH%
  61. echo | set /p="心跳时间间隔(ms) "
  62. findstr /c:"#define HeartTime_Interval" %USR_CONFIG_PACH%
  63. echo | set /p="低功耗时间间隔(ms) "
  64. findstr /c:"#define LowPower_Interval" %USR_CONFIG_PACH%
  65. echo ===================================================
  66. echo=
  67. pause
  68. )
  69. )
  70. )
  71. echo !!!!!!!!!编译工程失败!!!!!!!!!!!!
  72. echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  73. if %BLE_DFU_ENANBLE_flag% equ 0 (
  74. echo 工程没有开启固件升级的功能,请确认
  75. )
  76. if %BleNameHoldOn_ENANBLE_flag% equ 1 (
  77. echo 工程已经开启蓝牙名字的固定功能,请确认
  78. )
  79. echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  80. echo=
  81. pause