diff --git a/workspace_tools/make.py b/workspace_tools/make.py index 403576a0dc..9b6b643159 100644 --- a/workspace_tools/make.py +++ b/workspace_tools/make.py @@ -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)