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.

LWIP on DRV8301-LS12 not working

Other Parts Discussed in Thread: HALCOGEN

Hello,

I'm having trouble getting the lwIP demonstration to work on the DRV8301-LS12-KIT. I have tried both version 2 and 3 of lwIP. The supplied source code compiles and loads into the board, and gets as far as "Setting Up Link"....SUCCESS, but no further. I verified my DHCP server is working with same cable and another computer. I then applied the patch to version 3, but it didn't get any farther. BTW - applying the patch to version 3 led to 2 compile errors with the ls12: PHY_LINK_PARTNER_SPD undefined and undefined symbol on Dp83640PartnerSpdGet(). Both easily fixed.

I also tried configuring the version 3 lwip(both patched and unpatched) for static IP, and I get as far as "Webserver accessible @ http:\\192.168.2.44" in both cases, but I cannot connect to the webserver from any of my computers. (I also cannot ping that address, FYI).  I have no problem with same cable pinging between my computers - both of which are configured with static IP's for this test, and all firewalls and anti-virus programs turned off.

I do see the lwip documentation mentions setting a DIP switch on the control card, but the TMS570LS12CNCD control card documentation does not mention that any of the dip switches have anything to do with Ethernet.

So, at this point, I am at a standstill, and need some direction.

Thanks,

Chuck

  • Hi Chuck,
    The DIP switch mentioned is for the HDK board not the CNCD board.

    I'm not an expert in Ethernet but I have done some research on the forum to see if anyone having the same issue. There is a possibility that the RMIISPEED bit in the MACCONTROL register is not set. Can you please check if RMIISPEED bit is set or not?
  • Hi Chuck,

    There is also the below post that I hope you will find helpful. There is an RM46CNCD version of the LwIP demo embedded in the post. You will need to rebuild it for LS12. The RM46 is the same chip as LS12 but it operates in little endianism as opposed to the big endianism for LS12.

    e2e.ti.com/.../536612
  • Thanks for the suggestions. I verified that using version 2.0 of the lwIP release, the RMIISPEED was NOT set. I added the code to set it, and verified that it is now getting set, but still no communications. I then looked at the same bit with the version 3.0 lwIP, and the bit was set there (possibly due to the recommended patch I had applied earlier). In neither case do I hit a breakpoint at either interrupt: EMACTxIntISR() nor EMACRxIntISR(). I do see the yellow LED flash on the RJ-45 connector on the board when I try to hit the IP address of the board...but no breakpoint on the ISR. Although I have checked the cable I am using with other computers, does it need to be a crossover cable to work with this board? Any other ideas?

    Thanks,

    Chuck
  • Chuck,

    When you set the static IP address is it on the same subnet as your PC?

    (i.e. what is your PC's IP address, usually it would also need to be 192.168.2.xx to talk to the board.)

    You shouldn't need a crossover cable. The PHY can automatically swap tx/rx for you if it needs to.

    -Anthony
  • Hi Anthony - I am doing most of my testing now with static IP instead of messing with DHCP, it seems one less thing to worry about. On the PC, my static IP Is 192.168.2.45. The board has static IP 192.168.2.44. I left default gateway blank on the PC.

    Also, after looking at the VIM setup, I realized my breakpoints may not have been on the right ISR's, so I added breakpoints at EMACCore0RxIsr() and EMACCore0TxIsr() in lwip_main.c, and still not hitting the Rx interrupt, although the yellow Rx/Tx LED flashes when I try to reach 192.168.2.44 with the brower, or if I ping it. I do hit the Tx interrupt one time during or just after initialization.

    Thanks,

    Chuck
  • Hi Chuck,

    Maybe you can do a 'DIFF' against the RM46 file that Charles listed above.

    I *just* did this recently to test and it was working and the RM46 control card is basically the same card as the LS012 .. the main differences being in a few extra peripherals on the RM46 that don't matter for this example [USB device & host] and also that TMS570 is big endian.

    So a DIFF of the two folders would maybe show a critical issue.

    I always use a program like "Meld" which can diff a whole directory against another directory and that helps pinpoint small differences.

    I think unless you've got some really aggressive firewall setup you are going to be fine with pinging 192.168.2.44 from 192.168.2.45... Sometimes though if your PC address is completely different like 10.x.x.x there are issues talking to each other.

    -Anthony
  • Hi Anthony - that was a good suggestion. Nothing leaped out in terms of differences, but I did catch that the source code supplied for the Lwip demonstration for the TMS570ls12 has loopback mode enabled ( #define EMAC_LOOPBACK_ENABLE 1U) in emac.h. I changed this to 0, but no change in symptom. I did use Wireshark to verify I am sending out frames over the Ethernet cable to the board - although I was pretty sure that was the case anyway, as the yellow LED blinks on the RJ45 on the board whenever I try to hit the static IP address of the board. I then tried building the HALCoGen EMAC Loopback example, and that works on the board. I can hit the Rx Interrupt handler when that runs. I then did a diff of the EMAC registers setup by that source and the registers as setup by the Lwip demonstration, and the only 3 register differences were as follows:
    Loopback Source lWIP Source
    MACCONTROL 0x0023 0x8021
    BOFFTEST 0x03E40000 0x03380000
    USERACCESS0 0x20A1C1E1 0x22014115

    So at this point, I am quite puzzled, and would greatly appreciate any other suggestions.

    Chuck