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.

correct NDK settings for clock period

Other Parts Discussed in Thread: CCSTUDIO, EK-TM4C1294XL, TM4C1294NCPDT

I running on a TM4C294NCPDT (rev A1) with TIRTOS 2.0.1.23.  I am having trouble getting consistent Ethernet stack behavior.  I get an IP sometimes and other times I get the ambiguous

Service Status: DHCPC    : Enabled  : Fault    : 002


I do get an IP some of the time, but the rest of the time I keep having to hit reset on the launchpad and hope it grabs and IP.

I am wondering if my clock settings are just not playing along.  Here are some of my CFG settings:

BIOS.heapSize = 20480;
BIOS.libType = BIOS.LibType_Custom;
Program.stack = 2048;

System.SupportProxy = SysMin;
Clock.tickPeriod = 50;
Ip.domainName = "rafaNet";
EMAC.libType = EMAC.LibType_NonInstrumented;
GPIO.libType = GPIO.LibType_NonInstrumented;
Global.IPv6 = false;
Task.idleTaskStackSize = 768;
Global.networkOpenHook = "&netOpenHook";
Global.stackLibType = Global.MIN;
Global.networkIPAddrHook = "&netIPHook";
Global.netSchedulerPri = Global.NC_PRIORITY_HIGH;
Global.lowTaskPriLevel = 3;
Global.normTaskPriLevel = 5;
Global.highTaskPriLevel = 7;
Global.kernTaskPriLevel = 9;
Global.ndkTickPeriod = 200;

I am running at 120Mhz and the Clock tick is set at 50 microseconds.

I have tried messing with the Global.ndkTickPeriod setting but I can't seem to get it right.  If I am reading the NDK User's Guide correctly, this should be 2000 since my clock tick is set to 50us?

But, a 2000 Global.ndkTickPeriod NEVER gets me an IP.  In fact the emac seems dead as soon as the lauchpad comes up.  Is there some other piece (code or setting)  that I am not setting up correctly or may be forgetting?

Thanks for the help.

  •  Hi, there is an hardware issue with ENET, to work properly you need apply some patch and as we discovered lower clock, to have reliable operation a 60-75MHz is the best, try yourself raising from 70 to where it is unreliable then reduce 5%.

     It is all in one thread I opened about network trouble. If you don't find it ask again.

  • hiowatha said:
    But, a 2000 Global.ndkTickPeriod NEVER gets me an IP. 

     here is the link in TIRTOS to solve issue of DHCP but also network forever down:

    http://e2e.ti.com/support/embedded/tirtos/f/355/t/337261.aspx

  • Thank you Roberto!

    That thread jumped to 1 thread then another (probably 6-7 other threads).  Not sure why I didn't see those.  Right now I am trying the suggestions on this wiki

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

    So far I got an IP 4/4 times... I will try it out the rest of the day to see if that helps things.  I am keeping my speed at 120Mhz for now (clock tick 50us, ndk clock period 2000), but I have a feeling I will end up doing as you suggested and just drop the speed down to  80 Mhz .

    What is really disconcerting is that any changes/tweaks  to your application can seem to "fix" things and all looks well for a couple of reboots/power offs, then all of a sudden it just wont get an IP for bunch of reboots.  So, you end up starting the cycle again, tweak code, reboot, chase ndk settings, reboot....and finally it works again.  Hopefully TI is on top of this.

    Thanks again.  Will come back and post my findings.

  • hiowatha said:
    What is really disconcerting is that any changes/tweaks  to your application can seem to "fix" things and all looks well for a couple of reboots/power offs, then all of a sudden it just wont get an IP for bunch of reboots.  So, you end up starting the cycle again, tweak code, reboot, chase ndk settings, reboot....and finally it works again.  Hopefully TI is on top of this.

     Hi, I just presented my prototype last week to a custom... I got a big nightmare but to do that in 10 day I raised my status from mastermind 9900 pts to the actual one hunting all bug of CCStudio and TM4c129 ENET too... I was ready on stellaris two year ago and this time I wish go to production still if chip has acceptable issue. SO as you see IT MUST WORK due I don't have another chance.

  • Just posting back based on what I have seen the past few days.  I am running on the EK-TM4C1294XL (tm4c1294ncpdt) launchpad.  I updated the TI-RTOS code with the workaround noted here:

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

    I then tried it with my original code settings: 120Mhz using clock tick of 50us and an NDK clock period of 2000.  It seemed to work, but eventually it failed after a day or two.  Same symptoms you read in other threads, it wouldn't grab an IP (basically ethernet stack doesn't come up correctly) even if I rebooted it a bunch of times.

    So as per suggestions from Roberto, I lowered the freqency to 100Mhz (leaving everything else the same (clock tick 50us and NDK clock period at 2000).  It has been 4 days without a single hiccup.  I have been hitting it with random reboots through out the past few days and have been getting an IP every time.   I hope it holds up.

    Thanks again for the help everyone.

  • I spoke too soon...I updated some code and I started get flakiness on the ethernet stack (not getting an IP) yesterday so I reduced the core to 79.5Mhz and I seem to be getting better results today.  Can someone from TI comment on this?  I am running on the TM4C1294XL launchpad.  I was expecting to lower the max frequency for this board (120Mhz) but this seems overkill.  Now I am having to run at < 80Mhz.  Is it the ethernet stack (NDK stuff) causing this or is it just this eval board?

    Thanks for the feedback.

  • hiowatha said:
    Now I am having to run at < 80Mhz.  Is it the ethernet stack (NDK stuff) causing this or is it just this eval board?

     I confirm you I lowered frequency to 75MHz to be sure have it working on demo. This hint come to me when I observed freertos demo was forever working fine and was faster than other demo setup lan.. Screen update where flaky and on inspection to code I got the caveat of it was running @60MHz...

     After that I am happy how it perform still at low speed, I wish finish work after stellaris failure. From 95 96 series the only missing peripheral is I2S but it can add (or not) when silicon is at mature level.

     This issue is work in progress and we need the next X silicon release or GA TM if solve this issue.

     Moving code or add some code change the maxfreq it can work reliably.