rem @擦除
@echo off
:str
cls
rem @提供App(*.hex)
set Application=..\Objects\Immotor_lock.hex
mergehex.exe --merge s130_nrf51_2.0.0_softdevice.hex %Application% --output production_final1.hex
mergehex.exe --merge production_final1.hex bootloader.hex --output A3_Application.hex
nrfjprog --eraseall
rem @指定蓝牙MAC地址
rem @0xC4954D98CD8A
echo please input Mac value :
set /p CurrentMAC=
::echo %CurrentMAC%
rem @擦除UICR寄存器
rem nrfjprog --eraseuicr
set MacL=0x0000%CurrentMAC:~0,4%
set AddrL=0x10001084
nrfjprog --memwr %AddrL% --val %MacL%
set MacR=0x%CurrentMAC:~-8%
set AddrR=0x10001088
nrfjprog --memwr %AddrR% --val %MacR%
rem @烧录
nrfjprog --program A3_Application.hex
rem @复位
nrfjprog --reset
pause
goto str