@echo off
set arg1=%1
:: # Check to make sure nrfjprog is installed before moving on
WHERE >nul 2>nul nrfjprog
IF %ERRORLEVEL% NEQ 0 (
ECHO "nrfjprog was not found in PATH, please install using windows installed as found on nordicsemi.com"
goto :end
)
WHERE >nul 2>nul mergehex
IF %ERRORLEVEL% NEQ 0 (
ECHO "mergehex was not found in PATH, please install using windows installed as found on nordicsemi.com"
goto :end
)
SET S132=s132_nrf52_6.1.0_softdevice.hex
SET BOOTLOADER=Beacon_IDCard_SecureBootloader_s132_v1.0.hex
SET APPLICATION=Beacon_IDCard_App_v1.0.hex
echo "## Looking to make sure %S132% exists"
if not exist %S132% (
echo "#### s132 hex file does not exist! Make sure the softdevice is in the same folder as this script!"
goto :end
)
echo.
echo "## Looking to make sure %BOOTLOADER% exists"
if not exist %BOOTLOADER% (
echo "#### Bootloader hex file does not exist! Please make sure its compiled, copied, and renamed into this folder!"
goto :end
)
echo.
echo "## Looking to make sure %APPLICATION% exists"
if not exist %APPLICATION% (
echo "#### Application hex file does not exist! Please make sure its compiled, copied, and renamed into this folder!"
goto :end
)
echo.
echo "## Erasing everything from chip"
nrfjprog --eraseall -f nrf52
echo.
echo "## Merging S132 and bootloader, then flashing it to nRF52; make sure the Device is powered on and connected to the PC"
mergehex -m %S132% %BOOTLOADER% -o merged_SD_bootloader_v1.0.hex
nrfjprog --program merged_SD_bootloader_v1.0.hex -f nrf52 --chiperase
echo.
echo "## Creating bootloader settings based on Beacon_IDCard_App_v1.0.hex"
nrfutil settings generate --family NRF52 --application Beacon_IDCard_App_v1.0.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 --no-backup BLsettings_v1.0.hex
echo.
echo "## Merging bootloader settings and app.hex into merged_App_BLSettings_v1.0.hex"
mergehex -m Beacon_IDCard_App_v1.0.hex BLsettings_v1.0.hex -o merged_App_BLSettings_v1.0.hex
echo.
nrfjprog --program merged_App_BLSettings_v1.0.hex -f nrf52 --sectorerase
echo "## Writing Major/Minor at UICR"
nrfjprog --memwr 0x10001080 -f nrf52 --val %arg1%
echo.
echo "## Reading Major/Minor at UICR"
nrfjprog --memrd 0x10001080 -f nrf52
echo.
echo "## Please power cycling the device and then with nRF Connect, make sure the device is advertising"
nrfjprog.exe -f nrf52 --reset
echo.
:end
pause
nrf 调用nrfjprog 工具 windows脚本jlink烧写
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 在64位的环境,32位的程序调用bat脚本执行cluster.exe 提示 “‘cluster’不是内部或外部命令...
- 3.1 赋值 3.1.1 给变量赋予一个文字字符串的值 说到赋值,就得先弄懂 set 这条命令。set 这条命令比...
- 今天学了个小技能,有必要推广一下。事情是这样的,我经常需要去服务器执行一套更新重启应用的操作,所以写了个脚本。但是...
- cmd命令shutdown有以下几个主要参数:-s(关机) -r(重启) -f(强制关闭所有未响应程序) -t(延...
- 每年的年底,公司都会进行战略规划和经营计划的制定。这个时候,看起来每个人都是非常忙碌的样子,其它的事情都会被推后,...