diff options
author | root <root@lamia.panaceas.james.local> | 2015-08-31 15:00:15 +0100 |
---|---|---|
committer | root <root@lamia.panaceas.james.local> | 2015-08-31 15:00:15 +0100 |
commit | 0c9371ef537121fac414f43499688695816f1ee6 (patch) | |
tree | 6f2b0a2aa610777f56cf22bd38de538c98a4a132 | |
parent | 4eed6a080410c9b34337c63f1160f065e16baba7 (diff) | |
download | blinky-0c9371ef537121fac414f43499688695816f1ee6.tar.gz blinky-0c9371ef537121fac414f43499688695816f1ee6.tar.bz2 blinky-0c9371ef537121fac414f43499688695816f1ee6.zip |
fish
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | dfu.py | 13 | ||||
-rw-r--r-- | gdb.script | 2 |
3 files changed, 10 insertions, 6 deletions
@@ -79,6 +79,7 @@ NM := $(CROSS)nm OBJDUMP := $(CROSS)objdump OBJCOPY := $(CROSS)objcopy SIZE := $(CROSS)size +GDB := $(CROSS)gdb NRFUTIL := nrfutil CFLAGS += -mcpu=cortex-m0 @@ -2,9 +2,9 @@ import os import pexpect -import sys import optparse import time +import sys from intelhex import IntelHex # DFU Opcodes @@ -50,7 +50,7 @@ class BleDfuUploader(object): def __init__(self, target_mac, hexfile_path): self.hexfile_path = hexfile_path self.ble_conn = pexpect.spawn("gatttool -b '%s' -t random --interactive" % target_mac) - self.ble_conn.logfile = sys.stdout + self.ble_conn.logfile = sys.stdout # Connect to peer device. def scan_and_connect(self): @@ -62,17 +62,18 @@ class BleDfuUploader(object): self.ble_conn.sendline('connect') try: - #res = self.ble_conn.expect('\[CON\].*>', timeout=10) res = self.ble_conn.expect('Connection successful', timeout=10) except pexpect.TIMEOUT, e: print "timeout" + + time.sleep(1) def _dfu_state_set(self, opcode): self.ble_conn.sendline('char-write-req 0x%02x %02x' % (self.ctrlpt_handle, opcode)) # Verify that command was successfully written try: - res = self.ble_conn.expect('.* Characteristic value was written successfully', timeout=10) + res = self.ble_conn.expect('Characteristic value was written successfully', timeout=10) except pexpect.TIMEOUT, e: print "timeout" @@ -82,7 +83,7 @@ class BleDfuUploader(object): # Verify that data was successfully written try: - res = self.ble_conn.expect('.* Characteristic value was written successfully', timeout=10) + res = self.ble_conn.expect('Characteristic value was written successfully', timeout=10) except pexpect.TIMEOUT, e: print "timeout" @@ -93,7 +94,7 @@ class BleDfuUploader(object): # Verify that CCCD was successfully written try: - res = self.ble_conn.expect('.* Characteristic value was written successfully', timeout=10) + res = self.ble_conn.expect('Characteristic value was written successfully', timeout=10) except pexpect.TIMEOUT, e: print "timeout" diff --git a/gdb.script b/gdb.script new file mode 100644 index 0000000..7cf9d09 --- /dev/null +++ b/gdb.script @@ -0,0 +1,2 @@ +target remote localhost:3333 +cont |