* Running an STM32 device
* JLink Ultra to Linux host machine over USB and SWD
* VS Code remote dev container (docker) for my environment, cortex-debug extension in VS Code to active and use JLinkExe. So USB is tunneled inside to docker (linux to linux)
* Docker exposing port 19021. HOST USB >> CONTAINER >> TCP 19021 >> HOST. It's a little weird, but the benefits of embedded with remote container can not be oversold.
* RTTViewer is activated on my host machine
* Using CONNECT TO EXISTING when I have a debug session open in VS Code.
* RTTViewer will most of the time report the error: "J-Link DLL did not send welcome string in time."
* If you spam the connect attempt, it will occasionally connect.
SUSPECTED: That Segger RTTViewer will timeout at 50ms. This is likely enough time for most people but I have a lag somewhere. When I spam the CONNECT button and blow through the errors, occasionally it will connect because randomly connections make it under timeout.
SOLUTION: I need this to be a variable or otherwise extended.
WORKAROUND: I don't know why the connection is so slow, I could look into that?
VIDEO:
WIRESHARK DATA:
The first three attempts, the SYN/SYNACK is the same, but the PUSH never comes, so after 50ms, the Viewer kills the connection with a FIN.
LINE 28/29, this time the PUSH comes at 38 milliseconds for whatever reason. This seems to be under the 50ms timeout that Segger put in place. Now it works fine.
I don't know what loopback from container to PC timing should be. However, the timeout seems too show for most networking this connection over internet, I'm not sure that is common but it wouldn't work there either.
No. Time Source PHY Protocol Length Delta time (µs end to start) SN NESN More Data Event counter Info
3155 0.504 127.0.0.1 TCP 53072 → 19021 [SYN] Seq=0 Win=65495 Len=0 MSS=65495 SACK_PERM TSval=2925611610 TSecr=0 WS=128
3156 0.000 127.0.0.1 TCP 19021 → 53072 [SYN, ACK] Seq=0 Ack=1 Win=65483 Len=0 MSS=65495 SACK_PERM TSval=2925611610 TSecr=2925611610 WS=128
3157 0.000 127.0.0.1 TCP 53072 → 19021 [ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925611610 TSecr=2925611610
3163 0.050 127.0.0.1 TCP 53072 → 19021 [FIN, ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925611660 TSecr=2925611610
3164 0.000 127.0.0.1 TCP 19021 → 53072 [ACK] Seq=1 Ack=2 Win=65536 Len=0 TSval=2925611661 TSecr=2925611660
3165 0.000 127.0.0.1 TCP 19021 → 53072 [FIN, ACK] Seq=1 Ack=2 Win=65536 Len=0 TSval=2925611661 TSecr=2925611660
3166 0.000 127.0.0.1 TCP 53072 → 19021 [ACK] Seq=2 Ack=2 Win=65536 Len=0 TSval=2925611661 TSecr=2925611661
3176 0.498 127.0.0.1 TCP 53076 → 19021 [SYN] Seq=0 Win=65495 Len=0 MSS=65495 SACK_PERM TSval=2925612159 TSecr=0 WS=128
3177 0.000 127.0.0.1 TCP 19021 → 53076 [SYN, ACK] Seq=0 Ack=1 Win=65483 Len=0 MSS=65495 SACK_PERM TSval=2925612159 TSecr=2925612159 WS=128
3178 0.000 127.0.0.1 TCP 53076 → 19021 [ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925612159 TSecr=2925612159
3184 0.050 127.0.0.1 TCP 53076 → 19021 [FIN, ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925612209 TSecr=2925612159
3185 0.000 127.0.0.1 TCP 19021 → 53076 [FIN, ACK] Seq=1 Ack=2 Win=65536 Len=0 TSval=2925612209 TSecr=2925612209
3186 0.000 127.0.0.1 TCP 53076 → 19021 [ACK] Seq=2 Ack=2 Win=65536 Len=0 TSval=2925612209 TSecr=2925612209
3198 0.797 127.0.0.1 TCP 53082 → 19021 [SYN] Seq=0 Win=65495 Len=0 MSS=65495 SACK_PERM TSval=2925613006 TSecr=0 WS=128
3199 0.000 127.0.0.1 TCP 19021 → 53082 [SYN, ACK] Seq=0 Ack=1 Win=65483 Len=0 MSS=65495 SACK_PERM TSval=2925613007 TSecr=2925613006 WS=128
3200 0.000 127.0.0.1 TCP 53082 → 19021 [ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925613007 TSecr=2925613007
3206 0.050 127.0.0.1 TCP 53082 → 19021 [FIN, ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925613057 TSecr=2925613007
3207 0.000 127.0.0.1 TCP 19021 → 53082 [FIN, ACK] Seq=1 Ack=2 Win=65536 Len=0 TSval=2925613057 TSecr=2925613057
3208 0.000 127.0.0.1 TCP 53082 → 19021 [ACK] Seq=2 Ack=2 Win=65536 Len=0 TSval=2925613057 TSecr=2925613057
3218 0.485 127.0.0.1 TCP 53090 → 19021 [SYN] Seq=0 Win=65495 Len=0 MSS=65495 SACK_PERM TSval=2925613543 TSecr=0 WS=128
3219 0.000 127.0.0.1 TCP 19021 → 53090 [SYN, ACK] Seq=0 Ack=1 Win=65483 Len=0 MSS=65495 SACK_PERM TSval=2925613543 TSecr=2925613543 WS=128
3220 0.000 127.0.0.1 TCP 53090 → 19021 [ACK] Seq=1 Ack=1 Win=65536 Len=0 TSval=2925613543 TSecr=2925613543
3232 0.038 127.0.0.1 TCP 19021 → 53090 [PSH, ACK] Seq=1 Ack=1 Win=65536 Len=120 TSval=2925613582 TSecr=2925613543
3233 0.000 127.0.0.1 TCP 53090 → 19021 [ACK] Seq=1 Ack=121 Win=65536 Len=0 TSval=2925613582 TSecr=2925613582
3234 0.000 127.0.0.1 TCP 53090 → 19021 [PSH, ACK] Seq=1 Ack=121 Win=65536 Len=256 TSval=2925613582 TSecr=2925613582
3235 0.000 127.0.0.1 TCP 19021 → 53090 [ACK] Seq=121 Ack=257 Win=65280 Len=0 TSval=2925613582 TSecr=2925613582
Display More
EDIT: Tried to use Docker `--network=host` makes the whole thing unconnectable even with spamming the connect button.