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.

MSP432E401Y: Disabling Auto-negotiation and force 100Base-TX, Full-duplex

Part Number: MSP432E401Y


Hi,

My customer is using MSP432E401Y and trying to configure EMAC and PHY for 100Base-TX, Full-Duplex (Forced Mode).
He refers below URL:
http://software-dl.ti.com/simplelink/esd/simplelink_msp432e4_sdk/1.60.00.10/docs/driverlib/msp432e4/html/group__emac__api.html#ga6f369bdbe2e8ea108ef1398242030198

And used below codes:

Int main(void)
{
    /*PHY Initialize*/
        // Enable and reset the MAC.
         SysCtlPeripheralEnable(SYSCTL_PERIPH_EMAC0);
         SysCtlPeripheralReset(SYSCTL_PERIPH_EMAC0);

        // Enable and reset the internal PHY.
         SysCtlPeripheralEnable(SYSCTL_PERIPH_EPHY0);
         SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0);

         // Set the PHY type and configuration options.
         EMACPHYConfigSet(EMAC0_BASE,(EMAC_PHY_FORCE_100B_T_FULL_DUPLEX | EMAC_PHY_INT_ROBUST_MDIX | EMAC_PHY_INT_MDIX_EN));

//        EMACPHYWrite(EMAC0_BASE, 0x00, EPHY_BMCR, EPHY_BMCR_DUPLEXM | EPHY_BMCR_SPEED);

        // init EMAC
        EMACInit(EMAC0_BASE, 0x3938700, (EMAC_BCONFIG_FIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED), 1, 1, 0);
        // configure EMAC
       EMACConfigSet(EMAC0_BASE, (EMAC_CONFIG_100MBPS | EMAC_CONFIG_FULL_DUPLEX | EMAC_CONFIG_CHECKSUM_OFFLOAD | EMAC_CONFIG_USE_MACADDR0 | EMAC_CONFIG_STRIP_CRC),
                      (EMAC_MODE_RX_STORE_FORWARD | EMAC_MODE_TX_STORE_FORWARD | EMAC_MODE_RX_FLUSH_DISABLE), 0);

        /* Call driver init functions */
        Board_init();


But it does not work and Ethernet works as Auto-negotiation.

Development environments:
CCS
TI-RTOS
MSP432E401Y LaunchPad
PHY: Internal

What is potential issue here?

Thanks and regards,
Koichiro Tashiro

  • Hi Tashiro-san, I checked the key word "EMACPHYConfigSet" API on E2E, there is the previous thread have the similar issue. according to this thread discussion, on H/W, please you please consider refering the System Design Guidelines to ensure that there are no hardware issues. on S/W, please try to use SDK: http://dev.ti.com/tirex/explore/node?node=AFrVBkyAqdpNLs83C5MQwA__J4.hfJy__LATEST. Thanks!

  • Hi Xiaodong,

    Thanks for your reply.

    Customer uses TI LaunchPad and internal PHY, so H/W should be no issue.
    For S/W, do we have example code which configures 100Base-TX, Full-Duplex (Forced Mode) in SDK?
    The URL you provided does not exist.

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashiro-san

    I check the MSP432E4-SDK information. So far, I haven't found the answer on "do we have example code which configures 100Base-TX, Full-Duplex (Forced Mode) in SDK?". I will check with software team.

  • Hi Kohichiro

    Checked with the expert of SDK.

    We don’t have the code example to demonstrate 100Base-TX, Full-Duplex. but we can use the example of LwIP provided on SDK.

    Please install the MSP432E4 SDK. The SimpleLink MSP432E4 SDK (for MSP432E4 MCUs) comes with lwIP TCP/IP stack (./source/third_party/lwip) and examples (./examples/nortos/MSP_EXP432E401Y/lwip/). Please use one of the lwIP examples and update the PHY configuration as below in lwiopts.h file of the example. Then connect the E4 to an Ethernet switch that supports only 100 Base-TX, Full-Duplex.

    EMAC_PHY_CONFIG (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | EMAC_PHY_FORCE_100B_T_FULL_DUPLEX)

    Hope this helps!

  • Hi Xiaodoing,

    Thanks for your reply.
    Customer tried to modify LwIP sample code and confirmed below change works.

    EMAC_PHY_CONFIG (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | EMAC_PHY_FORCE_100B_T_FULL_DUPLEX)


    So the root cause is software configuration. As customer is using TI-RTOS, the LwIP sample code cannot be used as is.
    Are there specific rules user need to follow when TI-RTOS + driverlib are used ?
    For example, suppose updecho example is used;
    \simplelink_msp432e4_sdk_3_40_00_08/examples/rtos/MSP_EXP432E401Y/ns/udpecho
    Where below code should be placed?
    EMAC_PHY_CONFIG (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | EMAC_PHY_FORCE_100B_T_FULL_DUPLEX)

    Thanks and regards,
    Koichiro Tashiro

  • Adding answers provided offline.

    ============================================
    They need to modify the following line in <SL SDK>\source\ti\drivers\emac\EMACMSP432E4.c

    #define EMAC_PHY_CONFIG         (EMAC_PHY_TYPE_INTERNAL |                     \
                                     EMAC_PHY_INT_MDIX_EN |                       \
                                     EMAC_PHY_AN_100B_T_FULL_DUPLEX)

    to

    #define EMAC_PHY_CONFIG         (EMAC_PHY_TYPE_INTERNAL |                     \
                                     EMAC_PHY_INT_MDIX_EN |                       \
                                     EMAC_PHY_FORCE_100B_T_FULL_DUPLEX)

    They can modify the file in place and then rebuild the driver library (as described in the “Rebuilding Drivers” section in the SDK User Guide). Another option (and initially easier) is to simply add this file into the project, make the change, and then rebuild the application. The local copy will be used instead of the SDK’s version.
    ============================================

    and

    ============================================
    I got the “force” to work. I add the EMACMSP432E4.c file into the TCP Echo example and made the following changes to it:

    1. Add #define __MSP432E401Y__ before the #includes. I expect this was causing the build error.
    2. Change to address from 1 to 0

    #define PHY_PHYS_ADDR 0

    1. Change to FORCE

    #define EMAC_PHY_CONFIG      (EMAC_PHY_TYPE_INTERNAL |                     \

                                     EMAC_PHY_INT_MDIX_EN |                       \

                                     EMAC_PHY_FORCE_100B_T_FULL_DUPLEX)

     

    Making these changes I was able to obtain an IP address. Can you try that out?

    ============================================

**Attention** This is a public forum