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.

Getting LwIP working on rm46 hdk

Other Parts Discussed in Thread: HALCOGEN

Please go easy on me as I am not very experienced. I am trying to run the code example for the LWIP web server on the rm46. It says it is for the rm48 so maybe that is the problem? Here is the output of my terminal after compiled and loaded onto the hdk. 

HERCULES MICROCONTROLLERS
Texas Instruments
Little Endian device
Initializing ethernet (DHCP)
DEBUG - Getting PHY ID....................................................................................................
..................................................................................................................................
..................................................................................................................................
..................................................................................................................................
..................................................................................................................................
..................................................................................................................................
..................................................................................................................................
..........................................

DEBUG - Getting PHY Alive Status...!!! ERROR !!!..DONE


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

Jeremy Spiller if you see this get in contact with me sellgrene@gmail.com thanks!

  • Hi,

    I have forwarded your request to our EMAC expert. They will get back to you shortly.

    - Hercules support

  • The problem was the ethernet dip switch, now I am getting stuck at this point? Any ideas?

    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 --------

  • Hello,

    When testing the LwiP demo software on some DHCP networks this kind of error scenarios have been observed.Can you test this on a different dhc p network and let us know whether the same behavior exists.

    also can you try to use the demo software for RM46 and run the webserver demo using it?

     

    Regards

    Manoj

     

    Manoj

  • Hello Manoj,

    I had the same problem. But I do not need a router. So I have replaced 

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

    ipAddr = lwIPInit(0, macAddress,inet_addr("2.0.168.192"), inet_addr("0.255.255.255"), inet_addr("1.0.168.192"), IPADDR_USE_STATIC);

    I have set IPv4 of my system to 192.168.0.1 

    When I run it, it displays all the steps, and success and also 

    HERCULES MICROCONTROLLERS
    Texas Instruments
    Little Endian device
    Device IP Address: 192.168.0.2
    Webserver accessible @ http:\\192.168.0.2

    But if i try to open the webpage 192.168.0.2, it says webpage not found. Both on google chrome as well as internet explorer. But getting pHY Link status is successful. Could you suggest any reason for this? 

    Upon debugging further, I observed that the EMACTxISR is called only once and not again. So is that an issue?

    Hope to hear from you soon,

    Thank you,

    Agraj

    PS: I have connected the PHY (8720ai) to the RJ45 port through port MAGnetics ic, HX1188 as shown on pg 42 of the 8720a datasheet. 

  • Additionaly in lwipopts.h:

    #define LWIP_DHCP                       0    /* Enable DHCP functionality */

    should be set to 0 to disable DHCP.

      BR,

  • Hello David,

    I have done that. There is no change. Is there any other change I need to do?

    When I try it with DHCP and a router, It says Setting up link.... success

    Done...

    ------Error Initializing Hardware----------

    I am just trying to get either of them to work.

    Agraj

  • Agraj,

    Even if there was a problem with DHCP, static IP ought to work. In the lwIPInit function  (in lwip/ports/hdk.lwiplib.c), put  a breakpoint in the following code to see if all of it is called:

         if((ipMode == IPADDR_USE_STATIC)
                    ||(ipMode == IPADDR_USE_AUTOIP))
         {
            /* Bring the interface up */
            netif_set_up(&hdkNetIF[instNum]);
         }

         ipAddrPtr = (unsigned int*)&(hdkNetIF[instNum].ip_addr);

         return (*ipAddrPtr);

    For this, as David mentioned, you should've blanked out the DHCP init code above this, by making LWIP_DHCP 0 in lwipopts.h.

    If this is done, it means the interface has been brought up. Also, the interrupt handlers should be called a lot more often, but since it was called at least once, we know interrupts are being generated. So I'd suggest you check the physical connection and also the network settings to make your system and the board can communicate.

    Let me know what happens.

    Thanks and Regards,

    Chaitanya.

    PS: There's also a updated version of the lwIP demo, integrated with HALCoGen v4.0 on the wiki.

  • Hello Chaithanya,

    I tried with the breakpoints. They get called only once, when it says "Setting up link..." once it says success. It is not called again. 

    Any suggestions why this may be?

    Thank you,

    Agraj

  • Agraj,

    The code that I posted above should be called only once. It's only the ISRs that are called multiple times.

    If this code is executed, Static IP ought to work. Could you check if the IP settings are fine? I can't think of any other reason if interrupts are enabled and the IP init is done.

    Thanks and Regards,

    Chaitanya

  • Hello Chaitanya,

    I am pretty sure the IP setting are fine as with the same setting it is working on the HDK. It is only on my custom board this is happening as i have explained in a previous post. About the interrupts, unlike in the HDK, the countEMACCore0TxIsr and  countEMACCore0RxIsr variables have a value of 1 the whole time whereas on the HDK, they keep increasing. Is this because of some interrupt issue? As far as I can see i have enabled all the interrupts necessary. I am attaching the .hcg file I have used for creating the project. Is there anything else I need to do about the interrupts themselves. 2043.EMAC_trial_new.zip

    Thank you

    Agraj