-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenocd.cfg
40 lines (31 loc) · 844 Bytes
/
openocd.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- tcl -*-
# JLink SWD requires a fairly recent OpenOCD (0.9.0)
# Tested with Debian package 0.8.0-131-gbd0409a-0~exp1
#debug_level 3
source [find interface/jlink.cfg]
transport select swd
#source [find interface/stlink-v2.cfg]
#transport select hla_swd
set WORKAREASIZE 0
source [find target/nrf51.cfg]
source [find mem_helper.tcl]
# If erase_chip is 1, erase the chip.
# Then flash all of the provided hex files.
proc flashall {hexfiles erase_chip} {
reset halt
if { $erase_chip == 1 } {
# Erase the chip
echo "-- Mass erase"
nrf51 mass_erase
sleep 10
# Need to force a reset in case readback protection was on
reset halt
}
# Flash hex
foreach h $hexfiles {
echo "-- Flashing $h"
flash write_image $h 0 ihex
sleep 10
}
reset run
}