From a3a5480b39099a24747e4dcb3e73811bfe8ffb89 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Tue, 17 Dec 2024 16:29:26 +0100 Subject: [PATCH] V3.5.6 --- docs/changelog.md | 5 +++++ dw-link/dw-link.ino | 4 ++-- dw-server/dw-server.py | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 11 deletions(-) mode change 100755 => 100644 dw-server/dw-server.py diff --git a/docs/changelog.md b/docs/changelog.md index 63079e5..7ee335c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,10 @@ # Changelog for dw-link +## Version 3.5.6 (17-Dec-2024) + +- Fixed: In the monitor help command output, it is now correctly stated that there are only 25 breakpoints (instead of 32). +- Fixed: In dw-server.py, the discovery process for the dw-link probe is now more robust. On my Ubuntu, it happened that after disconnecting from a serial line, the first input after reconnecting got lost. For this reason, now two ENQ characters are sent in succession, if one is not enough. + ## Version 3.5.5 (15-Dec-2024) - Fixed: gdbHandleCMD now reads all packet characters and replies with ACK regardless of how long the packet is. The part that does not fit into the buffer is simply ignored. This works well with the initial qSupported package. Later packages will respect the PacketSize feature. diff --git a/dw-link/dw-link.ino b/dw-link/dw-link.ino index 6f715cd..9a82a0f 100644 --- a/dw-link/dw-link.ino +++ b/dw-link/dw-link.ino @@ -35,7 +35,7 @@ // because relevant input ports are not in the I/O range and therefore the tight timing // constraints are not satisfied. -#define VERSION "3.5.5" +#define VERSION "3.5.6" // some constants, you may want to change // -------------------------------------- @@ -1013,7 +1013,7 @@ inline void gdbHelp(void) { gdbDebugMessagePSTR(PSTR("monitor ckdiv [8|1] - program (8) or unprogram (1) CK8DIV (*)"), -1); gdbDebugMessagePSTR(PSTR("monitor oscillator [r|a|x|e|s|u]"),-1); gdbDebugMessagePSTR(PSTR(" - use RC/alt RC/XTAL/ext/slow osc. (*)"), -1); - gdbDebugMessagePSTR(PSTR("monitor breakpoint [h|s] - allow 1 (h) or 32 (s) breakpoints"), -1); + gdbDebugMessagePSTR(PSTR("monitor breakpoint [h|s] - allow 1 (h) or 25 (s) breakpoints"), -1); gdbDebugMessagePSTR(PSTR("monitor singlestep [s|u] - disallow (s) or allow (u) IRQs while single-stepping"), -1); #if HIGHSPEED gdbDebugMessagePSTR(PSTR("monitor speed [h|l] - speed limit is h (300kbps) (def.) or l (150kbps)"), -1); diff --git a/dw-server/dw-server.py b/dw-server/dw-server.py old mode 100755 new mode 100644 index 1e42ef3..44faa62 --- a/dw-server/dw-server.py +++ b/dw-server/dw-server.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 # # Discover dw-link and then redirect data from a TCP/IP connection to the serial port and vice versa. -# Based on Chris Liechti's tcp_serial_redirect script +# Based on Chris Liechti's tcp_serial_redirct script # -# Version 1.2.1 (15-Dec-2024) -# - cosmetic changes +# Version 1.2.1 (17-Dec-2024) +# - under Linux, we have to send the ENQ twice before we get an answer, I have no idea why # -# Version 1.2.0 (21-Sep-2023) -# - does not call gede with the (now obsolete) --no-run option; the -g option still works, though +# Version 1.2.0 (21-sep-2023) +# - does not call gede with the (now obsolete) --no-run option; thze -g option still works, though # # Version 1.1.0 # - special option for calling gede with the --no-run option @@ -41,15 +41,19 @@ def data_received(self, data): # discovers the dw-link adapter, if present def discover(): - for delay in (0, 2): + for delay in (0.1, 2): for s in serial.tools.list_ports.comports(True): try: - for sp in (115200, 230400): + for sp in (115200, ): with serial.Serial(s.device, sp, timeout=0.1, write_timeout=0.1, exclusive=True) as ser: time.sleep(delay) ser.write(b'\x05') # send ENQ - if ser.read(7) == b'dw-link': # if we get this response, it must be an dw-link adapter - ser.close() + resp = ser.read(7) # under Linux, the first response might be empty + if resp == b'': + time.sleep(0.1) + ser.write(b'\x05') # try again sending ENQ + resp = ser.read(7) # now it should be the right response! + if resp == b'dw-link': # if we get this response, it must be an dw-link adapter return (sp, s.device) except: pass