mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
BUG=none TEST=manual BRANCH=none flash_ec --board=hadoken flash_ec --board=npcx_evb flash_ec --board=samus Use openocd in SWD mode to flash the nRF51 chip. Use warm_reset to exit DEBUG mode. Change-Id: Iaf2827d4ce5be6d61431a3de7ab4f86aa4adde02 Signed-off-by: Myles Watson <mylesgw@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/287039 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
23 lines
569 B
Tcl
23 lines
569 B
Tcl
# Copyright 2015 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
#
|
|
# Command automation for Nordic nRF51 chip
|
|
|
|
proc flash_nrf51 {path offset} {
|
|
reset halt;
|
|
program $path $offset;
|
|
}
|
|
|
|
proc unprotect_nrf51 { } {
|
|
reset halt;
|
|
nrf51 mass_erase;
|
|
}
|
|
|
|
# enable reset by writing 1 to the RESET register
|
|
# This will disconnect the debugger with the following message:
|
|
# Polling target nrf51.cpu failed, trying to reexamine
|
|
proc exit_debug_mode_nrf51 { } {
|
|
mww 0x40000544 1;
|
|
}
|