Hello
I'm trying to reach Jlink-base plugged into my linux box from Keil on a windows box.
The debugger fails with quite no logs. Flash is a little bit more verbose, but fails too:
Output from JLinkRemoteServer:
Display All
Tcpdump capture:
Display All
The first TCP connection is correctly closed (Fin at 16:15:34.546311) before the second is established (Syn at 16:15:34.547571).
I don't know how/when the connection counter is handled, but strace shows that the first socket is closed (at 16:15:34.546458) before accepting the new connection (at 16:15:34.548074):
Display All
The `recvfrom()` at 16:15:34.550190 fails on fd 8, closed above by pid 19438.
Client version: 6.30c.
Server version: 6.30c.
OS: debian stretch.
Tested with same result with server version 6.18a.
Probably related to abandoned forum.segger.com/index.php?page=Thread&threadID=4548
Both Debug and Flash create two TCP connections.
Any help appreciated.
Thanks,
Marc.
I'm trying to reach Jlink-base plugged into my linux box from Keil on a windows box.
The debugger fails with quite no logs. Flash is a little bit more verbose, but fails too:
Source Code
- Load "C:\\<REDACTED>\\MDK-ARM\\Release\\Objects\\<redacted>.axf"
- * JLink Info: Connecting to J-Link via TCP/IP (192.168.1.181:19020)
- * JLink Info: Connected with SEGGER J-Link Remote Server V6.30c compiled 17:22:50 on Feb 9 2018
- Can not connect to J-Link via TCP/IP (192.168.1.181, port 19020)
- Max. Number of connections exceeded
- Error: Flash Download failed - Target DLL has been cancelled
Output from JLinkRemoteServer:
Source Code
- 16:15:18.500779 SEGGER J-Link Remote Server V6.30c
- 16:15:18.500875 Compiled Feb 9 2018 17:22:50
- 16:15:18.500896
- 16:15:18.500913 'q' to quit '?' for help
- 16:15:18.500930
- 16:15:18.500946 Connected to J-Link with S/N 5xxxxxx
- 16:15:18.500963
- 16:15:34.486155 Waiting for client connection... Client connected.
- 16:15:34.548436 Additional client connection rejected.
- 16:15:34.548484 Reason: Max. number of connections exceeded.
- 16:15:34.551609 Client disconnected.
Tcpdump capture:
Source Code
- 16:15:34.485068 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [S], seq 2298248450, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
- 16:15:34.485109 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [S.], seq 2396416812, ack 2298248451, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
- 16:15:34.485430 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [.], ack 1, win 2053, length 0
- 16:15:34.486421 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [P.], seq 1:5, ack 1, win 229, length 4
- 16:15:34.486496 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [P.], seq 5:73, ack 1, win 229, length 68
- 16:15:34.486704 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [.], ack 73, win 2052, length 0
- 16:15:34.495522 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [P.], seq 1:4, ack 73, win 2052, length 3
- [...]
- 16:15:34.511677 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [P.], seq 4957:4961, ack 48, win 229, length 4
- 16:15:34.512152 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [P.], seq 48:63, ack 4961, win 2053, length 15
- 16:15:34.513342 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [P.], seq 4961:5053, ack 63, win 229, length 92
- 16:15:34.513664 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [P.], seq 63:78, ack 5053, win 2052, length 15
- 16:15:34.514861 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [P.], seq 5053:5145, ack 78, win 229, length 92
- 16:15:34.519361 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [P.], seq 78:79, ack 5145, win 2052, length 1
- 16:15:34.544484 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [P.], seq 79:95, ack 5145, win 2052, length 16
- 16:15:34.544946 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [.], ack 95, win 229, length 0
- 16:15:34.545987 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [P.], seq 5145:5237, ack 95, win 229, length 92
- 16:15:34.546311 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [F.], seq 95, ack 5237, win 2052, length 0
- 16:15:34.546471 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [F.], seq 5237, ack 96, win 229, length 0
- 16:15:34.546804 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [.], ack 5238, win 2052, length 0
- 16:15:34.547571 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [S], seq 2760538899, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
- 16:15:34.547590 IP 192.168.1.181.19020 > 192.168.1.194.50587: Flags [S.], seq 4257933236, ack 2760538900, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
- 16:15:34.548007 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [.], ack 1, win 2053, length 0
- 16:15:34.548314 IP 192.168.1.181.19020 > 192.168.1.194.50587: Flags [P.], seq 1:5, ack 1, win 229, length 4
- 16:15:34.548394 IP 192.168.1.181.19020 > 192.168.1.194.50587: Flags [P.], seq 5:77, ack 1, win 229, length 72
- 16:15:34.548443 IP 192.168.1.181.19020 > 192.168.1.194.50587: Flags [FP.], seq 77:117, ack 1, win 229, length 40
- 16:15:34.548623 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [.], ack 77, win 2052, length 0
- 16:15:34.548907 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [.], ack 118, win 2052, length 0
- 16:15:34.558090 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [F.], seq 1, ack 118, win 2052, length 0
- 16:15:34.558103 IP 192.168.1.181.19020 > 192.168.1.194.50587: Flags [.], ack 2, win 229, length 0
The first TCP connection is correctly closed (Fin at 16:15:34.546311) before the second is established (Syn at 16:15:34.547571).
I don't know how/when the connection counter is handled, but strace shows that the first socket is closed (at 16:15:34.546458) before accepting the new connection (at 16:15:34.548074):
Source Code
- 19438 16:15:34.546407 sendto(3<TCP:[127.0.0.1:37626->127.0.0.1:19030]>, "\2\0\0\0\22\0", 6, MSG_NOSIGNAL, NULL, 0) = 6
- 19438 16:15:34.546438 futex(0x7fa6d4382be8, FUTEX_WAKE_PRIVATE, 1) = 1
- 19422 16:15:34.546452 <... futex resumed> ) = 0
- 19438 16:15:34.546458 close(7<TCP:[192.168.1.181:19020->192.168.1.194:50586]> <unfinished ...>
- 19422 16:15:34.546467 futex(0x7fa6d4382be8, FUTEX_WAKE_PRIVATE, 1) = 0
- 19438 16:15:34.546480 <... close resumed> ) = 0
- 19422 16:15:34.546486 futex(0x7fa6d4384214, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1269, {tv_sec=1518621334, tv_nsec=571481000}, 0xffffffff <unfinished ...>
- 19438 16:15:34.546494 close(8<UDP:[0.0.0.0:19020]>) = 0
- 19438 16:15:34.546516 nanosleep({tv_sec=0, tv_nsec=5000000}, <unfinished ...>
- 19425 16:15:34.547122 <... select resumed> ) = 0 (Timeout)
- 19425 16:15:34.547137 select(7, [6<TCP:[0.0.0.0:19020]>], NULL, NULL, {tv_sec=0, tv_usec=10000}) = 1 (in [6], left {tv_sec=0, tv_usec=9108})
- 19425 16:15:34.548074 accept(6<TCP:[0.0.0.0:19020]>, NULL, NULL) = 7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>
- 19425 16:15:34.548269 setsockopt(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>, SOL_TCP, TCP_NODELAY, [1], 4) = 0
- 19425 16:15:34.548295 sendto(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>, "\376)\240D", 4, MSG_NOSIGNAL, NULL, 0) = 4
- 19425 16:15:34.548326 sendto(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>, "SEGGER J-Link Remote Server V6.30c compiled 17:22:50 on Feb 9 2018\0", 68, MSG_NOSIGNAL, NULL, 0) = 68
- 19425 16:15:34.548349 sendto(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>, "(\0\0\0", 4, MSG_NOSIGNAL, NULL, 0) = 4
- 19425 16:15:34.548371 sendto(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>, "\r\nMax. Number of connections exceeded\r\n\0", 40, MSG_NOSIGNAL, NULL, 0) = 40
- 19425 16:15:34.548408 write(1<pipe:[858864]>, "Additional client connection rejected.\r\nReason: Max. number of connections exceeded.\r\n", 86) = 86
- 19425 16:15:34.548432 close(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>) = 0
- 19425 16:15:34.548455 select(7, [6<TCP:[0.0.0.0:19020]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
- 19439 16:15:34.550190 <... recvfrom resumed> 0x7fa6d082bed0, 64, 0, 0x7fa6d082bdf0, [16]) = -1 EAGAIN (Resource temporarily unavailable)
- 19439 16:15:34.550210 recvfrom(8, 0x7fa6d082bed0, 64, 0, 0x7fa6d082bdf0, [16]) = -1 EBADF (Bad file descriptor)
- 19439 16:15:34.550237 madvise(0x7fa6d002c000, 8368128, MADV_DONTNEED) = 0
- 19439 16:15:34.550268 exit(0) = ?
- 19439 16:15:34.550306 +++ exited with 0 +++
- 19424 16:15:34.550324 <... select resumed> ) = 0 (Timeout)
- 19424 16:15:34.550339 select(5, [4<TCP:[127.0.0.1:19081]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
- 19420 16:15:34.550414 <... nanosleep resumed> NULL) = 0
- 19420 16:15:34.550426 ioctl(0</dev/pts/13>, FIONREAD, [0]) = 0
- 19420 16:15:34.550452 nanosleep({tv_sec=0, tv_nsec=100000000}, <unfinished ...>
- 19438 16:15:34.551580 <... nanosleep resumed> NULL) = 0
- 19438 16:15:34.551590 write(1<pipe:[858864]>, "Client disconnected.\r\n", 22) = 22
- 19438 16:15:34.551615 write(1<pipe:[858864]>, "Waiting for client connection... ", 33) = 33
- 19438 16:15:34.551641 madvise(0x7fa6d082d000, 8368128, MADV_DONTNEED) = 0
- 19438 16:15:34.551661 exit(0) = ?
The `recvfrom()` at 16:15:34.550190 fails on fd 8, closed above by pid 19438.
Client version: 6.30c.
Server version: 6.30c.
OS: debian stretch.
Tested with same result with server version 6.18a.
Probably related to abandoned forum.segger.com/index.php?page=Thread&threadID=4548
Both Debug and Flash create two TCP connections.
Any help appreciated.
Thanks,
Marc.