Other Parts Discussed in Thread: TMS570LC4357
I am trying to send data to tms570ls3137 hercules development kit using the following TCP echo server code.
#define ECHO_PORT 7 // Standard echo port number
uint32_t tcp_rx_counter;
static err_t echo_recv_callback(void *arg, struct tcp_pcb *tpcb, struct pbuf *p,
err_t err)
{
if (p != NULL)
{
tcp_rx_counter++;
// Echo back the received data
tcp_write(tpcb, p->payload, p->len, 1);
tcp_recved(tpcb, p->len);
}
else if (err == ERR_OK)
{
// Connection closed
return tcp_close(tpcb);
}
if (NULL != p)
{
pbuf_free(p);
}
return ERR_OK;
}
static err_t echo_accept_callback(void *arg, struct tcp_pcb *newpcb, err_t err)
{
// Set the receive callback for this connection
tcp_recv(newpcb, echo_recv_callback);
return ERR_OK;
}
static void start_echo_server(void)
{
struct tcp_pcb *pcb;
// Create a new TCP control block
pcb = tcp_new();
if (!pcb)
{
return; // Error
}
// Bind to the echo port
tcp_bind(pcb, IP_ADDR_ANY, ECHO_PORT);
// Set it to listen for incoming connections
pcb = tcp_listen(pcb);
tcp_accept(pcb, echo_accept_callback);
}
When I send a certain amount of data, interrupt doesn't occur. It does however occur for the broadcast data.
I realized the RX0FREEBUFFER is set to 0 after some data and it never increases again. Could this be the problem?
https://github.com/originzero-io/SOM_TMS570LS3137_V1.1_BASE Here is my project. If you'd like, you can test it.
I'd appreciate any help. Thanks.

