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: lwip and freertos example project

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN,

Hello,

I'm developing a project and need to get lwip and freertos to work together but I haven't succeeded yet. Do you have a sample project that works with lwip and freertos that you can provide me?

Thank you...

  • Hi Fatih,

    I'm developing a project and need to get lwip and freertos to work together but I haven't succeeded yet. Do you have a sample project that works with lwip and freertos that you can provide me?

    Unfortunately, we don't have FreeRTOS+LwIP example.

    We do have only LWIP demo and Active webserver demo example codes only and they were without FreeRTOS.

    6.1. Project 0 — Hercules Safety MCUs Documentation

    --
    Thanks & regards,
    Jagadish.

  • I have a question, why is the emac library created by halcogen not used, but the features from this library are rewritten in hkdif ?

  • Hi Fatih,

    why is the emac library created by halcogen not used, but the features from this library are rewritten in hkdif ?

    If you verify the LwIP design and its layers

    The application will not use the EMAC functions directly, and the EMAC will interface with the LwIP interface unit. That is the reason the EMAC functions are used in hdkif (Hardware Development Kit Interface) module.

    --
    Thanks & regards,
    Jagadish.

  • Hi, 

    Thank you for the diagram, I realized that it was not working due to the queue structure I used and I solved the problem.

    I managed to run lwip with freertos but now I encountered the following problem. Do you have any ideas on how to solve this problem?

    My program is stuck in the loop in the sys_timeout_abs function of lwip timeouts when I try to connect to mqtt broker or send data to netconn tcp echo server or if I call sts_timeout in timeout callback as following.

    static void timer(void *arg)
    {
        task_counter++;
        sys_timeout(2000, timer, NULL);
    }
    
    static void defaultTask(void *pvParameters)
    {
        log_printf("program started\n");
    
        ethernet_lwip_init(false);
    
        while (!dhcp_supplied_address(&gnetif))
        {
            vTaskDelay(100);
        }
    
        sys_timeout(2000, timer, NULL);
    
        for (;;)
        {
            vTaskDelay(3000);
        }
    }

    But if I fix it as following it works well

    static void timer(void *arg)
    {
        task_counter++;
    }
    
    static void defaultTask(void *pvParameters)
    {
        log_printf("program started\n");
    
        ethernet_lwip_init(false);
    
        while (!dhcp_supplied_address(&gnetif))
        {
            vTaskDelay(100);
        }
    
        for (;;)
        {
            vTaskDelay(3000);
            sys_timeout(2000, timer, NULL);
        }
    }

    It should also work when I use it like in the first example because the timeouts is used in mqtt and tcp libraries of lwip as first example

    When I looking for the problem I recognize that the next of next_timeout is point itself that's why it is stuck in infinity loop.

    I added a sample project if you want to check it. In main.h there is a definition called FIRST_EXAMPLE_THAT_DOES_NOT_WORKS if you set it to 1 you will enable the non working code if you set it to 0 you will enable the working code

    Here is the sample project's repository      (https://github.com/fatihyazman/TMS570LS3137_FOR_TI_SUPPORT) (all configurations did for TMS570LS3137 Hercules development kit)

    Thank you...

  • I found the problem I initted the lwip_init twice, Thank you for your help

    Good works..