Cannot use JLinkRemoteServer on linux from windows' Keil: Max. number of connections exceeded.

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Cannot use JLinkRemoteServer on linux from windows' Keil: Max. number of connections exceeded.

      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:

      Source Code

      1. Load "C:\\<REDACTED>\\MDK-ARM\\Release\\Objects\\<redacted>.axf"
      2. * JLink Info: Connecting to J-Link via TCP/IP (192.168.1.181:19020)
      3. * JLink Info: Connected with SEGGER J-Link Remote Server V6.30c compiled 17:22:50 on Feb 9 2018
      4. Can not connect to J-Link via TCP/IP (192.168.1.181, port 19020)
      5. Max. Number of connections exceeded
      6. Error: Flash Download failed - Target DLL has been cancelled


      Output from JLinkRemoteServer:

      Source Code

      1. 16:15:18.500779 SEGGER J-Link Remote Server V6.30c
      2. 16:15:18.500875 Compiled Feb 9 2018 17:22:50
      3. 16:15:18.500896
      4. 16:15:18.500913 'q' to quit '?' for help
      5. 16:15:18.500930
      6. 16:15:18.500946 Connected to J-Link with S/N 5xxxxxx
      7. 16:15:18.500963
      8. 16:15:34.486155 Waiting for client connection... Client connected.
      9. 16:15:34.548436 Additional client connection rejected.
      10. 16:15:34.548484 Reason: Max. number of connections exceeded.
      11. 16:15:34.551609 Client disconnected.
      Display All


      Tcpdump capture:

      Source Code

      1. 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
      2. 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
      3. 16:15:34.485430 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [.], ack 1, win 2053, length 0
      4. 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
      5. 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
      6. 16:15:34.486704 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [.], ack 73, win 2052, length 0
      7. 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
      8. [...]
      9. 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
      10. 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
      11. 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
      12. 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
      13. 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
      14. 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
      15. 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. 16:15:34.544946 IP 192.168.1.181.19020 > 192.168.1.194.50586: Flags [.], ack 95, win 229, length 0
      17. 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
      18. 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
      19. 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
      20. 16:15:34.546804 IP 192.168.1.194.50586 > 192.168.1.181.19020: Flags [.], ack 5238, win 2052, length 0
      21. 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
      22. 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
      23. 16:15:34.548007 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [.], ack 1, win 2053, length 0
      24. 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
      25. 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
      26. 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
      27. 16:15:34.548623 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [.], ack 77, win 2052, length 0
      28. 16:15:34.548907 IP 192.168.1.194.50587 > 192.168.1.181.19020: Flags [.], ack 118, win 2052, length 0
      29. 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
      30. 16:15:34.558103 IP 192.168.1.181.19020 > 192.168.1.194.50587: Flags [.], ack 2, win 229, length 0
      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):

      Source Code

      1. 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
      2. 19438 16:15:34.546438 futex(0x7fa6d4382be8, FUTEX_WAKE_PRIVATE, 1) = 1
      3. 19422 16:15:34.546452 <... futex resumed> ) = 0
      4. 19438 16:15:34.546458 close(7<TCP:[192.168.1.181:19020->192.168.1.194:50586]> <unfinished ...>
      5. 19422 16:15:34.546467 futex(0x7fa6d4382be8, FUTEX_WAKE_PRIVATE, 1) = 0
      6. 19438 16:15:34.546480 <... close resumed> ) = 0
      7. 19422 16:15:34.546486 futex(0x7fa6d4384214, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1269, {tv_sec=1518621334, tv_nsec=571481000}, 0xffffffff <unfinished ...>
      8. 19438 16:15:34.546494 close(8<UDP:[0.0.0.0:19020]>) = 0
      9. 19438 16:15:34.546516 nanosleep({tv_sec=0, tv_nsec=5000000}, <unfinished ...>
      10. 19425 16:15:34.547122 <... select resumed> ) = 0 (Timeout)
      11. 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})
      12. 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]>
      13. 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
      14. 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
      15. 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
      16. 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
      17. 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
      18. 19425 16:15:34.548408 write(1<pipe:[858864]>, "Additional client connection rejected.\r\nReason: Max. number of connections exceeded.\r\n", 86) = 86
      19. 19425 16:15:34.548432 close(7<TCP:[192.168.1.181:19020->192.168.1.194:50587]>) = 0
      20. 19425 16:15:34.548455 select(7, [6<TCP:[0.0.0.0:19020]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
      21. 19439 16:15:34.550190 <... recvfrom resumed> 0x7fa6d082bed0, 64, 0, 0x7fa6d082bdf0, [16]) = -1 EAGAIN (Resource temporarily unavailable)
      22. 19439 16:15:34.550210 recvfrom(8, 0x7fa6d082bed0, 64, 0, 0x7fa6d082bdf0, [16]) = -1 EBADF (Bad file descriptor)
      23. 19439 16:15:34.550237 madvise(0x7fa6d002c000, 8368128, MADV_DONTNEED) = 0
      24. 19439 16:15:34.550268 exit(0) = ?
      25. 19439 16:15:34.550306 +++ exited with 0 +++
      26. 19424 16:15:34.550324 <... select resumed> ) = 0 (Timeout)
      27. 19424 16:15:34.550339 select(5, [4<TCP:[127.0.0.1:19081]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
      28. 19420 16:15:34.550414 <... nanosleep resumed> NULL) = 0
      29. 19420 16:15:34.550426 ioctl(0</dev/pts/13>, FIONREAD, [0]) = 0
      30. 19420 16:15:34.550452 nanosleep({tv_sec=0, tv_nsec=100000000}, <unfinished ...>
      31. 19438 16:15:34.551580 <... nanosleep resumed> NULL) = 0
      32. 19438 16:15:34.551590 write(1<pipe:[858864]>, "Client disconnected.\r\n", 22) = 22
      33. 19438 16:15:34.551615 write(1<pipe:[858864]>, "Waiting for client connection... ", 33) = 33
      34. 19438 16:15:34.551641 madvise(0x7fa6d082d000, 8368128, MADV_DONTNEED) = 0
      35. 19438 16:15:34.551661 exit(0) = ?
      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 succeeded to make it work once. Here's the strace:

      Source Code

      1. 22984 16:55:36.653236 write(8</<redacted>/JLinkTCPIP.log>, " JLINK_Unlock() (0002ms, 0727ms total)", 51) = 51
      2. 22984 16:55:36.653257 write(8</<redacted>/JLinkTCPIP.log>, "\r\n", 2) = 2
      3. 22984 16:55:36.653279 close(10<TCP:[192.168.1.181:19020->192.168.1.194:50674]>) = 0
      4. 22984 16:55:36.653310 close(11<UDP:[0.0.0.0:19020]>) = 0
      5. 22984 16:55:36.653333 nanosleep({tv_sec=0, tv_nsec=5000000}, <unfinished ...>
      6. 22979 16:55:36.655886 <... select resumed> ) = 0 (Timeout)
      7. 22979 16:55:36.655898 select(8, [7<TCP:[127.0.0.1:19021]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
      8. 22981 16:55:36.656127 <... select resumed> ) = 0 (Timeout)
      9. 22981 16:55:36.656142 select(10, [9<TCP:[0.0.0.0:19020]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
      10. 22980 16:55:36.658017 <... select resumed> ) = 0 (Timeout)
      11. 22980 16:55:36.658030 select(7, [6<TCP:[127.0.0.1:19080]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
      12. 22981 16:55:36.658188 <... select resumed> ) = 1 (in [9], left {tv_sec=0, tv_usec=7977})
      13. 22985 16:55:36.658205 <... recvfrom resumed> 0x7f3b1110bed0, 64, 0, 0x7f3b1110bdf0, [16]) = -1 EAGAIN (Resource temporarily unavailable)
      14. 22981 16:55:36.658214 accept(9<TCP:[0.0.0.0:19020]>, NULL, NULL <unfinished ...>
      15. 22985 16:55:36.658226 recvfrom(11, <unfinished ...>
      16. 22981 16:55:36.658239 <... accept resumed> ) = 10<TCP:[192.168.1.181:19020->192.168.1.194:50675]>
      17. 22985 16:55:36.658405 <... recvfrom resumed> 0x7f3b1110bed0, 64, 0, 0x7f3b1110bdf0, [16]) = -1 EBADF (Bad file descriptor)
      18. 22984 16:55:36.658415 <... nanosleep resumed> NULL) = 0
      19. 22985 16:55:36.658423 madvise(0x7f3b1090c000, 8368128, MADV_DONTNEED <unfinished ...>
      20. 22981 16:55:36.658432 setsockopt(10<TCP:[192.168.1.181:19020->192.168.1.194:50675]>, SOL_TCP, TCP_NODELAY, [1], 4 <unfinished ...>
      21. 22985 16:55:36.658447 <... madvise resumed> ) = 0
      22. 22984 16:55:36.658454 write(1<pipe:[899143]>, "Client disconnected.\r\n", 22 <unfinished ...>
      23. 22985 16:55:36.658468 exit(0 <unfinished ...>
      24. 22981 16:55:36.658475 <... setsockopt resumed> ) = 0
      25. 22985 16:55:36.658482 <... exit resumed>) = ?
      26. 22984 16:55:36.658488 <... write resumed> ) = 22
      27. 22981 16:55:36.658496 futex(0x7f3b168da760, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
      28. 22985 16:55:36.658511 +++ exited with 0 +++
      29. 22984 16:55:36.658517 futex(0x7f3b168da760, FUTEX_WAKE_PRIVATE, 1) = 1
      30. 22981 16:55:36.658549 <... futex resumed> ) = 0
      31. 22984 16:55:36.658555 write(1<pipe:[899143]>, "Waiting for client connection... ", 33 <unfinished ...>
      32. 22981 16:55:36.658569 futex(0x7f3b168da760, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
      33. 22984 16:55:36.658576 <... write resumed> ) = 33
      34. 22984 16:55:36.658584 futex(0x7f3b168da760, FUTEX_WAKE_PRIVATE, 1) = 1
      35. 22981 16:55:36.658600 <... futex resumed> ) = 0
      36. 22984 16:55:36.658610 madvise(0x7f3b1110d000, 8368128, MADV_DONTNEED <unfinished ...>
      37. 22981 16:55:36.658617 futex(0x7f3b168da760, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
      38. 22984 16:55:36.658622 <... madvise resumed> ) = 0
      39. 22981 16:55:36.658628 <... futex resumed> ) = 0
      40. 22984 16:55:36.658633 exit(0 <unfinished ...>
      41. 22981 16:55:36.658639 write(1<pipe:[899143]>, "Client connected.\r\n", 19 <unfinished ...>
      42. 22984 16:55:36.658651 <... exit resumed>) = ?
      43. 22981 16:55:36.658657 <... write resumed> ) = 19
      44. 22984 16:55:36.658667 +++ exited with 0 +++
      45. 22981 16:55:36.658672 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b173ea000
      46. 22981 16:55:36.658810 sendto(10<TCP:[192.168.1.181:19020->192.168.1.194:50675]>, "\0)\240D", 4, MSG_NOSIGNAL, NULL, 0) = 4
      47. 22981 16:55:36.658845 sendto(10<TCP:[192.168.1.181:19020->192.168.1.194:50675]>, "SEGGER J-Link Remote Server V6.30c compiled 17:22:50 on Feb 9 2018\0", 68, MSG_NOSIGNAL, NULL, 0) = 68
      48. 22981 16:55:36.658872 clone(child_stack=0x7f3b1190cff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f3b1190d9d0, tls=0x7f3b1190d700, child_tidptr=0x7f3b1190d9d0) = 22986
      49. 22986 16:55:36.658931 set_robust_list(0x7f3b1190d9e0, 24 <unfinished ...>
      50. 22981 16:55:36.658939 select(10, [9<TCP:[0.0.0.0:19020]>], NULL, NULL, {tv_sec=0, tv_usec=10000} <unfinished ...>
      51. 22986 16:55:36.658952 <... set_robust_list resumed> ) = 0
      52. 22986 16:55:36.658964 getpeername(10<TCP:[192.168.1.181:19020->192.168.1.194:50675]>, {sa_family=AF_INET, sin_port=htons(50675), sin_addr=inet_addr("192.168.1.194")}, [16]) = 0
      53. 22986 16:55:36.659006 clone(child_stack=0x7f3b1110bff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f3b1110c9d0, tls=0x7f3b1110c700, child_tidptr=0x7f3b1110c9d0) = 22987
      54. 22987 16:55:36.659039 set_robust_list(0x7f3b1110c9e0, 24 <unfinished ...>
      55. 22986 16:55:36.659047 recvfrom(10<TCP:[192.168.1.181:19020->192.168.1.194:50675]>, <unfinished ...>
      56. 22987 16:55:36.659057 <... set_robust_list resumed> ) = 0
      57. 22987 16:55:36.659068 socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 11<UDP:[892915]>
      Display All


      Looks that there is a race condition (probably aggravated when a JLinkRTTLogger is started which was the case in my first captures). If I add latency on my ethernet interface (with `tc`), it's damn slow but it works.

      The post was edited 3 times, last by marto ().

    • Hello,

      Thank you for your inquiry.
      Such an issue is not known to us.
      How is your exact setup?
      Is the Linux box int he same network as the Windows PC?
      Or are you using the RemoteServer in tunneling mode to a remote location?
      Does the connect generally work when using J-Link commander?

      Should your setup be in the same company network we suggest the usage of a J-Link PRO over Ethernet so no timing problems appear.

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      The following contact form can be used for this: Contact Us

    • Hello,

      My two computers are on the same network, and connected with a 1Gbps switch:

      Brainfuck Source Code

      1. +-linux--------------+ +-windows---------------+
      2. | | | |
      3. | | +--------+ | |
      4. | JlinkRTTServer +--(rj45)--+ switch +--(rj45)--+ Keil |
      5. | | +--------+ | |
      6. | | | |
      7. +--+-----------------+ +-----------------------+
      8. |
      9. (usb)
      10. |
      11. +-+-----------+ +------------+
      12. | j-link Base +------+ eval board |
      13. +-------------+ +------------+
      Display All

      There is no problem with JLink.exe since it only create one connection to the JLinkRTTServer (not two as Keil is doing).

      Thanks,

      Marc.
    • Hello Marc,

      You write that you use a JlinkRTTServer. Can you elaborate what exactly do you mean by this? I could not find any software called like this.
      Did you mean JLinkRemoteServer instead?

      Multiple connections to J-Link over RemoteServer or IP are currently not supported.
      This might be implemented in future if the commands come from the same client PC.

      What is triggering the second connection?
      You write that Keil is doing it but we are not aware of such behaviour.
      Could you post a J-Link log of such a session?

      wiki.segger.com/Enable_J-Link_log_file

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      The following contact form can be used for this: Contact Us

    • Hello Nino,

      SEGGER - Nino wrote:



      You write that you use a JlinkRTTServer. Can you elaborate what exactly do you mean by this? I could not find any software called like this.
      Did you mean JLinkRemoteServer instead?

      Yes, my bad, it' s JLinkRemoteServer (as correctly written on first post).


      SEGGER - Nino wrote:


      What is triggering the second connection?

      I think that Keil does use two connections:
      - first to get probe info
      - then to do whatever it wants (I didn't check the packet's content)

      SEGGER - Nino wrote:


      You write that Keil is doing it but we are not aware of such behaviour.
      Could you post a J-Link log of such a session?


      Here the logs of the failing case:

      Source Code

      1. SEGGER J-Link V6.30c Log File
      2. DLL Compiled: Feb 9 2018 17:20:54
      3. Logging started @ 2018-02-27 09:19
      4. T1B28 000:000 JLINK_IsOpen() returns 0x00 (0000ms, 0000ms total)
      5. T1B28 000:000 JLINK_SelectIP(Host = "192.168.1.181", Port = 0) returns 0x00 (0000ms, 0000ms total)
      6. T1B28 000:000 JLINK_OpenEx(...)
      7. Firmware: J-Link V9 compiled Feb 2 2018 18:12:38
      8. Hardware: V9.30
      9. S/N: <redacted>
      10. Feature(s): GDB
      11. TELNET listener socket opened on port 19021WEBSRV
      12. Starting webserver (0041ms, 0041ms total)
      13. T1B28 000:000 WEBSRV Webserver running on local port 19080 (0041ms, 0041ms total)
      14. T1B28 000:000 returns O.K. (0041ms, 0041ms total)
      15. T1B28 000:042 JLINK_GetEmuCaps() returns 0xB9FF7BBF (0000ms, 0041ms total)
      16. T1B28 000:548 JLINK_Close() (0003ms, 0044ms total)
      17. T1B28 000:548 (0003ms, 0044ms total)
      18. T1B28 000:548 Closed (0003ms, 0044ms total)
      Display All

      The keil console reports:

      Source Code

      1. Load "<redacted>.axf"
      2. * JLink Info: Connecting to J-Link via TCP/IP (192.168.1.181:19020)
      3. * JLink Info: Connected with SEGGER J-Link Remote Server V6.30c compiled 17:22:50 on Feb 9 2018
      4. Can not connect to J-Link via TCP/IP (192.168.1.181, port 19020)
      5. Max. Number of connections exceeded
      6. Error: Flash Download failed - Target DLL has been cancelled
      7. Flash Load finished at 09:19:26


      When flash is ok, the jlink log is:

      Source Code

      1. T1B28 000:090 SEGGER J-Link V6.30c Log File (0032ms, 0079ms total)
      2. T1B28 000:090 DLL Compiled: Feb 9 2018 17:20:54 (0032ms, 0079ms total)
      3. T1B28 000:090 Logging started @ 2018-02-26 14:47 (0032ms, 0079ms total)
      4. T1B28 000:090 WEBSRV
      5. Starting webserver (0035ms, 0082ms total)
      6. T1B28 000:090 WEBSRV Webserver running on local port 19080 (0035ms, 0082ms total)
      7. T1B28 000:090 returns O.K. (0035ms, 0082ms total)
      8. T1B28 000:125 JLINK_GetEmuCaps() returns 0xB9FF7BBF (0000ms, 0082ms total)
      9. T1B28 000:125 JLINK_TIF_GetAvailable(...) (0001ms, 0083ms total)
      10. T1B28 000:126 JLINK_SetErrorOutHandler(...) (0000ms, 0083ms total)
      11. T1B28 000:126 JLINK_ExecCommand("ProjectFile = "C:\<redacted>\MDK-ARM\JLinkSettings.ini"", ...). C:\Program Files (x86)\SEGGER\JLink_V630c\JLinkDevices.xml evaluated successfully.Device "<redacted>" selected. returns 0x00 (0386ms, 0469ms total)
      12. T1B28 000:513 JLINK_ExecCommand("Device = <redacted>", ...). Device "<redacted>" selected. returns 0x00 (0004ms, 0473ms total)
      13. T1B28 000:517 JLINK_ExecCommand("DisableConnectionTimeout", ...). returns 0x01 (0000ms, 0473ms total)
      14. T1B28 000:517 JLINK_GetHardwareVersion() returns 0x16B48 (0000ms, 0473ms total)
      15. T1B28 000:517 JLINK_GetDLLVersion() returns 63003 (0000ms, 0473ms total)
      16. T1B28 000:517 JLINK_GetFirmwareString(...) (0000ms, 0473ms total)
      17. T1B28 000:524 JLINK_GetDLLVersion() returns 63003 (0000ms, 0473ms total)
      18. T1B28 000:524 JLINK_GetCompileDateTime() (0000ms, 0473ms total)
      19. T1B28 000:526 JLINK_GetFirmwareString(...) (0000ms, 0473ms total)
      20. T1B28 000:528 JLINK_GetHardwareVersion() returns 0x16B48 (0000ms, 0473ms total)
      21. T1B28 000:535 JLINK_TIF_Select(JLINKARM_TIF_SWD) returns 0x00 (0005ms, 0478ms total)
      22. T1B28 000:541 JLINK_SetSpeed(5000) (0000ms, 0479ms total)
      23. [...]
      Display All

      And keil output:

      Brainfuck Source Code

      1. Load "C:\\<redacted>.axf"
      2. * JLink Info: Connecting to J-Link via TCP/IP (192.168.1.181:19020)
      3. * JLink Info: Connected with SEGGER J-Link Remote Server V6.30c compiled 17:22:50 on Feb 9 2018
      4. * JLink Info: Device "<redacted>" selected.
      5. Set JLink Project File to "C:\<redacted>\MDK-ARM\JLinkSettings.ini"
      6. * JLink Info: Device "<redacted>" selected.
      7. JLink info:
      8. ------------
      9. DLL: V6.30c, compiled Feb 9 2018 17:20:54
      10. Firmware: J-Link V9 compiled Feb 2 2018 18:12:38
      11. Hardware: V9.30
      12. S/N : <redacted>
      13. Feature(s) : GDB
      14. * JLink Info: Found SW-DP with ID 0x0BB11477
      15. * JLink Info: Scanning AP map to find all available APs
      16. * JLink Info: AP[1]: Stopped AP scan as end of AP map has been reached
      17. * JLink Info: AP[0]: AHB-AP (IDR: 0x04770021)
      18. * JLink Info: Iterating through AP map to find AHB-AP to use
      19. * JLink Info: AP[0]: Core found
      20. * JLink Info: AP[0]: AHB-AP ROM base: 0xF0000000
      21. [...]
      22. Erase Done.
      23. Programming Done.
      24. Verify OK.
      25. Flash Load finished at 14:48:07
      Display All


      Notes:
      - albeit I've slightly redacted and shorten outputs, the logs are not formatted the same, there is no "T1B28" header in the failing case, maybe because it's the logs of the "first" connection, and in the second case, we lose the logs of the first connection).
      - in the second case (success), there is two connections: at 14:48:01.467950 and 14:48:01.557685 (output w/o timestamp, only strace available)

      I could send by PM all the traces I have:
      - tcpdump captures
      - strace of JLinkRemoteServer
      - full outputs and logs

      Thanks,

      Marc.
    • Hi Marc,

      Are you using the Remote Server in tunnel mode?
      How are your settings in Keil exactly for J-Link to connect over the remote server?
      Could you provide us with an exact step by step reproduction scenario so we can investigate this further?

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      The following contact form can be used for this: Contact Us

    • Hello Nino,

      SEGGER - Nino wrote:


      Are you using the Remote Server in tunnel mode?

      No, I just start JLinkRemoteServer on my linux machine. I do not even know how to activate the tunnel mode (no options found)

      SEGGER - Nino wrote:


      How are your settings in Keil exactly for J-Link to connect over the remote server?

      See attachment.

      SEGGER - Nino wrote:


      Could you provide us with an exact step by step reproduction scenario so we can investigate this further?

      On linux:
      - plug JLink base to the computer
      - start JLinkRemoteServer
      On windows:
      - start Keil
      - click F8 to flash firmware
      - → connection problem

      Note that connection problem also happens when opening the keil's configuration window, but it seems that a retry is done:

      Source Code

      1. EGGER J-Link Remote Server V6.30c
      2. Compiled Feb 9 2018 17:22:50
      3. 'q' to quit '?' for help
      4. Connected to J-Link with S/N 5xxxx
      5. Waiting for client connection... Client connected.
      6. Additional client connection rejected.
      7. Reason: Max. number of connections exceeded.
      8. Client disconnected.
      9. Waiting for client connection... Client connected.
      Display All


      Thanks,

      Marc.
      Images
      • jlink-keil-settings.png

        147.9 kB, 773×632, viewed 88 times
    • Hi Marc,

      Thank you for your detailed setup information.
      We were able to reproduce the issue and are currently working on a fix.

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      The following contact form can be used for this: Contact Us