Page 1 of 1

xCORE-200 Explorer kit Gigabit TCP ??

Posted: Sun Jul 17, 2016 7:57 am
by PhilKoh
I've gone through the Gigabit Ethernet example for Explorer kit, which was very nice, and it responds to pings. However, how do I go the next step to do something useful other than answer pings, i.e. send data?
I found another older AppNote 121 that is a UDP demo, and tried to figure out how to cut and paste the xtcp functionality onto the Explorer kit gigabit ethernet, but couldn't get it working. There must be some sample code somewhere out there that uses the Explorer kit's gigabit ethernet to do something practical using TCP/IP or UDP? I have never dove deeper than just sending UDP messages, so the lower-layer distinctions between MII's and MAC's are lost on me. Anything that shows how to successfully wire the xtcp functionality onto the explorer kit and use it would be so nice.


Many thanks in advance.

Re: xCORE-200 Explorer kit Gigabit TCP ??

Posted: Mon Jul 18, 2016 4:12 pm
by peter
Hi PhilKoh,

I've done a port of AN00121 to the xCORE-200 Explorer board. It is available on the AN00121 branch of my fork of lib_xtcp. Note that you'll need to change the target in the Makefile to:

Code: Select all

#TARGET = SLICEKIT-L16
TARGET = XCORE-200-EXPLORER
#TARGET = MIC-ARRAY-1V0
and the #defines in main.xc to:

Code: Select all

#define EXPLORER_KIT    1
#define SLICEKIT_L16    0
#define MIC_ARRAY       0
If you want to run this at gigabit rates then you need to change line 142 to be:

Code: Select all

  smi_configure(smi, phy_address, LINK_1000_MBPS_FULL_DUPLEX, SMI_ENABLE_AUTONEG);
//  smi_configure(smi, phy_address, LINK_100_MBPS_FULL_DUPLEX, SMI_ENABLE_AUTONEG);
Note that the test is set up to have a fixed IP address (172.16.0.2) defined at line 92. It can use DHCP if the empty config at line 86 is used instead.

Despite the name, I've tweaked my version to listen for TCP connections (line 207) instead of XTCP_PROTOCOL_UDP.

I've added a script which I used to send test data to the device and time how long it takes. If you run the following command it will time how long it takes for the device to receive 10000 100-byte packets:

Code: Select all

python test_tcp.py --ip 172.16.0.2 --port 15533 --packet-size 100 --delay-us 0 --packets 10000 --no-response
Note that you will need to either change your network settings to be on the same subnet or get the IP address of the device (run with --xscope and it will print its IP address on startup).

The --no-response is used to say that the data is uni-directional. If you want to test that the data can be echoed back and how long it takes then you can remove this flag and re-compile with the following change at line 182:

Code: Select all

//  int send_flag = TRUE;
  int send_flag = FALSE;
Hope that helps,

Peter

Re: xCORE-200 Explorer kit Gigabit TCP ??

Posted: Tue Jul 19, 2016 11:05 pm
by PhilKoh
VERY sweet.

Much appreciated.

Re: xCORE-200 Explorer kit Gigabit TCP ??

Posted: Wed Jan 08, 2020 8:58 am
by jsgn3
Hi Peter,

I would like to use your posted port. However, the link
'fork of 'lib_xtcp' is dead:

https://github.com/pthedinger/lib_xtcp/tree/AN00121

Is your port still available somewhere?

Thanks,
Jos

Re: xCORE-200 Explorer kit Gigabit TCP ??

Posted: Sun Jan 12, 2020 12:43 am
by mon2

Re: xCORE-200 Explorer kit Gigabit TCP ??

Posted: Mon Jan 13, 2020 2:22 pm
by jsgn3
Thank you mon2.

The link you provided concerns a TCP/IP library. It is
not a port of AN00121.

In the mean time I found another port:

https://github.com/Pajeh/XMOS_gigabit_tcp_reflect