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.

MSP432E411Y: Flash bootloader using MII

Part Number: MSP432E411Y

Hello,
I have been trying to port the Ethernet Flash bootloader demo project from the MSP432E401 Launchpad, to a custom board using MSP432E411 and external PHY via the MII bus.

I am confident that the new board is mostly working because I have ported a demo TI RTOS project to it, and had it perform DHCP setup.
Since the drivers supplied in the SDK appear to be hard coded to use the 401 internal PHY, I had to rebuild the library with a single line change in
C:\ti\simplelink_msp432e4_sdk_4_20_00_12_ext\source\ti\drivers\emac\EMACMSP432E4.c
#define EMAC_PHY_CONFIG (EMAC_PHY_TYPE_EXTERNAL_MII)
With this, the demo RTOS project sprung into life. Slight smile

The Flash Bootloader project seems to link the same library, but uses local versions of the setup functions.
bl_emac.c
void EnetReconfig(uint32_t ui32Clock)
calls
LOCAL_EMACPHYConfigSet(EMAC0_BASE, (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | EMAC_PHY_AN_100B_T_FULL_DUPLEX) );
instead of the library version EMACPHYConfigSet(...

I changed this in the same way as I changed the library - replaced the second argument with (EMAC_PHY_TYPE_EXTERNAL_MII)

It is a little hard to debug as the local version uses the ROM low level functions: ( e.g. ROM_EMACReset(EMAC0_BASE), ROM_SysCtlDelay(1000) )

It seems to not return from ROM_EMACReset().


Swapping this call for the non-ROM version as used by the library function - EMACReset(EMAC0_BASE); - I see that it sets the EMAC_DMABUSMOD_SWR bit in the EMAC_O_DMABUSMOD register, then waits for that bit to clear, which never happens.

I assume that the RTOS project has done some extra config step, missing from the Bootloader project, that allows the SWR action to complete after selecting external PHY.
I have tried comparing the state of all the peripheral registers (there are quite a few!) at the critical point, but I can't see any differences that look like they should affect this.

Any advice would be appreciated.

Thanks

  • Thanks for listening Slight smile

    I think explaining the problem made me see the solution!

    My RTOS project works because it calls a pin setup function - PinoutSet() in pinout.c. This was generated by the redundant pin mux tool, and sets up all the necessary pins as

    MII. e.g.

    //
    // Configure the GPIO Pin Mux for PP0
    // for EN0INTRN
    //
    MAP_GPIOPinConfigure(GPIO_PP0_EN0INTRN);
    GPIOPinTypeEthernetMII(GPIO_PORTP_BASE, GPIO_PIN_0);

    etc.

    Adding a similar call to the ported Flash bootloader made it all work.

    e.g.

    EnterBootLoader:
    .if $$defined(ENET_ENABLE_UPDATE)
    .ref PinoutSet
    bl PinoutSet
    .ref ConfigureEnet
    bl ConfigureEnet