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.

link 10 Mbit/s vs 100 Mbit/s

Other Parts Discussed in Thread: TMS320C6747

I get source code of ndk library and find the follow part of code in the file csl_emac.c:

if (localDev.Config.ModeFlags & EMAC_CONFIG_MODEFLG_RMII)
     CSL_FINST(EMAC_REGS->MACCONTROL, EMAC_MACCONTROL_RMIISPEED, 100MBIT);


if change from "100MBIT" to "10MBIT" and recompile source code, then all example work fine on the 10 MBit/s, but on 100 Mbit/s it does not link to Ethernet line (string "Link Status: 100Mb/s" is not appear ).

Why NDK work only one ethernet standard and do not reconnect, when it change? My be it is right, and I mast be choose one ethernet speed standard before programming?
How can I cause NDK relink, when I change the cable form 10 MBit/s to 100 MBit/s and inversely?

  • Hi Alexander,

    Which version of the NDK and BIOS are you using?

    The NDK should do this automatically. Can you give me some more details on your setup? Is the Ethernet cable connected to your board plugged into a switch or a router?  If so, and the router supports 100Mb connections, then I believe this is what the NDK will run at.

    Steve

  • O, I am sorry. I did mistake. My answer was not full.

    I am using follow software: CCS 4.2.1, NDK 2.20.0.19.

    I am using follow hardware: board on TMS320C6747 and PHY KSZ 8031RNL.

    I am compile all three NDK examples, and  their run fine, but only when I connect board to 100MBit/s device. I am using switch (COMPEX DS 2216). This is 16 port switch. All it ports adjust to 100 MBit/s full duplex.

    When I run example, then in console i see follow strings:

    MAC Address = 00-08-ee-03-14-99
    EMAC should be up and running
    EMAC has been started successfully
    Registeration of the EMAC Successful
    Link Status: 100Mb/s Full Duplex on PHY 0

    and all functionality of example work fine.

    But when i reconnect cable to old hub (Eline XZ850519T), then link fail. This hub may only 10 Mbit/s full/half duplex. If I rerun example, then string  "Link Status: 10Mb/s Full Duplex on PHY 0 " is not appear.

    I try to using many different hardware (switch and hub), but had same result.

     I already wrote at last message, but repeat: If change source code of NDK in follow place and recompile it

    "CSL_FINST(EMAC_REGS->MACCONTROL, EMAC_MACCONTROL_RMIISPEED, 100MBIT); " "100MBIT" change to  "10MBIT"

    then board connect to my old hub (Eline) and I may see the string "Link Status: 10Mb/s Half Duplex on PHY 0". But link fail with switch (COMPEX).

  • Hi Alexander,

    I'm looking into your issue and just wanted to update you.  I actually have an old hub here that runs at 10Mb.  So, I've tried to reproduce this problem, however using a different hardware platform (the evmOMAPL138).

    This is what I tried:

    setup:

    1Gb Ethernet Switch connected to network.

    evmOMAPL138 board connected to the 1Gb switch.

    10Mb hub connected to the 1Gb switch.

    Run the Client example.  It runs OK and gets an IP address from DHCP server and I am able to ping the board.  I see the "100Mb" output.

    Next I unplug the evmOMAPL138 Ethernet cable from the switch, and instead plug it into the hub.  The NDK detects that and outputs "10Mb" message and re-establishes the link.

    Again, I am able to ping the board.

    Am I doing this correctly? Or is it different than your method?

    Thanks,

    Steve

    P.S. Here is the output of the program:

    Using default MAC address
    Using MAC Address: 00-08-ee-03-14-99
    MAC Address = 00-08-ee-03-14-99
    EMAC should be up and running
    EMAC has been started successfully
    Registeration of the EMAC Successful
    Service Status: DHCPC    : Enabled  :          : 000
    Service Status: DHCPC    : Enabled  : Running  : 000
    Link Status: 100Mb/s Full Duplex on PHY 0
    Network Added: If-1:146.252.161.92
    Service Status: DHCPC    : Enabled  : Running  : 017
    Link Status: No Link on PHY 0
    Link Status: 10Mb/s Half Duplex on PHY 0

    -------------------------------------------------------------------------------

    1706 % ping 146.252.161.92
    PING 146.252.161.92 (146.252.161.92) 56(84) bytes of data.
    64 bytes from 146.252.161.92: icmp_seq=0 ttl=255 time=15.0 ms
    64 bytes from 146.252.161.92: icmp_seq=1 ttl=255 time=0.363 ms
    64 bytes from 146.252.161.92: icmp_seq=2 ttl=255 time=0.354 ms

    --- 146.252.161.92 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2004ms
    rtt min/avg/max/mdev = 0.354/5.264/15.076/6.938 ms, pipe 2
    1707 %

  • Yes, this correct method. I am try to use and "static IP" and "DHCP", but have same result.

    I think, I know what the problem is. At last time, in file "emacHooks.c" I comment follow string and forgot about that:

    //GPIO_CONTROL_REG = 0x00000000;
    //TIMER_GLOBAL_REG = 0x00000007;

    Maybe I mistake, but I think what timer is not work correctly, and  llTimerTick is not accomplished. But I don't know,  how this check.

    If I using above string, than "client" example write to the console follow string and nothing more happens:

    TCP/IP Stack Example Client
    Using default MAC address
    Using MAC Address: 00-08-ee-03-14-90
    MAC Address = 00-08-ee-03-14-90

    Whan I click to "halt " button, my JTAG fail, and follow message appear in console:

      C674X_0: Trouble Halting Target CPU: Error 0x00000020/-1202 Error during: Execution, CPU pipeline is stalled and the CPU is 'not ready'. This means that the CPU has performed an access which has not completed, and the CPU is waiting. The target may need to be reset. The user can choose 'Yes' to force the CPU to be 'ready'. When this is done, the user will have the ability to examine the target memory and registers to determine the cause of the CPU stall. If CPU hang is caused by application and it has been forced to be 'ready', the CPU should not be run without a reset.

    whats why I comment above string at last time.

     I don't understand what happens. In sprufm5d.pdf I read, what "Writes to most timer registers are not allowed when the timer is active". But I don't understand, why it happens.

     

    PS. I forgot to say, what if I unplug the cable from board, than string "Link Status: No Link on PHY 0"  is not appear.


  • Ok. I solved my problem. Realy, timer is not work correctly.

    Internally timer using AUXCLK. But in my board PHY using OBSCLK. Both AUXCLK and OBSCLK enable in CKEN regs. I am enable OBSCLK, but forgot about AUXCLK. That's why timer is not work.

    Since, I enabled   AUXCLK in CKEN,  ethernet link began working correctly (100 Mbit change to 10 Mbit and inverse ).

  • O, Thanks for your reply!

  • Hello, Steven. I have new problem from old theme. At last time I was happy too early.

    If I plug cable from my board to 10 Mbit device, but link fail (ping is absent). Both led indicator on my board connector and on hub port is active. In console a see following strings:

    TCP/IP Stack Example Client
    Using default MAC address
    Using MAC Address: 00-08-ee-03-14-77
    MAC Address = 00-08-ee-03-14-77
    EMAC should be up and running
    EMAC has been started successfully
    Registeration of the EMAC Successful
    Network Added: If-1:192.168.137.251
    Service Status: Telnet : Enabled : : 000
    Service Status: HTTP : Enabled : : 000
    Link Status: 10Mb/s Half Duplex on PHY 0

    ... if I unplugged cable from 10 MBit hub and plug it to 100 Mbit switch, then follow strings appear:

    Link Status: No Link on PHY 0
    Link Status: 100Mb/s Full Duplex on PHY 0

    ...and ping is Ok.

     

    Then, I tried to using DHCP, but link fail too.

    TCP/IP Stack Example Client
    Using default MAC address
    Using MAC Address: 00-08-ee-03-14-77
    MAC Address = 00-08-ee-03-14-77
    EMAC should be up and running
    EMAC has been started successfully
    Registeration of the EMAC Successful
    Service Status: DHCPC : Enabled : : 000
    Service Status: Telnet : Enabled : : 000
    Service Status: HTTP : Enabled : : 000
    Service Status: DHCPC : Enabled : Running : 000
    Link Status: 10Mb/s Half Duplex on PHY 0

    ...some time later...


    Service Status: DHCPC : Enabled : Fault : 002
    Service Status: DHCPC : Disabled : : 000
    Service Status: DHCPC : Enabled : : 000
    Service Status: DHCPC : Enabled : Running : 000

    ...and if I unplugged cable from 10 MBit hub and plug it to 100 Mbit switch, then follow strings appear:

    Link Status: No Link on PHY 0
    Link Status: 100Mb/s Full Duplex on PHY 0
    Network Added: If-1:192.168.137.65
    Service Status: DHCPC : Enabled : Running : 017

    and ping  192.168.137.65 work fine.

    If plug to 10 MBit, In sniffer ("Wireshark") I don't see any activity from my board. It does not respond even to ARP request.

    I don't know, what happens. All string on console is correct, all led indicators is active. I don't change "client" example code, or NDK source code.