Skip to content

Commit 0b9d9ff

Browse files
committed
Add proper support to nrfjprog interface
1 parent 17499c3 commit 0b9d9ff

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

workspace_tools/make.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,28 @@
167167
if options.disk:
168168
# Simple copy to the mbed disk
169169
copy(bin, options.disk)
170+
170171
if options.nrfjprog:
171172
#Convert bin to Hex and Program nrf chip via jlink
172-
call(["nrfjprog","-e","--program",bin.replace(".bin", ".hex"),"--verify","-p"])
173+
call(["nrfjprog","-e","--program",bin.replace(".bin", ".hex"),"--verify"])
174+
173175
if options.serial:
174176
# Import pyserial: https://pypi.python.org/pypi/pyserial
175177
from serial import Serial
176178

177179
sleep(target.program_cycle_s())
180+
178181
serial = Serial(options.serial, timeout = 1)
179182
if options.baud:
180183
serial.setBaudrate(options.baud)
184+
181185
serial.flushInput()
182186
serial.flushOutput()
183-
serial.sendBreak()
187+
188+
if options.nrfjprog:
189+
call(["nrfjprog", "-r"])
190+
else:
191+
serial.sendBreak()
184192

185193
while True:
186194
c = serial.read(512)

0 commit comments

Comments
 (0)