기타
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
echo ==========================================
|
||||
echo MEDiThings Bladder Patch Programming
|
||||
echo (mergehex + nrfutil 8.x)
|
||||
echo ==========================================
|
||||
|
||||
REM -----------------------------------------------------
|
||||
REM Create hex output folder
|
||||
REM -----------------------------------------------------
|
||||
cd /d "%~dp0"
|
||||
echo Working directory: %CD%
|
||||
|
||||
REM -----------------------------------------------------
|
||||
REM Create hex output folder
|
||||
REM -----------------------------------------------------
|
||||
@@ -85,18 +91,29 @@ REM 6. Detect device SERIAL NUMBER
|
||||
REM -----------------------------------------------------
|
||||
echo [6/7] Detecting device serial number...
|
||||
|
||||
for /f %%A in ('
|
||||
powershell -Command "(nrfutil device list --json | Select-String '\"type\":\"info\"' | ConvertFrom-Json).data.devices[0].serialNumber"
|
||||
') do set SERIALNUMBER=%%A
|
||||
set "SERIALNUMBER="
|
||||
|
||||
if "%SERIALNUMBER%"=="" (
|
||||
for /f %%A in ('nrfjprog --ids 2^>nul') do (
|
||||
if not defined SERIALNUMBER set "SERIALNUMBER=%%A"
|
||||
)
|
||||
|
||||
if not defined SERIALNUMBER (
|
||||
for /f %%A in ('
|
||||
powershell -NoProfile -Command "(nrfutil device list --json | ConvertFrom-Json).data.devices[0].serialNumber"
|
||||
') do (
|
||||
if not defined SERIALNUMBER set "SERIALNUMBER=%%A"
|
||||
)
|
||||
)
|
||||
|
||||
if not defined SERIALNUMBER (
|
||||
echo ERROR: No serial number found.
|
||||
echo Check USB connection and Nordic tools installation.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Using Serial Number: %SERIALNUMBER%
|
||||
echo Flashing: recover → erase → program → reset
|
||||
echo Flashing: recover ??erase ??program ??reset
|
||||
|
||||
REM recover
|
||||
nrfutil device recover --serial-number %SERIALNUMBER%
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
echo ==========================================
|
||||
echo MEDiThings Bladder Patch Programming
|
||||
@@ -116,23 +116,34 @@ REM 6. Detect device SERIAL NUMBER and Flash
|
||||
REM -----------------------------------------------------
|
||||
echo [6/6] Detecting device serial number...
|
||||
|
||||
for /f %%A in ('
|
||||
powershell -Command "(nrfutil device list --json | Select-String '\"type\":\"info\"' | ConvertFrom-Json).data.devices[0].serialNumber"
|
||||
') do set SERIALNUMBER=%%A
|
||||
set "SERIALNUMBER="
|
||||
|
||||
if "%SERIALNUMBER%"=="" (
|
||||
for /f %%A in ('nrfjprog --ids 2^>nul') do (
|
||||
if not defined SERIALNUMBER set "SERIALNUMBER=%%A"
|
||||
)
|
||||
|
||||
if not defined SERIALNUMBER (
|
||||
for /f %%A in ('
|
||||
powershell -NoProfile -Command "(nrfutil device list --json | ConvertFrom-Json).data.devices[0].serialNumber"
|
||||
') do (
|
||||
if not defined SERIALNUMBER set "SERIALNUMBER=%%A"
|
||||
)
|
||||
)
|
||||
|
||||
if not defined SERIALNUMBER (
|
||||
echo ERROR: No serial number found.
|
||||
echo Check USB connection and Nordic tools installation.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Using Serial Number: %SERIALNUMBER%
|
||||
echo Flashing: program → reset (NO erase, FDS preserved)
|
||||
echo Flashing: program ??reset (NO erase, FDS preserved)
|
||||
|
||||
REM recover - SKIP to preserve internal flash data
|
||||
REM erase - SKIP to preserve FDS/fstorage data
|
||||
|
||||
REM program (hex 데이터가 있는 영역만 erase, FDS 보존)
|
||||
REM program (hex ?곗씠?곌? ?덈뒗 ?곸뿭留?erase, FDS 蹂댁〈)
|
||||
nrfutil device program --firmware hex\firmware_all.hex --options chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE --serial-number %SERIALNUMBER%
|
||||
if %errorlevel% neq 0 (
|
||||
echo.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
echo ==========================================
|
||||
echo MEDiThings Bladder Patch Programming
|
||||
@@ -116,12 +116,23 @@ REM 6. Detect device SERIAL NUMBER and Flash
|
||||
REM -----------------------------------------------------
|
||||
echo [6/6] Detecting device serial number...
|
||||
|
||||
for /f %%A in ('
|
||||
powershell -Command "(nrfutil device list --json | Select-String '\"type\":\"info\"' | ConvertFrom-Json).data.devices[0].serialNumber"
|
||||
') do set SERIALNUMBER=%%A
|
||||
set "SERIALNUMBER="
|
||||
|
||||
if "%SERIALNUMBER%"=="" (
|
||||
for /f %%A in ('nrfjprog --ids 2^>nul') do (
|
||||
if not defined SERIALNUMBER set "SERIALNUMBER=%%A"
|
||||
)
|
||||
|
||||
if not defined SERIALNUMBER (
|
||||
for /f %%A in ('
|
||||
powershell -NoProfile -Command "(nrfutil device list --json | ConvertFrom-Json).data.devices[0].serialNumber"
|
||||
') do (
|
||||
if not defined SERIALNUMBER set "SERIALNUMBER=%%A"
|
||||
)
|
||||
)
|
||||
|
||||
if not defined SERIALNUMBER (
|
||||
echo ERROR: No serial number found.
|
||||
echo Check USB connection and Nordic tools installation.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user