FreeRTOS_accept question/issue

gregm102 wrote on Monday, March 16, 2015:

I am relatively new to FreeRTOS and have ported the FreeRTOS+TCP to a Microsemi Smartfusion2 device. I have a simple application running and the TCP stack is DHCP’ing correctly and responding to Pings. I am in the process of porting a simple application from uClinux on the M2S device to FreeRTOS and have a external Client that works properly with the uClinux applications, but FreeRTOS_accept never seems to return with connection accepted. I am calling it with portMAX_DELAY and expect it to wait until a connection is accepted, and then return with the new socket. the following is the output from the debug printfs within the TCP package (along with a few of my own) followed by the wireshark capture of the same session. –

Best I can figure is i might need to setup an event group? FreeRTOS_accept seems to be waiting in xEventGroupWaitBits, but I only have a single server trying to listen on a single port. Any help is appreciated.

Greg

Hello World 0
prvIPTask started
Link down
prvInitialiseDHCP: start after 250 ticks
vDHCPProcess: discover
vDHCPProcess: offer 192.168.2.77 ip
vDHCPProcess: reply c0a8024d ip
vDHCPProcess: offer 192.168.2.77 ip
vDHCPProcess: acked c0a8024d ip
Link up
Socket 5001 -> 0 ip:0 State eCLOSED->eTCP_LISTEN
prvSocketSetMSS: 1460 bytes for c0a802e7 ip:36774
Socket 5001 -> c0a802e7 ip:36774 State eTCP_LISTEN->eSYN_FIRST
Socket 5001 -> c0a802e7 ip:36774 State eSYN_FIRST->eSYN_RECEIVED
TCP: passive 5001 => c0a802e7 ip:36774 set ESTAB (sock )
Socket 5001 -> c0a802e7 ip:36774 State eSYN_RECEIVED->eESTABLISHED
Socket 5001 -> c0a802e7 ip:36774 State eESTABLISHED->eLAST_ACK
Socket 5001 -> c0a802e7 ip:36774 State eLAST_ACK->eCLOSE_WAIT

and the Wireshark capture

No. Time Source Destination Protocol Info
100 2015-03-16 14:34:25.877434000 0.0.0.0 255.255.255.255 DHCP DHCP Discover - Transaction ID 0x47033129

Frame 100: 304 bytes on wire (2432 bits), 304 bytes captured (2432 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0 (0.0.0.0), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: bootpc (68), Dst Port: bootps (67)
Bootstrap Protocol

No. Time Source Destination Protocol Info
102 2015-03-16 14:34:25.881171000 192.168.2.1 192.168.2.77 DHCP DHCP Offer - Transaction ID 0x47033129

Frame 102: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: Apple_29:bc:ca (88:1f:a1:29:bc:ca), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.1 (192.168.2.1), Dst: 192.168.2.77 (192.168.2.77)
User Datagram Protocol, Src Port: bootps (67), Dst Port: bootpc (68)
Bootstrap Protocol

No. Time Source Destination Protocol Info
103 2015-03-16 14:34:25.887449000 0.0.0.0 255.255.255.255 DHCP DHCP Request - Transaction ID 0x47033129

Frame 103: 307 bytes on wire (2456 bits), 307 bytes captured (2456 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0 (0.0.0.0), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: bootpc (68), Dst Port: bootps (67)
Bootstrap Protocol

No. Time Source Destination Protocol Info
105 2015-03-16 14:34:25.890746000 192.168.2.1 192.168.2.77 DHCP DHCP ACK - Transaction ID 0x47033129

Frame 105: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface 0
Ethernet II, Src: Apple_29:bc:ca (88:1f:a1:29:bc:ca), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.1 (192.168.2.1), Dst: 192.168.2.77 (192.168.2.77)
User Datagram Protocol, Src Port: bootps (67), Dst Port: bootpc (68)
Bootstrap Protocol

No. Time Source Destination Protocol Info
106 2015-03-16 14:34:25.897022000 c0:b1:3c:83:83:84 Broadcast ARP Gratuitous ARP for 192.168.2.77 (Request)

Frame 106: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request/gratuitous ARP)

No. Time Source Destination Protocol Info
130 2015-03-16 14:34:39.117125000 192.168.2.231 192.168.2.77 TCP 35351 > commplex-link [SYN] Seq=0 Win=5840 Len=0 MSS=1460 SACK_PERM=1 TSval=3256700 TSecr=0 WS=64

Frame 130: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 35351 (35351), Dst Port: commplex-link (5001), Seq: 0, Len: 0

No. Time Source Destination Protocol Info
131 2015-03-16 14:34:39.133153000 192.168.2.77 192.168.2.231 TCP commplex-link > 35351 [SYN, ACK] Seq=0 Ack=1 Win=1460 Len=0 MSS=1460

Frame 131: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Internet Protocol Version 4, Src: 192.168.2.77 (192.168.2.77), Dst: 192.168.2.231 (192.168.2.231)
Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 35351 (35351), Seq: 0, Ack: 1, Len: 0

No. Time Source Destination Protocol Info
132 2015-03-16 14:34:39.133335000 192.168.2.231 192.168.2.77 TCP 35351 > commplex-link [ACK] Seq=1 Ack=1 Win=5840 Len=0

Frame 132: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 35351 (35351), Dst Port: commplex-link (5001), Seq: 1, Ack: 1, Len: 0

No. Time Source Destination Protocol Info
133 2015-03-16 14:34:39.133420000 192.168.2.231 192.168.2.77 TCP 35351 > commplex-link [PSH, ACK] Seq=1 Ack=1 Win=5840 Len=76

Frame 133: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 35351 (35351), Dst Port: commplex-link (5001), Seq: 1, Ack: 1, Len: 76
Data (76 bytes)

0000 77 00 00 00 01 00 00 00 08 00 00 00 32 00 00 00 w…2…
0010 c9 f5 6d 00 b0 de 70 00 34 f3 6d 00 01 00 00 00 …m…p.4.m…
0020 c4 df 6f 00 7c c5 ee bf 98 ea 6f 00 d0 c4 ee bf …o.|…o…
0030 28 8d 6e 00 c0 c4 ee bf 34 f3 6d 00 b4 c4 ee bf (.n…4.m…
0040 3c ea 6f 00 00 00 00 00 00 d9 71 b7 <.o…q.

No. Time Source Destination Protocol Info
134 2015-03-16 14:34:39.133502000 192.168.2.231 192.168.2.77 TCP 35351 > commplex-link [FIN, PSH, ACK] Seq=77 Ack=1 Win=5840 Len=152

Frame 134: 206 bytes on wire (1648 bits), 206 bytes captured (1648 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 35351 (35351), Dst Port: commplex-link (5001), Seq: 77, Ack: 1, Len: 152
Data (152 bytes)

0000 77 00 00 00 01 00 00 00 08 00 00 00 32 00 00 00 w…2…
0010 c9 f5 6d 00 b0 de 70 00 34 f3 6d 00 01 00 00 00 …m…p.4.m…
0020 c4 df 6f 00 7c c5 ee bf 98 ea 6f 00 d0 c4 ee bf …o.|…o…
0030 28 8d 6e 00 c0 c4 ee bf 34 f3 6d 00 b4 c4 ee bf (.n…4.m…
0040 3c ea 6f 00 00 00 00 00 00 d9 71 b7 77 00 00 00 <.o…q.w…
0050 01 00 00 00 08 00 00 00 32 00 00 00 c9 f5 6d 00 …2…m.
0060 b0 de 70 00 34 f3 6d 00 01 00 00 00 c4 df 6f 00 …p.4.m…o.
0070 7c c5 ee bf 98 ea 6f 00 d0 c4 ee bf 28 8d 6e 00 |…o…(.n.
0080 c0 c4 ee bf 34 f3 6d 00 b4 c4 ee bf 3c ea 6f 00 …4.m…<.o.
0090 00 00 00 00 00 d9 71 b7 …q.

No. Time Source Destination Protocol Info
135 2015-03-16 14:34:39.144761000 192.168.2.77 192.168.2.231 TCP commplex-link > 35351 [ACK] Seq=1 Ack=77 Win=1460 Len=0

Frame 135: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Internet Protocol Version 4, Src: 192.168.2.77 (192.168.2.77), Dst: 192.168.2.231 (192.168.2.231)
Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 35351 (35351), Seq: 1, Ack: 77, Len: 0

No. Time Source Destination Protocol Info
136 2015-03-16 14:34:39.150458000 192.168.2.77 192.168.2.231 TCP commplex-link > 35351 [FIN, ACK] Seq=1 Ack=230 Win=1460 Len=0

Frame 136: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Internet Protocol Version 4, Src: 192.168.2.77 (192.168.2.77), Dst: 192.168.2.231 (192.168.2.231)
Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 35351 (35351), Seq: 1, Ack: 230, Len: 0

No. Time Source Destination Protocol Info
137 2015-03-16 14:34:39.150661000 192.168.2.231 192.168.2.77 TCP 35351 > commplex-link [ACK] Seq=230 Ack=2 Win=5840 Len=0

Frame 137: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 35351 (35351), Dst Port: commplex-link (5001), Seq: 230, Ack: 2, Len: 0

No. Time Source Destination Protocol Info
3176 2015-03-16 14:51:25.356426000 0.0.0.0 255.255.255.255 DHCP DHCP Discover - Transaction ID 0x47033129

Frame 3176: 304 bytes on wire (2432 bits), 304 bytes captured (2432 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0 (0.0.0.0), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: bootpc (68), Dst Port: bootps (67)
Bootstrap Protocol

No. Time Source Destination Protocol Info
3178 2015-03-16 14:51:25.359860000 192.168.2.1 192.168.2.77 DHCP DHCP Offer - Transaction ID 0x47033129

Frame 3178: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: Apple_29:bc:ca (88:1f:a1:29:bc:ca), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.1 (192.168.2.1), Dst: 192.168.2.77 (192.168.2.77)
User Datagram Protocol, Src Port: bootps (67), Dst Port: bootpc (68)
Bootstrap Protocol

No. Time Source Destination Protocol Info
3179 2015-03-16 14:51:25.366107000 0.0.0.0 255.255.255.255 DHCP DHCP Request - Transaction ID 0x47033129

Frame 3179: 307 bytes on wire (2456 bits), 307 bytes captured (2456 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0 (0.0.0.0), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: bootpc (68), Dst Port: bootps (67)
Bootstrap Protocol

No. Time Source Destination Protocol Info
3181 2015-03-16 14:51:25.369484000 192.168.2.1 192.168.2.77 DHCP DHCP ACK - Transaction ID 0x47033129

Frame 3181: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface 0
Ethernet II, Src: Apple_29:bc:ca (88:1f:a1:29:bc:ca), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.1 (192.168.2.1), Dst: 192.168.2.77 (192.168.2.77)
User Datagram Protocol, Src Port: bootps (67), Dst Port: bootpc (68)
Bootstrap Protocol

No. Time Source Destination Protocol Info
3182 2015-03-16 14:51:25.375766000 c0:b1:3c:83:83:84 Broadcast ARP Gratuitous ARP for 192.168.2.77 (Request)

Frame 3182: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request/gratuitous ARP)

No. Time Source Destination Protocol Info
3217 2015-03-16 14:51:31.304158000 c0:b1:3c:83:83:84 Vmware_e7:f2:00 ARP 192.168.2.77 is at c0:b1:3c:83:83:84

Frame 3217: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Address Resolution Protocol (reply)

No. Time Source Destination Protocol Info
3218 2015-03-16 14:51:31.304340000 192.168.2.231 192.168.2.77 TCP 36774 > commplex-link [SYN] Seq=0 Win=5840 Len=0 MSS=1460 SACK_PERM=1 TSval=4268886 TSecr=0 WS=64

Frame 3218: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 36774 (36774), Dst Port: commplex-link (5001), Seq: 0, Len: 0

No. Time Source Destination Protocol Info
3219 2015-03-16 14:51:31.320392000 192.168.2.77 192.168.2.231 TCP commplex-link > 36774 [SYN, ACK] Seq=0 Ack=1 Win=1460 Len=0 MSS=1460

Frame 3219: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Internet Protocol Version 4, Src: 192.168.2.77 (192.168.2.77), Dst: 192.168.2.231 (192.168.2.231)
Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 36774 (36774), Seq: 0, Ack: 1, Len: 0

No. Time Source Destination Protocol Info
3220 2015-03-16 14:51:31.320682000 192.168.2.231 192.168.2.77 TCP 36774 > commplex-link [ACK] Seq=1 Ack=1 Win=5840 Len=0

Frame 3220: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 36774 (36774), Dst Port: commplex-link (5001), Seq: 1, Ack: 1, Len: 0

No. Time Source Destination Protocol Info
3221 2015-03-16 14:51:31.320781000 192.168.2.231 192.168.2.77 TCP 36774 > commplex-link [PSH, ACK] Seq=1 Ack=1 Win=5840 Len=76

Frame 3221: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 36774 (36774), Dst Port: commplex-link (5001), Seq: 1, Ack: 1, Len: 76
Data (76 bytes)

0000 77 00 00 00 01 00 00 00 08 00 00 00 32 00 00 00 w…2…
0010 c9 f5 6d 00 b0 de 70 00 34 f3 6d 00 01 00 00 00 …m…p.4.m…
0020 c4 df 6f 00 5c 9b c4 bf 98 ea 6f 00 b0 9a c4 bf …o…o…
0030 28 8d 6e 00 a0 9a c4 bf 34 f3 6d 00 94 9a c4 bf (.n…4.m…
0040 3c ea 6f 00 00 00 00 00 00 39 7f b7 <.o…9…

No. Time Source Destination Protocol Info
3222 2015-03-16 14:51:31.320863000 192.168.2.231 192.168.2.77 TCP 36774 > commplex-link [FIN, PSH, ACK] Seq=77 Ack=1 Win=5840 Len=152

Frame 3222: 206 bytes on wire (1648 bits), 206 bytes captured (1648 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 36774 (36774), Dst Port: commplex-link (5001), Seq: 77, Ack: 1, Len: 152
Data (152 bytes)

0000 77 00 00 00 01 00 00 00 08 00 00 00 32 00 00 00 w…2…
0010 c9 f5 6d 00 b0 de 70 00 34 f3 6d 00 01 00 00 00 …m…p.4.m…
0020 c4 df 6f 00 5c 9b c4 bf 98 ea 6f 00 b0 9a c4 bf …o…o…
0030 28 8d 6e 00 a0 9a c4 bf 34 f3 6d 00 94 9a c4 bf (.n…4.m…
0040 3c ea 6f 00 00 00 00 00 00 39 7f b7 77 00 00 00 <.o…9…w…
0050 01 00 00 00 08 00 00 00 32 00 00 00 c9 f5 6d 00 …2…m.
0060 b0 de 70 00 34 f3 6d 00 01 00 00 00 c4 df 6f 00 …p.4.m…o.
0070 5c 9b c4 bf 98 ea 6f 00 b0 9a c4 bf 28 8d 6e 00 …o…(.n.
0080 a0 9a c4 bf 34 f3 6d 00 94 9a c4 bf 3c ea 6f 00 …4.m…<.o.
0090 00 00 00 00 00 39 7f b7 …9…

No. Time Source Destination Protocol Info
3223 2015-03-16 14:51:31.332094000 192.168.2.77 192.168.2.231 TCP commplex-link > 36774 [ACK] Seq=1 Ack=77 Win=1460 Len=0

Frame 3223: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Internet Protocol Version 4, Src: 192.168.2.77 (192.168.2.77), Dst: 192.168.2.231 (192.168.2.231)
Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 36774 (36774), Seq: 1, Ack: 77, Len: 0

No. Time Source Destination Protocol Info
3224 2015-03-16 14:51:31.337767000 192.168.2.77 192.168.2.231 TCP commplex-link > 36774 [FIN, ACK] Seq=1 Ack=230 Win=1460 Len=0

Frame 3224: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Vmware_e7:f2:00 (00:0c:29:e7:f2:00)
Internet Protocol Version 4, Src: 192.168.2.77 (192.168.2.77), Dst: 192.168.2.231 (192.168.2.231)
Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 36774 (36774), Seq: 1, Ack: 230, Len: 0

No. Time Source Destination Protocol Info
3225 2015-03-16 14:51:31.338051000 192.168.2.231 192.168.2.77 TCP 36774 > commplex-link [ACK] Seq=230 Ack=2 Win=5840 Len=0

Frame 3225: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Vmware_e7:f2:00 (00:0c:29:e7:f2:00), Dst: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84)
Internet Protocol Version 4, Src: 192.168.2.231 (192.168.2.231), Dst: 192.168.2.77 (192.168.2.77)
Transmission Control Protocol, Src Port: 36774 (36774), Dst Port: commplex-link (5001), Seq: 230, Ack: 2, Len: 0

No. Time Source Destination Protocol Info
3260 2015-03-16 14:51:46.974398000 c0:b1:3c:83:83:84 Broadcast ARP Gratuitous ARP for 192.168.2.77 (Request)

Frame 3260: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: c0:b1:3c:83:83:84 (c0:b1:3c:83:83:84), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request/gratuitous ARP)

rtel wrote on Tuesday, March 17, 2015:

You seem to have got a long way - which is good - we will of course do what we can to assist but I will need a little time. It would be great to get your project in the FreeRTOS interactive site when it is all working (just the FreeRTOS+TCP bit - not your application code that is using the TCP stack!). Regarding your question:

Best I can figure is i might need to setup an event group? FreeRTOS_accept seems to be
waiting in xEventGroupWaitBits, but I only have a single server trying to listen on a
single port. Any help is appreciated.

The event groups are used to communicate between sockets and the task that runs the IP stack - it is all internal to the stack so you don’t need to create event groups yourself.

Regards.

rtel wrote on Tuesday, March 17, 2015:

Did you forget to attach the wireshark capture?

gregm102 wrote on Tuesday, March 17, 2015:

The wireshark output is the bulk of the initial post, but I suspect you wanted a cap file … Attached is an equivalent cap from today

Greg

gregm102 wrote on Tuesday, March 17, 2015:

New Information, I did get the application to work properly, but I needed to change the block time to zero. There appears to be a issue with nonzero wait times to FreeRTOS_accept. The connection is only checked for once at the entrance to FreeRTOS_accept. Small numbers work and if the code loops accept will will return the socket after the timeout value.

Greg

heinbali01 wrote on Wednesday, March 18, 2015:

Hi Greg,

Great that you found a way to get it working.

As you saw the connection is made and closed very quickly. Your TCP client has sent 76 + 152 bytes and along with the second packet, it sends the FIN flag. The entire connection only lasts 38 ms.

Could you drop an email to Richard ( see http://www.freertos.org/contact ) and you will receive the latest +TCP release. Some minor things have changed about the server sockets.

Regards,
Hein

andymcc0 wrote on Wednesday, March 18, 2015:

Hi Greg,

My application uses an ‘infinite’, i.e. portMAX_DELAY, timeout on the listening socket on which FreeRTOS_accept() waits. When a connection is made and the client socket is returned by FreeRTOS_accept(), I set finite timeouts (a few hundred milliseconds) for both send and receive for that socket, and this seems to work. I haven’t explored finding optimal values for these.

I am using a later version (150114) of +TCP than is publicly downloadable from the FreeRTOS site.

My simple demo is here (includes the slightly modified +TCP-150114):
http://interactive.freertos.org/entries/80118239-FreeRTOS-TCP-Labs-port-and-demo-for-Embedded-Artists-LPC4088-Dev-Kit

Regards,

Andy McC