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.

EMAC DHCP Still Not Working

Hello,

I am using the NDK and  EMAC driver on a Tiva TM4C1294XL.  I am having the same problems as everyone else -- the capture of the client ip address using initEMAC() is sporadic.  Sometimes it works, sometimes is does not.  I went through the steps outlined in a couple of other forums who are having the same problem.  The best fix of course is highlighted in the TI-RTOS TM4C129 Emac Issues Wiki,

http://processors.wiki.ti.com/index.php/TI-RTOS_TM4C129_Emac_Issues

Implementing this fix helped a lot.  My code went from almost never working to sporadic ip address capture.  However, even implementing the wiki fix has not totally fixed my code.  I saw in a couple of forums some users reported moving code around.  I did this and found that it often worked.  By moving my code around I could get the EMAC DHCP ip address capture to work.  However, this is a big time waster.  Just changing one line of code in some other module often would render a failure with the EMAC DHCP ip address capture.  It often takes several tries to get the right combination of moved modules.  I did find one relatively easy fix.  Just add more "Board_initEMAC()" to the front of your main code.  I have highlighted this below,

int main(Void)
{

    // Initialize the Hardware and setup device API's
    Board_initGeneral();
    Board_initGPIO();
    Board_initUSB(Board_USBDEVICE);
    Board_initEMAC();                 // If at first you don't succeed...
    Board_initEMAC();                 // try...
    Board_initEMAC();                 // try...
    Board_initEMAC();                 // try...
    Board_initEMAC();                 // and try again...Until it starts working...Crazy Hu?

    // Initialize push button drivers
    buttonInit();

    // Initialize USB Controller
    USBCDCD_init();

    // Set Up tcpcontrol thread parameters
    Task_Handle TcpControl;
    Task_Params TcpControlPm;

As crazy as it seems, whenever I add more code to my build and find that the initEMAC() does not work I just add another "Board_initEMAC()".  Although it gets the EMAC running I don't feel comfortable that this is a real fix ready to ship in a real product.

Dear TI software engineering...You really need to fix this.  I have been living with this for 2 months and it is an enormous time waster.  I can say I have spent weeks trying to get around this problem.  I can see many many other are having the same problem.  The Tiva community needs a fix fast...Please!!!!

Best Regards,

Steve Mansfield

  • Steve,

    Can check two things:

    1. Have a Wireshark capture the entire session. Make sure your PC is on the same network as the target. I want to see if there is a DHCP Discovery broadcast is happening.

    2. Halt the target and open Tools->ROV->EMAC. What is the #packets sent and received? Also are any packets dropped?

    Todd

  • Hello Todd,


    Sorry for the long time to response...I had a ton of code to write and get out the door.  I am still having erratic problems with getting a DHCP.  So I am now totally focused on fixing this problem.  When I load the code into flash I get a DHCP address about 50% of the time.  Once I get the first DHCP address and I reset the processor I get a next DHCP address about 90% of the time.  Here are the answers to your questions.

    WireShark

    When I get a good DHCP address I see the following WireShark packets;

       1.  DHCP Discover

       2.  DHCP Offer

       3.  DHCP Request

       4.  DHCP ACK

    This looks correct and matches the MAC address for my Tiva TM4C1294XL card.

    When I reset the processor and the card initiates a DHCP request (I can see the request in the console) and I get no DHCP address, I see absolutely no DHCP packets with wireshark.  I tried to capture on the MAC address like in the good sequence above.  I also try to trigger on the typical DHCP IP address with no luck.

    So with WireShark, when I get a DHCP address I see a correct exchange between the DHCP server and my Tiva card.  When I do not get a DHCP address I see no packets coming out of the Tiva Card.

    ROV --> EMAC

    I could not find a "#packets" category but under EMAC statistics I found the following when I did not get a good DHCP address and no WireShark packet capture activity

    nCount = 0

    nDropped = 0

    txSent = 4

    TxDropped = 2


    What else should I be looking at?


    Best Regards,

    Steve Mansfield

  • Hi Steve,

    What version of TI-RTOS are you using? Can you try the most recent: 2.01.00.03. You can get it here: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/index.html

    Todd

  • Hello Todd,

    Thanks for the quick reply.  I am running tirtos 2.00.02.06.  I will download the latest and see what happens.

    Best Regards,

    Steve Mansfield

  • Hello Todd,

    The latest TI RTOS 2.1.00.03 works!


    I loaded the latest TI RTOS 2.1.00.03.  Updated the project preferences.  I removed EMACSnow.c from my project directory.  If you recall, earlier fixes had us modify this file.  I also removed all of the extra Board_initEMAC() instructions to just to one.  If you recall I had added a number of extra Board_initEMAC() to get it to work sporadically.  After all of these changes it now works fine.  Thanks for your help.

    Best Regards,

    Steve Mansfield