I am attempting to communicate via ethernet to the Concerto eval board. On the Concerto, I am running the enet_uip example on the M3 core, modified to use a fixed IP address. On the host side, I am running the C# code appended below. I am not using the C28 at all. Using WireShark, I see that the ping is successful, but during connection the Concerto acknowleges the host, but then returns an RST. After that, the writes in the C# code do not create any communication seen by Wireshark.
Has anyone done this before? What changes are required in the enet_uip code?
I am using a recent version of controlSUITE and CCS version 5.1.0.09000. I am using the controlCARD TMDXCNCDH52C1 with the XDS100v2 emulator.
The connect and write routines of the C# program follows. I am simply trying to write the byte 187 to the Concerto.
protected void ConnectPort()
{
string hostIp;
int hostPort;
if(rdoConcerto.Checked)
{
hostIp = ConcertoHostIp;
hostPort = ConcertoHostPort;
}
else
{
hostIp = AzLvlHostIp;
hostPort = AzLvlHostPort;
}
mClient = new TcpClient();
if (!(mClient != null && mClient.Connected))
{
// Make sure that host IP exists
Ping pingSender = new Ping();
// Attempt to connect to the host
try
{
PingReply reply = pingSender.Send(hostIp, 200);
if (reply.Status != IPStatus.Success)
{
txtGet.Text = "Ping failed.";
}
else
{
mClient = new TcpClient(hostIp, hostPort);
mNs = mClient.GetStream();
txtGet.Text = "Connection Established";
}
}
catch (Exception e)
{
txtGet.Text = "Unable to open Ethernet connection to " + hostIp + ":" + hostPort.ToString() + " : " + e.Message;
}
}
}
protected void SendReceive()
{
int length;
try
{
byte[] writeData = new byte[10];
while (mNs.DataAvailable)
{
// Receive the response
int bytes = mNs.Read(writeData, 0, writeData.Length);
}
if(cbConvertStringToBytes.Checked)
{
// Trasfer command to a byte array
txtSend.Text += "\r\n";
writeData = Encoding.ASCII.GetBytes(txtSend.Text);
length = txtSend.Text.Length + 2;
}
else
{
writeData[0] = Convert.ToByte(txtSend.Text);
length = 1;
}
// Send message out port
mNs.Write(writeData, 0, length);
Thread.Sleep(500);
byte[] readData = new byte[100];
int bytesRead = 0;
byte[] oneByte = new byte[1];
while (mNs.DataAvailable && !(readData[bytesRead] == '\n' && readData[bytesRead -1] == '\r'))
{
// Receive the response
//bytes += mNs.Read(writeData, bytes, 1);
bytesRead += mNs.Read(oneByte, 0, 1);
readData[bytesRead - 1] = oneByte[0];
}
txtGet.Text = Encoding.ASCII.GetString(readData,2,4);
}
catch (Exception e)
{
txtGet.Text = "Unable to send command " + txtSend.Text + " : " + e.Message;
}
}
}
}