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.

RM57 HDK, Halcogen lwIP demo, Static IP

Other Parts Discussed in Thread: HALCOGEN

http://processors.wiki.ti.com/index.php/HALCoGen_Ethernet_Driver_and_lwIP_Integration_Demonstration


From lwip_main.c, setting static IP should be done accordingly:

 

/* Initialze the lwIP library, using DHCP.*/

sciDisplayText(sciREGx, txtEnetInit, sizeof(txtEnetInit));

//ipAddr = lwIPInit(0, macAddress, 0, 0, 0, IPADDR_USE_DHCP);

/* Uncomment the following if you'd like to assign a static IP address. Change address as required, and uncomment the previous statement. */

/**/

uint8 ip_addr[4] = { 192, 168, 0, 101 };

uint8 netmask[4] = { 255, 255, 255, 0 };

uint8 gateway[4] = { 192, 168, 0, 1 };

 ipAddr = lwIPInit(0, macAddress,

*((uint32_t *)ip_addr),

*((uint32_t *)netmask),

*((uint32_t *)gateway),

IPADDR_USE_STATIC);

This does not work. Any ideas why? (DHCP mode works fine.)

  • *note to self: always check the most obvious possibility*

    So, the problem was the order of bytes. i.e. using {1, 0, 168, 192} instead of {192, 168, 0, 1} worked.

    Next question is then, why is the byte order reversed? I don't remember needing to reverse the bytes for RM48.

  • Davor,

    I am guessing that the same source code is used for RM and TMS570  and the validation is done on TMS570. I have forwarded your post to our HalCoGen team. They can provide feedback with more details. Your input is very important for us to improve quality.

    Thanks and regards,

    Zhaohong

  • Hi.

    I'm developing ethernet communication for RM57 using lwIP now.

    How is this issue going? I bumped now, so I want to know about this issue exactly..

    Regards.

  • Hi Wonjae,

      There is an issue with the LC4357 in terms of how the data is written to the CPPI memory (the memory that stores your buffer descriptors). The issue is that the data written to the CPPI is byte swapped incorrectly. You can look at the CPPI memory starting at 0xFC52_0000 and compare the contents between LC4357 and your RM48 device. If you port your RM48 LwIP project to LC4367 then you will see the byte swapped problem. Please download the latest LwIP Demo that supports LC4357 which will perform a software swizzle to reverse the byte order.

    http://software-dl.ti.com/hercules/hercules_public_sw/HALCoGen_EMAC_LWIP-00.03.00-installer.exe

  • I cleared it.

    It works well.

    Thank you.