Ethernet slice on startKIT

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

Ethernet slice on startKIT

Post by ChedaDSP »

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 ETHERNET_DEFAULT_TILE tile[0]
#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).
Attachments
LED_web_server.7z
Projects to run LED web server demo
(110.12 KiB) Downloaded 472 times
LED_web_server.7z
Projects to run LED web server demo
(110.12 KiB) Downloaded 472 times


User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

Hi ChedaDSP

Thank you for sharing this.

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

Post by MikeIT »

I have downloaded the sc_xtcp-master.zip 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.


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

Post by Bianco »

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

Post by MikeIT »

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
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

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)

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

Post by MikeIT »

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...
Regards.
Mike.

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, "");
   xscope_config_io(XSCOPE_IO_BASIC);
}
I used --fxscope for the compiler and Offline [XScope] Mode in run configuration.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

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