Hi,
I am using TM4C129ENCPDT microcontroller, and the integrated PHY supports 10Base-T and 100Base-TX signaling, full and half duplex, auto negotiating mode. I used the following configuration to initialize the ethernet successfully and its worked without any issue:
{
// Enable the ethernet peripheral.
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_EMAC0);
MAP_SysCtlPeripheralReset(SYSCTL_PERIPH_EMAC0); //Performs a software reset of a peripheral
// Enable the internal PHY if it's present and we're being
// asked to use it.
if((EMAC_PHY_CONFIG & EMAC_PHY_TYPE_MASK) == EMAC_PHY_TYPE_INTERNAL)
{
// We've been asked to configure for use with the internal
// PHY. Is it present?
if(MAP_SysCtlPeripheralPresent(SYSCTL_PERIPH_EPHY0))
{
//
// Yes - enable and reset it.
//
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_EPHY0);
MAP_SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0);
}
else
{
//
// Internal PHY is not present on this part so hang here.
//
while(1)
{
}
}
}
// Wait for the MAC to come out of reset.
while(!MAP_SysCtlPeripheralReady(SYSCTL_PERIPH_EMAC0))
{
}
// Configure for use with whichever PHY the user requires.
EMACPHYConfigSet(EMAC0_BASE, EMAC_PHY_CONFIG);
// Initialize the MAC and set the DMA mode.
MAP_EMACInit(EMAC0_BASE, ui32SysClkHz,
EMAC_BCONFIG_MIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED,
4, 4, 0);
// Set MAC configuration options.
MAP_EMACConfigSet(EMAC0_BASE, (EMAC_CONFIG_FULL_DUPLEX |
EMAC_CONFIG_CHECKSUM_OFFLOAD |
EMAC_CONFIG_7BYTE_PREAMBLE |
EMAC_CONFIG_IF_GAP_96BITS |
EMAC_CONFIG_USE_MACADDR0 |
EMAC_CONFIG_SA_FROM_DESCRIPTOR |
EMAC_CONFIG_BO_LIMIT_1024),
(EMAC_MODE_RX_STORE_FORWARD |
EMAC_MODE_TX_STORE_FORWARD |
EMAC_MODE_TX_THRESHOLD_64_BYTES |
EMAC_MODE_RX_THRESHOLD_64_BYTES), 0);
// Program the hardware with its MAC address (for filtering).
MAP_EMACAddrSet(EMAC0_BASE, 0, (uint8_t *)pui8MAC);
}
but I have problem when I tried to apply custom configuration like change speed mode during the program running, Could you please advice me with the correct sequence and functions to apply new configuration and change the ethernet speed and mode by EMACPC bits ANEN and ANMODE?
Regards,