This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS570LS3137:EMAC 中断问题。

Guru**** 2540650 points
Other Parts Discussed in Thread: TMS570LS3137, TMS570LC4357

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1323158/tms570ls3137-emac-interrupt-problem

器件型号:TMS570LS3137
主题中讨论的其他器件: TMS570LC4357

我尝试使用以下 TCP echo 服务器代码将数据发送到 tms570ls3137 Hercules 开发套件。

#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);
}

当我发送一定量的数据时、不会发生中断。 但广播数据确实会发生这种情况。

我意识到 RX0FREEBUFFER 在 一些数据后设置为0、它不再增加。 这是问题吗?



https://github.com/originzero-io/SOM_TMS570LS3137_V1.1_BASE 这是我的项目。 如果您愿意、您可以进行测试。

感谢您的任何帮助。 谢谢。