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.

FreeRTOS and lwIP on TM4C

Other Parts Discussed in Thread: EK-TM4C1294XL

Hi,

First of all, sorry, I'm quite new to LwIP and any other (e.g.: uip) embedded network stacks, but I have lot's of experience with FreeRTOS.

I'm using the EK-TM4C1294XL Launch Pad with Code Composer Studio V6. Recently, I try to set up a simple application, where the device gets its IP address via DHCP, but after some initialization steps, the processor is in HandlerHardFault state.

I have an TivaWare_C_Series-2.1.0.12573 driver library, and I investigated the examples, but as I saw, there wasn't an example, that fulfills my requirements (FreeRTOS and LwIP are used together), so my application based the <insatll_dir>\TivaWare_C_Series-2.1.0.12573\examples\boards\ek-tm4c1294xl\enet_lwip example. I defined

* NO_SYS to 0

* RTOS_FREERTOS to 1

in the lwipopts.h file.


Can anybody explain me step-by-step, how can I integrate the LwIP and FreeRTOS together and port these onto the evaluation board above?

Regards,

Norbert

  • Hello Norbert

    When the processor goes into a HardFault, what is the FAULTSTAT and FAULTADDR showing up as? We should begin debug with the example when it is still at its infancy,

    Regards
    Amit
  • Hi Norbert and Amit,

    I have exactly the same problem. My code project is an adaptation from senshub_iot+freertos_demo(dk-tm4c129x folder). I'm using TivaWare version 2.1.0.12573 and compiler TI v5.1.6.

    Some register values:

    Core Registers-> xPSR -> EXCEPTION

    EXCEPTION 000000011 Exception Number

    Exception number 11 is SVCall.

    ************************************************************************

    NVIC_FAULT_STAT 0x00020000 Configurable Fault Status [Memory Mapped]

    NVIC_FAULT_STAT_INVSTAT 1 Invalid State Usage Fault

    Invalid State Usage Fault
    Value Description
    1 The processor has attempted to execute an instruction that
    makes illegal use of the EPSR register.

    ***********************************************************************

    NVIC_FAULT_ADDR 0xE000EDF8 Bus Fault Address [Memory Mapped]

    *****************************************************

    NVIC_HFAULT_STAT_FORCED 1 Forced Hard Fault

    *****************************************************

    My project:

    https://dl.dropboxusercontent.com/u/22273442/projetos/texas/freertos_ip.zip

    Sorry, I dont know to attach normal files. 

  • Hello Vinicius,

    You would need to do two things

    1. Narrow it to the function or code that causes this?
    2. Check the SP for the PC stack-ed which will return the exact address in the Instruction Code that caused the issue.

    Regards
    Amit
  • Norbert Toth said:


    Can anybody explain me step-by-step, how can I integrate the LwIP and FreeRTOS together and port these onto the evaluation board above?

     Hi NOrbert, why not see also FreeRtos page about TCP?

    http://www.freertos.org/embeddedtcp.html

     Support for Stellaris was complete but TIVA version is not increasding too much and it is where I got inspired about some TIVA infancy bugs.

     Try also evaluate TI RTOS, is complete and supported from this firm.

     Also try ask same question and report to FreeRTOS Forum too so some TIVA support can be better

    http://sourceforge.net/p/freertos/discussion/382005/

     A developer was present here but got insterspersed into oblivion of this platform.

  • Hi Amit,

    The last function performed before the system break:

    //
    // Signal a connect event.
    //
    g_sEnet.pfnEvent(ETH_CLIENT_EVENT_DHCP, &g_sEnet.sIPAddr.addr, 4);

    This function is in lwIPHostTimerHandler() inside eth_client.c

    Debug Lwip: https://dl.dropboxusercontent.com/u/22273442/projetos/texas/logErr1.txt 

  • Hello Vinicius,

    So did you put a break point at the connect event and then step debug from this point till the faulting code?

    Regards
    Amit
  • I did put break point at dhcp_fine_tmr() and step to g_sEnet.pfnEvent(). In this point the system breaks. But  fortunately does not matter, i found the problem.

    No function was defined to events, so the system breaks. I was calling the function lwIPInit() directly, then I commented and I called:

    EthClientInit(g_ui32SysClock, &exoHAL_ExositeEnetEvents);

    Almost everything is working: DHCP, tasks. My goal is to create a project like tcp_echo(ipv4/ipv6) using FreeRTOS + Lwip. The next problem is lwip_accept():

    ASSERT FAIL at line 289 of C:/ti/TivaWare/third_party/lwip-1.4.1/src/api/api_lib.c: netconn_accept: invalid acceptmbox