Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: DP83826I, SYSCONFIG
Hello TI experts,
as we made a good progress in integrating the DP83826i in our software to use it on our own hardware problems, we experienced problems when using the PROFINET stack with ICSS-EMAC in MII mode (SDK version 08.03.00.18):
We tested the hardware with the enet_icssg_layer2 exmaple and everything seems to work. We also checked the correct behaviour of the PHY<->MII communication using our own firmware with Enet(ICSS) and lwip.
The next step was to test it with the PROFINET stack:

we used the same phy addresses and MII pin configuration than in our Enet(ICSS) + LWIP firmware but there was no sign of a working ethernet communication (we tried the DCP service + there where no LLDP frames sent by the device).
I digged a bit deeper and debugged the icss_emac.c:
- rxInterruptHandler() was called -> RX was working
- ICSS_EMAC_txPacket() was called -> RX & packet processing seems to be working but no transmission from the device was visible on Wireshark
I tried to check the behaviour on the EVM again, because I was sure every things was working fine on the EVM - and it was working as expected.
When I checked the Sysconfig of our EVM-based firmware I found out, that on that hardware target there was also "MII" configured, even if there should be a RGMII interface on that hardware.

This was confusing me so I checked the usage of the define ICSS_EMAC_MII_MODE in the ICSS-EMAC code and the follwing snippets in the icss_emac_local.c file Line 818ff & 881ff got my attention:
/* Need this change for tx pin swap in mii mode for AM64x, AM243x and AM263x only*/
if( (((ICSS_EMAC_Attrs *)icssEmacHandle->attrs)->phyToMacInterfaceMode == ICSS_EMAC_MII_MODE) && (((((ICSS_EMAC_Object *)icssEmacHandle->object)->icssRevision) == 0x103) || ((((ICSS_EMAC_Object *)icssEmacHandle->object)->icssRevision) == 0x203)) )
{
if(ICSS_EMAC_MODE_SWITCH == (((ICSS_EMAC_Attrs *)icssEmacHandle->attrs))->portMask)
{ /*Switch mode*/
HW_WR_FIELD32((pruicssHwAttrs->miiRtCfgRegBase) + CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0,
CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0_TX_MUX_SEL0, 0x0);
}
else
{
HW_WR_FIELD32((pruicssHwAttrs->miiRtCfgRegBase) + CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0,
CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0_TX_MUX_SEL0, 0x1);
}
}
else
{
if(ICSS_EMAC_MODE_SWITCH == (((ICSS_EMAC_Attrs *)icssEmacHandle->attrs))->portMask)
{ /*Switch mode*/
HW_WR_FIELD32((pruicssHwAttrs->miiRtCfgRegBase) + CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0,
CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0_TX_MUX_SEL0, 0x1);
}
else
{
HW_WR_FIELD32((pruicssHwAttrs->miiRtCfgRegBase) + CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0,
CSL_ICSS_PR1_MII_RT_PR1_MII_RT_CFG_TXCFG0_TX_MUX_SEL0, 0x0);
}
}
There was some special tx pin swap for mii mode implemented, which could be the cause of the problems. To check this, I reversed the first part of the if clause to check if the phyToMacInterfaceMode is ICSS_EMAC_RGMII_MODE and recompiled the icss_emac libraries.
After the changes I made Ethernet frames were sent as expected.
Could there be any misconfiguration on our side or is the if clause wrong in the SDK?
Best regards
Alex

