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.
xCORE-200 Explorer kit Gigabit TCP ??
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:
and the #defines in main.xc to:
If you want to run this at gigabit rates then you need to change line 142 to be:
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:
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:
Hope that helps,
Peter
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
Code: Select all
#define EXPLORER_KIT 1
#define SLICEKIT_L16 0
#define MIC_ARRAY 0
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);
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
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;
Peter
- Attachments
-
- test_tcp.py.zip
- Script for testing a TCP device.
- (885 Bytes) Downloaded 510 times
- test_tcp.py.zip
- Script for testing a TCP device.
- (885 Bytes) Downloaded 510 times
VERY sweet.
Much appreciated.
Much appreciated.
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
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
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
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