diff --git a/project/ble_peripheral/ble_app_bladder_patch/hex/cpd.bat b/project/ble_peripheral/ble_app_bladder_patch/hex/cpd.bat index e4cebce..37b77a6 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/hex/cpd.bat +++ b/project/ble_peripheral/ble_app_bladder_patch/hex/cpd.bat @@ -132,8 +132,8 @@ 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 (sector-erase only for hex regions, FDS pages untouched) -nrfutil device program --firmware hex\firmware_all.hex --serial-number %SERIALNUMBER% +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. echo [WARNING] Program failed - device may have Readback Protection enabled. @@ -145,7 +145,7 @@ if %errorlevel% neq 0 ( nrfutil device recover --serial-number %SERIALNUMBER% if %errorlevel% neq 0 goto flash_fail echo Re-programming... - nrfutil device program --firmware hex\firmware_all.hex --serial-number %SERIALNUMBER% + nrfutil device program --firmware hex\firmware_all.hex --options chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE --serial-number %SERIALNUMBER% if %errorlevel% neq 0 goto flash_fail ) else ( goto flash_fail