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.

LAUNCHXL2-RM57L: Lwip is not working with GCC compiler and IAR compiler

Part Number: LAUNCHXL2-RM57L
Other Parts Discussed in Thread: HALCOGEN

Hi there,

I am using RM57Lx LaunchPad Development Kit. I am implementing Lwip for my project with the help of this link: http://processors.wiki.ti.com/index.php/HALCoGen_Ethernet_Driver_and_lwIP_Integration_Demonstration.

It is completely worked with TI compiler on CCS and assigns IP address properly.

But if I use GCC in CCS or I use IAR compiler(Generated EMAC code for IAR using HALCOGen) and it shows an error in initializing Hardware and not assign the IP address.

And error looks like:

=========================================

Texas Instruments
Little Endian device
Initializing ethernet (DHCP)
DEBUG - Getting PHY ID...SUCCESS
DEBUG - Getting PHY Alive Status...SUCCESS
DEBUG - Getting PHY Link Status...SUCCESS
DEBUG - Setting up Link...SUCCESS
..DONE


-------- ERROR INITIALIZING HARDWARE --------

=========================================

Also note that :

For IAR complier there is linking error of this 4 functions _enable_FIQ(), _enable_IRQ(), _disable_IRQ(), _get_CPSR() which is written in lwip_main.c,in may case i commented this 4 function for now.

Please help or guide me to solve out this issue.

Thanks in Advance,

Keyur Joshi

  • Hello Keyur,

    Did you use DHCP or use static IP? It might be caused by the endianness of the IP address. Please step into the LwipInit() to check why the ipAddrPtr is NULL.
  • Hello Wang,

    I am using DHCP. I checked endianness of IP address and it is proper. In DHCP ipAddrptr is assign like ipAddrPtr = (unsigned int*)&(hdkNetIF[instNum].ip_addr).

    Is there any other solution for the above issue.

    I didn't get any issue during compilation and linking but it shows error while assigning IP address with IAR embedded workbench using IAR compiler but it completely works fine with TI compiler using CCS.

    Thanks in advance,
    Keyur Joshi
  • Hello Keyur,

    It is better to step in lwipInit() to check if BYTE_ORDER LITTLE_ENDIAN takes effect.

    There are a bunch of things that can influence the byte swapping in LWIP:

    e.g.

    LWIP_PLATFORM_BYTE_SWAP

    LWIP_PLATFORM_HTONS()

    LWIP_PLATFORM_HTONL()

     

  • Hello Wang,

    Thanks for your suggestion, but it is not worked in my case.

    One my colleague already asked about this scenario with was mention in below thread:
    e2e.ti.com/.../791963

    As a continuation of the above thread, I attached the GCC code and IAR code for your reference.

    With both IAR and GCC ip address is not assign.I use the same code base which is mention in processors.wiki.ti.com/.../LAUNCHXL2_RM57L:_lwIP_Demo(It works fine with TI compiler(using CCS))

    Below are some explanation of the issue:

    ++++++++++++++++For GCC(Using CCS)++++++++++++++++
    In file example\hdk\src\lwip_main.c, debugger hit line no 128

    and after that it shows error like this:

    ================================================
    HERCULES MICROCONTROLLERS
    Texas Instruments
    Little Endian device
    Initializing ethernet (DHCP)
    DEBUG - Getting PHY ID....SUCCESS
    DEBUG - Getting PHY Alive Status...SUCCESS
    DEBUG - Getting PHY Link Status...SUCCESS
    DEBUG - Setting up Link...SUCCESS
    ..DONE

    -------- ERROR INITIALIZING HARDWARE --------
    ================================================I

    ++++++++++++++++For IAR(Using IAR workbench)++++++++++++++++
    In file lwip-1.4.1\src\core\dhcp.c, debugger hit line no.902 function dhcp_delete_msg(),
    and it is stuck, may be it can't find properly memory address.

    and after that it shows error like this:

    ================================================
    HERCULES MICROCONTROLLERS
    Texas Instruments
    Little Endian device
    Initializing ethernet (DHCP)
    DEBUG - Getting PHY ID....SUCCESS
    DEBUG - Getting PHY Alive Status...SUCCESS
    DEBUG - Getting PHY Link Status...SUCCESS
    DEBUG - Setting up Link...SUCCESS
    (Stuck)(Added by me)
    ================================================I

    In Both cases, I am using HALCOgen to generated code using TOOLS IAR and GCC.

    Please find attached code, I also attached TI code1581.IAR_Lwip.zip2475.GCC_Lwip.zip4442.TI_Lwip.zip.

    Please help me to solve out this issue.

    Thanks in Advance,
    Keyur

  • Hello Wang,

    Is there any update regarding the above issue?

    Thanks,

    Keyur 

  • Hello Wang,

    Did you tried any of the projects which I was sent in regarding ethernet?

    Kindly guide me on this.

    Thanks,

    Keyur

  • Hi Keyur,

    I am sorry I did not the code using GCC and IAR compiler. I don't have IAR workbench.