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.

EK-TM4C1294XL: LwIP is not sending UDP packets

Part Number: EK-TM4C1294XL

Hi,


I'm working on a Tiva-C TM4C1294XL board and I'm trying to send UDP packet to a computer. I just need to send data and I never need the computer to answer the board. I modified the enet_lwip example and even I can get an IP and ping the board, I'm not able to send any UDP packet. My first attempt is using a loop with udp_send() in it. I found on other post that normally udp_send() should be called from the ethernet handler. However I saw that it can work a time as in this post :

With this code, I'm able to get the link, to get an ip and the board answer to the ping (so it is able to send data). However I'm not able to send any UDP packet and I don't know why. Ok as I wrote I know that normally the udp_send() must be used in the handler but it should at least send some udp datagram.

Do I need the udp_init() function ?

Do I need to free the pbuf ?

Do I need anything else just to send one datagram ?

int main(void)
{
    struct udp_pcb * pcb;

    BoardInit();			// Initialize the board.
    ConsComInit();			// Initialize the communication with the computer via UART0.
    PinoutSet(true, false);		// Configure the device pins.
    EthInit();				// Initialize the Ethernet port.
    SysTickInit();			// Enable the System Timer
    pcb = UdpInit(srv_ip , srv_port);	// Initialize the UDP connection with remote server (same code than LocatorInit but return the PCB).

    //Print relevant information to check if UdpInit is ok ---> the pcb is correctly configured
    UARTprintf("\nLocal ip address should be any : ");
    DisplayIPAddress(pcb->local_ip.addr);
    UARTprintf("\nLocal port : %3d\n", pcb->local_port);
    UARTprintf("Remote ip address : ");
    DisplayIPAddress(pcb->remote_ip.addr);
    UARTprintf("\nRemote port : %3d\n", pcb->remote_port);

    struct pbuf * pb;
    char str[512]="Test Veoware";
    pb = pbuf_alloc(PBUF_TRANSPORT, 512, PBUF_REF);
    pb->payload = str;
    pb->len = pb->tot_len = 512;

    while(1){                        // I just try to send continuously the same info just to see if packet is sent.
        udp_send(pcb, pb);
    }    

    //Setup the device locator service.
    //LocatorInit();
    //LocatorMACAddrSet(pui8MACArray);
    //LocatorAppTitleSet("EK-TM4C1294XL enet_io");
    //UARTprintf("%d.",pui8MACArray );
    //httpd_init();


    // Set the interrupt priorities.  We set the SysTick interrupt to a higher
    // priority than the Ethernet interrupt to ensure that the file system
    // tick is processed if SysTick occurs while the Ethernet handler is being
    // processed.  This is very likely since all the TCP/IP and HTTP work is
    // done in the context of the Ethernet interrupt.

    MAP_IntPrioritySet(INT_EMAC0, ETHERNET_INT_PRIORITY);
    MAP_IntPrioritySet(FAULT_SYSTICK, SYSTICK_INT_PRIORITY);

    // Loop forever.  All the work is done in interrupt handlers.
    while(1)
    {
    }
}

  • I see your post is over 12 hours old and you did not get any response. Unfortunately I am not an LWIP expert. Have you tried seeking help from the LWIP group?
    savannah.nongnu.org/.../
  • Hi,

    thanks for your support. I already try to get info on savannah website but without any success.

    Has anybody an hint for me ? I don't need the full functionalities but only taking some data and sending them. I don't need any communication to the boarb, only sending UDP datagramms from the board to a computer.

    thanks in advance

    kr
  • Dear Nicolas hello.
    I would suggest to study for a while the source of the \TIVAWARE_verNNNNNN\third_party\lwip-n.n.n\src\apps\tftp example and everything will become clear in a while. It's straightforward to follow. Just run this example and find a trivialFTP client from internet or from OS (Linux, Windows) and send some packets to the module and then check module's replies.
    John