Ethernet slice on startKIT

All technical discussions and projects around startKIT
Posts: 10
Joined: Wed Jan 08, 2014 5:36 pm

Ethernet slice on startKIT

Postby ChedaDSP » Thu Jan 30, 2014 1:11 am

I have a small demo that shows how to control LEDs on over Ethernet - simple web server. I used HTML5 style buttons to have triggers. Did the example just to make sure that my startKIT is operational.

Someone that want to use Ethernet slice with startKIT can find this useful:

To make sliceKit app_simple_webserver example to run on startKIT:
1. Import app_simple_webserver and required modules (required modules auto imported by IDE)
2. Modify line app_simple_webserver\Makefile\TARGET = STARTKIT
3. Add folder STARTKIT to module_ethernet_board_support
4. Copy ethernet_board_conf.h from SLICEKIT-L16 or make your own from scratch.
5. Make sure that you have #define ETHERNET_DEFAULT_PHY_ADDRESS 0
6. Make ports mapped as:

#define PORT_ETH_RXCLK on tile[0]: XS1_PORT_1J
#define PORT_ETH_RXD on tile[0]: XS1_PORT_4C
#define PORT_ETH_TXD on tile[0]: XS1_PORT_4D
#define PORT_ETH_RXDV on tile[0]: XS1_PORT_1K
#define PORT_ETH_TXEN on tile[0]: XS1_PORT_1L
#define PORT_ETH_TXCLK on tile[0]: XS1_PORT_1I
#define PORT_ETH_MDIO on tile[0]: XS1_PORT_1M
#define PORT_ETH_MDC on tile[0]: XS1_PORT_1N
#define PORT_ETH_INT on tile[0]: XS1_PORT_1O
#define PORT_ETH_ERR on tile[0]: XS1_PORT_1P

You should get Hello world from web server now!

For the complete demo import attached projects. Rest of the changes are in httpd.c and new file led_control.xc (copy of LED demo with simple changes).
You do not have the required permissions to view the files attached to this post.
User avatar
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Postby sethu_jangala » Thu Jan 30, 2014 10:56 am

Hi ChedaDSP

Thank you for sharing this.

Junior Member
Posts: 6
Joined: Sun Feb 23, 2014 5:04 pm

Postby MikeIT » Fri Feb 28, 2014 7:03 pm

I have downloaded the file from github. Installed and then followed the instructions from ChedaDSP to run the app_udp_demo on my StartKit with the ethernet slice.

I had the following problems:
At the beginning I had to add a default MAC address because startKit doesn't have one in OTP. It started working but:
In my windows application with a server to listen for broadcast messages no messages arrived.
After a while searching the cause I tried to lower the message length from 100
to 32 and it worked. It's not a problem on the windows program because it can send and receive broadcast messages of more than 100 bytes.
After this I saw that the same problem or limitation is on the listening port.
I can only send and thus receive packed of about 32 bytes.
If I send more bytes from the PC program (ex. 100) they are received but when the program say responding ... sent then no data arrive on the PC program.

After this I ran the program on my SliceKit L16 and here it work well. The limit are not present here.

***Almost solved while writing this post. I returned to the StartKit and commented the 2 printstrln("Sent broadcast") and printstrln("Sent response") in the XTCP_SENT_DATA event and now it work as in the SliceKit without lenght limit.
It seem that the printstrln function block some ehternet task or so.

User avatar
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Sat Mar 01, 2014 12:27 am

Print functions using JTAG can halt the core.
This can mess up the Ethernet MII timings
Junior Member
Posts: 6
Joined: Sun Feb 23, 2014 5:04 pm

Postby MikeIT » Sat Mar 01, 2014 12:59 pm

Yes Bianco,
It's clear now. It doesn't occur on the SliceKit core board perhaps because the print function run faster or doesn't halt che core.
Anyway is good to know.
User avatar
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Postby Folknology » Sat Mar 01, 2014 6:08 pm

You could try redirecting printing to xscope rather than jtag, it's impact maybe less, certainly worth a go.

P.S. you might also need to add -fxscope to your compile flags/config as well as --xscope to your xrun command (or configs in eclipse)

Junior Member
Posts: 6
Joined: Sun Feb 23, 2014 5:04 pm

Postby MikeIT » Sat Mar 01, 2014 7:38 pm

Hi Al,
Thank you for your suggestion. It work now, I have uncommented the print functions and sent packets of 1200 bytes without problems.
I will read more about XScope now...

p.s. the code added from the link you gave me is:

Code: Select all

#include <xscope.h>
void xscope_user_init(void) {
   xscope_register(0, 0, "", 0, "");
I used --fxscope for the compiler and Offline [XScope] Mode in run configuration.
User avatar
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Mon Mar 03, 2014 9:52 am

Thanks for sharing! I am sure a lot of people will find this helpful.

Who is online

Users browsing this forum: No registered users and 3 guests