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.

Controlling integrated Ethernet transceiver on TM4C129ENPCDT?

We have a need to control operation of the embedded Ethernet controller.  We'd like to control such parameters as rate, duplex mode, auto-negotiation, and so forth.

There must be a provision somewhere for changing its operational characteristics but I can't find where this is documented.  We are using TiRTOS version 2.00.01.23.

Related questions:

a) In our start-up code, it would be handy to read the Ethernet PHY registers and display some information, starting from address 0x400EC000.  I get an exception if I try to read this address in the boot code, but from task context (after calling BIOS_start()) I am able to read this address without an error.  Why?

b) Is there any way to unload the Ethernet driver after Board_initEMAC() is called?

c) If the driver cannot be unloaded, is there any way to pause or stop it?

d) I wrote some task-level code that attempts to read one of the extended PHY registers.  Using the steps outlined in the data sheet, I put the address of the register into the MIIADDR register and write a bit (with 0) telling the PHY that I want to read the specified extended register.  Then I read the MIIDATA register.  The code does not hang, but the value I always get is 0x786D.  From rereading the MIIADDR register, I see that the address I previosly wrote there has been overwritten with the address of Register 73: Ethernet PHY Basic Mode Status at offset 0x001 (and the value I read back from the MIIDATA register then makes sense).  Is this happening because the Ethernet driver is still running when I try to read the PHY registers?

-- Mike

  • Hello Mike,

    For (a) (b) and (c): The Ethernet PHY registers can be accessed only when the initialization is handled in the a specific sequence as give in the data sheet . Once the Ethernet link is established the PHY is not touched.
    For (d): is the debugger window open?

    Regards
    Amit
  • Hi Amit:

    Thanks. We have modified EMACSnow.c as needed for various versions of our boards, but it would be nice to be able to pause the driver, modify the PHY configuration in some way, and then to restart the driver. Maybe TI will support this in a future version.

    I think the reason (d) was happening was that I had not disabled interrupts when accessing the MIIADDR and MIIDATA registers, so the device driver was interrupting my code and writing another MII register's address. When I disabled interrupts and tried to read the MII registers, it worked okay.

    -- Mike
  • Hello Mike,

    My question to the modification of the PHY configuration, is that if the Link is established then why re-configure again?

    Regards
    Amit
  • We'd like to run the Ethernet in various modes: 10-BT/half and full, 100-BT half and full, plus we may want to force (or disable) auto-negotiation with the link partner.

    -- Mike
  • Hello Mike,

    In that case you would be changing the MAC settings as well. Why not simplify the solution, by resetting the MAC+PHY and re-init to ensure no HW settings remain stale during the change over.

    Regards
    Amit
  • Well, that's my issue, unless I misunderstand you.

    What I mean is that the driver is compiled with various settings such as PHY rate. For various reasons we'd like to have one firmware build that runs on several different custom boards, and that can be configured at run time to switch rates, duplex modes, and so forth. My current understand is that we have to manage multiple versions of EMACSnow.c to switch PHY and/or MAC parameters, and this defeats the goal of having one build.

    So is there another way to reset the 'MAC+PHY and re-init" to change parameters without flashing an image with a different EMACSnow.c compiled in?

    -- Mike
  • Hello Mike,

    I think we both ended up on the same point. Before I could answer that from a theoretical point of view, would like to know on how do you plan for the firmware to be able to detect which board will have what settings?

    Regards
    Amit
  • We have a custom FPGA that is compiled to include the board version. During initialization, I read the version information and would like to change various Ethernet parameters (such as the PHY rate) dynamically based on this version number, allowing us to use the same firmware on different hardware without recompiling EMACSnow.c.

    -- Mike
  • Hello Mike,

    Then it should be possible for the read of the FPGA to be used in a case statement for changing configurations rather than using defines with multiple binaries. Unfortunately, I am not very familiar with the RTOS implementation, but in the exanple code in TivaWare, the defines can be replaced by the case statements.

    Regards
    Amit