mirror of https://github.com/ARMmbed/mbed-os.git
Add proper support to nrfjprog interface
parent
17499c34d2
commit
0b9d9ff701
|
|
@ -167,20 +167,28 @@ if __name__ == '__main__':
|
|||
if options.disk:
|
||||
# Simple copy to the mbed disk
|
||||
copy(bin, options.disk)
|
||||
|
||||
if options.nrfjprog:
|
||||
#Convert bin to Hex and Program nrf chip via jlink
|
||||
call(["nrfjprog","-e","--program",bin.replace(".bin", ".hex"),"--verify","-p"])
|
||||
call(["nrfjprog","-e","--program",bin.replace(".bin", ".hex"),"--verify"])
|
||||
|
||||
if options.serial:
|
||||
# Import pyserial: https://pypi.python.org/pypi/pyserial
|
||||
from serial import Serial
|
||||
|
||||
sleep(target.program_cycle_s())
|
||||
|
||||
serial = Serial(options.serial, timeout = 1)
|
||||
if options.baud:
|
||||
serial.setBaudrate(options.baud)
|
||||
|
||||
serial.flushInput()
|
||||
serial.flushOutput()
|
||||
serial.sendBreak()
|
||||
|
||||
if options.nrfjprog:
|
||||
call(["nrfjprog", "-r"])
|
||||
else:
|
||||
serial.sendBreak()
|
||||
|
||||
while True:
|
||||
c = serial.read(512)
|
||||
|
|
|
|||
Loading…
Reference in New Issue