preserve flash / full erase flash
- preserve: bonding 정보 및 settings/NVS 유지, application만 다시 올리는 용도
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
param(
|
||||
[string]$Hex = "build\merged.hex"
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$RepoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$HexPath = Join-Path $RepoRoot $Hex
|
||||
|
||||
if (-not (Test-Path -LiteralPath $HexPath)) {
|
||||
throw "Hex file not found: $HexPath. Build the project first."
|
||||
}
|
||||
|
||||
Write-Host "[FLASH] FULL ERASE mode"
|
||||
Write-Host "[FLASH] This wipes application flash, NVS/settings, and BLE bonds."
|
||||
Write-Host "[FLASH] Programming: $HexPath"
|
||||
|
||||
nrfjprog --program $HexPath --chiperase --verify --reset
|
||||
@@ -0,0 +1,29 @@
|
||||
param(
|
||||
[string]$Hex = "build\merged.hex",
|
||||
[string]$BuildDir = "build"
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$RepoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$HexPath = Join-Path $RepoRoot $Hex
|
||||
$BuildPath = Join-Path $RepoRoot $BuildDir
|
||||
$Cmake = "C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.exe"
|
||||
if (-not (Test-Path -LiteralPath $Cmake)) {
|
||||
$Cmake = "cmake"
|
||||
}
|
||||
|
||||
Write-Host "[FLASH] Rebuilding: $BuildPath"
|
||||
& $Cmake --build $BuildPath
|
||||
|
||||
if (-not (Test-Path -LiteralPath $HexPath)) {
|
||||
throw "Hex file not found: $HexPath. Build the project first."
|
||||
}
|
||||
|
||||
Write-Host "[FLASH] PRESERVE mode"
|
||||
Write-Host "[FLASH] Uses sector erase, so NVS/settings and BLE bonds are preserved if the hex has no records in settings_storage."
|
||||
Write-Host "[FLASH] settings_storage is expected at 0xFE000-0x100000 for this project."
|
||||
Write-Host "[FLASH] Programming: $HexPath"
|
||||
|
||||
nrfjprog --program $HexPath --sectorerase --verify --reset
|
||||
Reference in New Issue
Block a user