Skip to content

Commit

Permalink
V3.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
felias-fogg committed Dec 17, 2024
1 parent 84c3d4a commit a3a5480
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions dw-link/dw-link.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
// --------------------------------------
Expand Down Expand Up @@ -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);
Expand Down
22 changes: 13 additions & 9 deletions dw-server/dw-server.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a3a5480

Please sign in to comment.