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: Used MSP432E401 on Custom Board, code hanging on EMACPHYConfigSet when initializing lwip

Part Number: MSP432E401Y

Hi,

I bought a new MSP432E401 from TI and placed it on a custom Board with a couple UART LINES and an Ethernet Post. I did not know you have to assign your own MAC Address so I used the one from the MSP432E401Y LaunchPad. ( used FlashGet) and then used FlashSet() on board with same uiUser0 and uiUser1 values). The Code Hangs in the  

SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_EPHY0))
{
//
// Wait for the PHY reset to complete.
//
}

 in the EMACPHYConfigSet(uint32_t ui32Base, uint32_t ui32Config) function. when I initialize LWIP. Below is the code I used to set the MAC Address. Is there something else im missing or another reason why my code is handing when resetting the internal PHY.

uint32_t ui32User0 = 7798640;
uint32_t ui32User1 = 6728988;
uint8_t pui8MACArray[8];


// FlashUserSet(ui32User0, ui32User1);
if((ui32User0 == 0xffffffff) || (ui32User1 == 0xffffffff))
{
//
// We ggggggggggggggggggggg/b /* n mmmjmjsd never get here. This is an error if the MAC address has
// not been programmed into the device. Exit the program.
// Let the user know there is no MAC address
//
//UARTprintf("No MAC programmed!\n");
while(1)
{
// TODO blink LEDs in an error pattern
}
}
// Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
// address needed to program the hardware registers, then program the MAC
// address into the Ethernet Controller registers.
// //
pui8MACArray[0] = ((ui32User0 >> 0) & 0xff);
pui8MACArray[1] = ((ui32User0 >> 8) & 0xff);
pui8MACArray[2] = ((ui32User0 >> 16) & 0xff);
pui8MACArray[3] = ((ui32User1 >> 0) & 0xff);
pui8MACArray[4] = ((ui32User1 >> 8) & 0xff);
pui8MACArray[5] = ((ui32User1 >> 16) & 0xff);

ip4_addr_t local;
ip4_addr_t netmask;
ip4_addr_t gateway;

IP4_ADDR(&local, 51, 2, 168, 192);
IP4_ADDR(&netmask, 0, 255, 255, 255);
IP4_ADDR(&gateway, 1, 2, 168, 192);

uint32_t g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_OSC_INT |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 25000000);

lwIPInit(g_ui32SysClock, macAddress, local.addr, netmask.addr, gateway.addr, IPADDR_USE_STATIC);  // code hangs while excuting this line, specifily in EMACPHYConfigSet(uint32_t ui32Base, uint32_t ui32Config);

  • I'm not much inclined to blame the MAC address, since as far as I know the PHY doesn't know anything about the MAC address. As a practical matter, you can program pretty much any value in the MAC address (at least until your SysAdmin comes and yells at you).

    This code is the first time the PHY has been probed for proper startup. I don't know exactly what would cause it to not start up, but my first guesses would be the clock (MOSC) or maybe something in the external wiring.

    Are you fairly certain your 25MHz crystal is running? 

    You referred to designing a (custom) "Ethernet Port". An Ethernet interface is much more than a few wires, and it's possible some failure in the external components might be visible to the PHY. Did you design the port using some reference design?

  • Hi, I referred to the MSP432 Launchpad for the schematic, I used ABLS7M2-25.000MHZ-D2Y-T as the crystal instead of NX3225GA-25.000M-STD-CRG-2 which is why the capacitor values are different.

  • I see where you start the clock, but I don't see where you

    > SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ);

    Are you doing this sometime (before lwIPInit())?

  • yeah I use 

    SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ); in the beginning of main, I do the clockfrequencyset in the beginning of main, just place the clock set to show how I set the clocks frequency.

    This is my ethernet wiring schematic, I followed System Design Guidelines for SimpleLink™ MSP432E4 Microcontrollers. The code works fine on the launchpad. Just not the custom board.

  • Hi, 

    If your code works well on EVM and NG on your own board, I would prefer to check the crystal on your board.