You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
@echo off
|
|
setlocal EnableDelayedExpansion
|
|
|
|
|
|
nrfjprog --memrd 0x10001080 > _temp.txt
|
|
set /p lot_string=<_temp.txt
|
|
nrfjprog --memrd 0x10001084 > _temp.txt
|
|
set /p id_string=<_temp.txt
|
|
|
|
del _temp.txt
|
|
|
|
for /L %%i in (0,1,7) do (
|
|
set "hex_digit=!lot_string:~12,1!"
|
|
set "lot_num=!lot_num!!hex_digit!"
|
|
set "lot_string=!lot_string:~1!"
|
|
)
|
|
|
|
for /L %%i in (0,1,7) do (
|
|
set "hex_digit=!id_string:~12,1!"
|
|
set "id_num=!id_num!!hex_digit!"
|
|
set "id_string=!id_string:~1!"
|
|
)
|
|
|
|
echo lot_num: %lot_num% id_num: %id_num%
|
|
|
|
nrfjprog --eraseall -f NRF52
|
|
|
|
@REM 烧录lot
|
|
nrfjprog -f nrf52 --memwr 0x10001080 --val 0x%lot_num%
|
|
@REM 烧录ID
|
|
nrfjprog -f nrf52 --memwr 0x10001084 --val 0x%id_num%
|
|
|
|
|
|
nrfjprog --program output/app_whole.hex --verify -f NRF52 %烧录%
|
|
if %errorlevel% neq 0 (
|
|
echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
|
echo E 烧录失败 E
|
|
echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
|
endlocal
|
|
exit /b 1
|
|
)
|
|
nrfjprog --reset -f NRF52 %复位%
|
|
if %errorlevel% neq 0 (
|
|
echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
|
echo E 复位失败 E
|
|
echo EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
|
endlocal
|
|
exit /b 1
|
|
)
|
|
|
|
|
|
echo ---------------------------------------------------------------
|
|
echo - done
|
|
echo ---------------------------------------------------------------
|
|
|
|
|
|
endlocal
|