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.

TMS320F28384S: How to use LWIP network communication demo "Ethernet_ C28x_ config" to change to rmii interface

Part Number: TMS320F28384S
Other Parts Discussed in Thread: C2000WARE

hello, I am using 28388s to develop network functions,

Using Ethernet_ C28x_ config demo  from C2000ware to modify my project,

According to the TRM manual, and ensure that the hardware is working properly.

then configuring Device Pins to rmii function selected external clock for RMII Mode Clocking

program the PHY_INTF_SEL field in the EMACSS_CTRLSTS register to rmii function,

at last, compile the project and burn .out file to flash,

I use a network cable to connect the PC and target board, and use ping in the CMD command window to check if the connection is normal,

found that no response.

Please help me to find the question, thank you!

  • Hi, 

    Which development board are you trying it on? 

    For RMII mode operation, the module needs a 50-MHz clock. It can be sourced internally or can be sourced externally .

    Also, the ethernet PHY has to be configured in RMII mode. This configuration has to be done in the PHY registers.

    Best Regards

    Siddharth. 

  • This is C2000ware's ethernet_c28x_config project, configure Device Pins to rmii function, Download to CPU1 to run

    #ifdef ETHERNET
    //
    // Set up EnetCLK to use SYSPLL as the clock source and set the
    // clock divider to 2.
    //
    // This way we ensure that the PTP clock is 100 MHz. Note that this value
    // is not automatically/dynamically known to the CM core and hence it needs
    // to be made available to the CM side code beforehand.
    SysCtl_setEnetClk(SYSCTL_ENETCLKOUT_DIV_2, SYSCTL_SOURCE_SYSPLL);

    //
    // Configure the GPIOs for ETHERNET.
    //

    //
    // MDIO Signals
    //
    GPIO_setPinConfig(GPIO_42_ENET_MDIO_CLK);//
    GPIO_setPinConfig(GPIO_43_ENET_MDIO_DATA);//

    //
    // Use this only for RMII Mode
    GPIO_setPinConfig(GPIO_73_ENET_RMII_CLK);//
    //

    //
    //MII Signals
    //
    // GPIO_setPinConfig(GPIO_109_ENET_MII_CRS);
    // GPIO_setPinConfig(GPIO_110_ENET_MII_COL);

    GPIO_setPinConfig(GPIO_75_ENET_MII_TX_DATA0);//
    GPIO_setPinConfig(GPIO_74_ENET_MII_TX_DATA1);//
    // GPIO_setPinConfig(GPIO_123_ENET_MII_TX_DATA2);
    // GPIO_setPinConfig(GPIO_124_ENET_MII_TX_DATA3);

    //
    //Use this only if the TX Error pin has to be connected
    //GPIO_setPinConfig(GPIO_46_ENET_MII_TX_ERR);
    //

    GPIO_setPinConfig(GPIO_69_ENET_MII_TX_EN);//

    GPIO_setPinConfig(GPIO_71_ENET_MII_RX_DATA0);//
    GPIO_setPinConfig(GPIO_72_ENET_MII_RX_DATA1);//
    // GPIO_setPinConfig(GPIO_116_ENET_MII_RX_DATA2);
    // GPIO_setPinConfig(GPIO_117_ENET_MII_RX_DATA3);
    GPIO_setPinConfig(GPIO_76_ENET_MII_RX_ERR);
    GPIO_setPinConfig(GPIO_70_ENET_MII_RX_DV);//

    // GPIO_setPinConfig(GPIO_44_ENET_MII_TX_CLK);
    // GPIO_setPinConfig(GPIO_111_ENET_MII_RX_CLK);

    //
    //Power down pin to bring the external PHY out of Power down
    //
    // GPIO_setDirectionMode(108, GPIO_DIR_MODE_OUT);
    // GPIO_setPadConfig(108, GPIO_PIN_TYPE_PULLUP);
    // GPIO_writePin(108,1);//Hardware pull-up, no electrical connection

    //
    //PHY Reset Pin to be driven High to bring external PHY out of Reset
    //

    // GPIO_setDirectionMode(119, GPIO_DIR_MODE_OUT);
    // GPIO_setPadConfig(119, GPIO_PIN_TYPE_PULLUP);
    // GPIO_writePin(119,1);//Hardware pull-up, no electrical connection
    #endif

    This is C2000ware's enet_lwip project, configure ip address, change EMACSS_CTRLSTS register to rmii function, selecte external clock for RMII Mode Clocking, Download to CM to run

    //
    // User specific IP Address Configuration.
    // Current implementation works with Static IP address only.
    //
    unsigned long IPAddr = 0xC0A80004;   //IP:192.168.0.4
    unsigned long NetMask = 0xFFFFFF00;
    unsigned long GWAddr = 0x00000000;

    ....

    void
    Ethernet_init(const unsigned char *mac)
    {
    Ethernet_InitInterfaceConfig initInterfaceConfig;
    uint32_t macLower;
    uint32_t macHigher;
    uint8_t *temp;

    initInterfaceConfig.ssbase = EMAC_SS_BASE;
    initInterfaceConfig.enet_base = EMAC_BASE;
    initInterfaceConfig.phyMode = ETHERNET_SS_PHY_INTF_SEL_RMII;

    initInterfaceConfig.clockSel = ETHERNET_SS_CLK_SRC_EXTERNAL;

    //
    // Assign SoC specific functions for Enabling,Disabling interrupts
    // and for enabling the Peripheral at system level
    //
    initInterfaceConfig.ptrPlatformInterruptDisable =
    &Platform_disableInterrupt;
    initInterfaceConfig.ptrPlatformInterruptEnable =
    &Platform_enableInterrupt;
    initInterfaceConfig.ptrPlatformPeripheralEnable =
    &Platform_enablePeripheral;
    initInterfaceConfig.ptrPlatformPeripheralReset =
    &Platform_resetPeripheral;

  • Hello!

        my hardware board is developed according to TMDSCNCD28388D, CPU replaced with 28384s ,the  PHY chip used LAN8720 Ethernet module, like below picture.

    my program is developed on the basis of C2000ware, As shown in the reply below.

  • Hi,

    The changes look good for the ethernet on the device. Pls  check if there is any configuration required for the LAN8720 PHY for RMII

    Best Regards

    Siddharth