Other Parts Discussed in Thread: AM2634, , DP83869, AMIC120
Dear TI team,
I designed a new board with AM2634 and two DP83826E(in/out).
Application of new board is based on EtherCAT example for control card form MCU+SDK am263x 8.6.00.34 with beckhoff ssc demo.
I modified this example for two DP83826E. Because this example using DP83869 and DP83826E for two EtherCAT port.
I performed some test using 'New Device' with Beckhoff devices.
Test case 1 is well working for 1 hour. But Test case 2 is something wrong.
Test case 2 is consist of one Beckhoff master and two 'New Device'(DuT #1, DuT #2).
Problem of test case 2 is that out port of DuT #1 does not maintain connection with the input port of DuT#2.
Sometime 'DuT #1' detect next device on the outport, sometime 'DuT #1' lost next device on the outport. This situation appears repeatedly.
When I change position between DuT#1 and DuT#2, exactly same problem occurred on first node output(DuT#2 out)
[Fig. 1. Test case 1 network configuration]
[Fig. 2. Test case 2 network configuration]
I confirmed this problem on the online view of 'TwinCAT2 SystemManager'. 'Fig. 3' is online view of test case 2.
[Fig. 3. TwinCAT online monitor of test case 2]
Here is initiation code of DP83826 for this application.
MCU+SDK am263x 8.6.00.34 has device driver for DP83826E.
So I just replace code for two DP83826E.
void tiesc_socParamsInit(bsp_params *bspInitParams) { bsp_params_init(bspInitParams); bspInitParams->pruicss_handle = pruIcss1Handle; bspInitParams->interrupt_offset = tiesc_getArmInterruptOffset(); bspInitParams->eeprom_read = tiesc_eepromRead; bspInitParams->eeprom_write = tiesc_eepromWrite; bspInitParams->spinlock_base_address = CSL_SPINLOCK0_BASE; bspInitParams->ethphy_init = tiesc_ethphyInit; bspInitParams->enhancedlink_enable = TIESC_MDIO_RX_LINK_ENABLE; bspInitParams->link0_polarity = TIESC_LINK0_POL; /*Polarity is high */ bspInitParams->link1_polarity = TIESC_LINK1_POL; /*Polarity is low */ bspInitParams->phy0_address = ((const ETHPHY_Attrs *)ETHPHY_getAttrs(CONFIG_ETHPHY0))->phyAddress; bspInitParams->phy1_address = ((const ETHPHY_Attrs *)ETHPHY_getAttrs(CONFIG_ETHPHY1))->phyAddress; bspInitParams->default_tiesc_eeprom = (const unsigned char *)(&(tiesc_eeprom)); bspInitParams->eeprom_pointer_for_stack = &(pEEPROM); } void tiesc_ethphyInit(PRUICSS_Handle pruIcssHandle, uint8_t phy0addr, uint8_t phy1addr, uint8_t enhancedlink_enable) { uint32_t mdioBaseAddress = ((const ETHPHY_Attrs *)ETHPHY_getAttrs(CONFIG_ETHPHY0))->mdioBaseAddress; ETHPHY_DP83826E_LedSourceConfig ledConfig0; ETHPHY_DP83826E_LedBlinkRateConfig ledBlinkConfig0; ETHPHY_DP83826E_FastLinkDownDetectionConfig fastLinkDownDetConfig0; ETHPHY_DP83826E_LedSourceConfig ledConfig1; ETHPHY_DP83826E_LedBlinkRateConfig ledBlinkConfig1; ETHPHY_DP83826E_FastLinkDownDetectionConfig fastLinkDownDetConfig1; ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_ENABLE_AUTO_MDIX, NULL, 0); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_ENABLE_AUTO_MDIX, NULL, 0); if(TIESC_MDIO_RX_LINK_ENABLE == enhancedlink_enable) { /*TODO: Review these 2 calls*/ ledConfig0.ledNum = ETHPHY_DP83826E_LED0; ledConfig0.mode = ETHPHY_DP83826E_LED_MODE_LINK_OK; ledConfig1.ledNum = ETHPHY_DP83826E_LED0; ledConfig1.mode = ETHPHY_DP83826E_LED_MODE_LINK_OK; ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig0, sizeof(ledConfig0)); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig1, sizeof(ledConfig1)); } /* Enable Extended Full-Duplex */ ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_ENABLE_EXTENDED_FD_ABILITY, NULL, 0); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_ENABLE_EXTENDED_FD_ABILITY, NULL, 0); /* Enable Odd Nibble Detection */ ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_ENABLE_ODD_NIBBLE_DETECTION, NULL, 0); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_ENABLE_ODD_NIBBLE_DETECTION, NULL, 0); /* Enable detection of RXERR during IDLE */ ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_ENABLE_ENHANCED_IPG_DETECTION, NULL, 0); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_ENABLE_ENHANCED_IPG_DETECTION, NULL, 0); /* PHY pin LED_0 as link for fast link detection */ ledConfig0.ledNum = ETHPHY_DP83826E_LED0; ledConfig0.mode = ETHPHY_DP83826E_LED_MODE_MII_LINK_100BT_FD; ledConfig1.ledNum = ETHPHY_DP83826E_LED0; ledConfig1.mode = ETHPHY_DP83826E_LED_MODE_MII_LINK_100BT_FD; //ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig0, sizeof(ledConfig0)); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig1, sizeof(ledConfig1)); /*For DP83286E, RX_ER is a separate pin (not an LED pin like DP83869E). Configuring LED_1 for 10M speed indication. */ ledConfig0.ledNum = ETHPHY_DP83826E_LED1; ledConfig0.mode = ETHPHY_DP83826E_LED_MODE_SPEED_10BT; ledConfig1.ledNum = ETHPHY_DP83826E_LED1; ledConfig1.mode = ETHPHY_DP83826E_LED_MODE_SPEED_10BT; ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig0, sizeof(ledConfig0)); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig1, sizeof(ledConfig1)); /* PHY pin LED_2 as Rx/Tx Activity */ ledConfig0.ledNum = ETHPHY_DP83826E_LED2; ledConfig0.mode = ETHPHY_DP83826E_LED_MODE_LINK_OK_AND_BLINK_ON_RX_TX; ledConfig1.ledNum = ETHPHY_DP83826E_LED2; ledConfig1.mode = ETHPHY_DP83826E_LED_MODE_LINK_OK_AND_BLINK_ON_RX_TX; ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig0, sizeof(ledConfig0)); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig1, sizeof(ledConfig1)); ledBlinkConfig0.rate = ETHPHY_DP83826E_LED_BLINK_RATE_200_MS; ledBlinkConfig1.rate = ETHPHY_DP83826E_LED_BLINK_RATE_200_MS; ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_CONFIGURE_LED_BLINK_RATE, (void *)&ledBlinkConfig0, sizeof(ledBlinkConfig0)); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_CONFIGURE_LED_BLINK_RATE, (void *)&ledBlinkConfig1, sizeof(ledBlinkConfig1)); /* Enable fast link drop detection for EtherCAT * Bit3: Drop the link based on RX Error count of the MII interface, when a predefined number * of 32 RX Error occurrences in a 10us interval is reached, the link will be dropped * Bit0(not enabled by following lines): Drop the link based on Signal/Energy loss indication, * when the Energy detector indicates Energy Loss, the link will be dropped. Typical reaction * time is 10us. If it needs to be enabled, set fastLinkDownDetConfig.mode as * (ETHPHY_DP83869_FAST_LINKDOWN_MODE_ENERGY_LOST | ETHPHY_DP83869_FAST_LINKDOWN_MODE_RX_ERR) */ fastLinkDownDetConfig0.mode = ETHPHY_DP83826E_FAST_LINKDOWN_MODE_RX_ERR; fastLinkDownDetConfig1.mode = ETHPHY_DP83826E_FAST_LINKDOWN_MODE_RX_ERR; ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_ENABLE_FAST_LINK_DOWN_DETECTION, (void *)&fastLinkDownDetConfig0, sizeof(fastLinkDownDetConfig0)); ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY1], ETHPHY_CMD_ENABLE_FAST_LINK_DOWN_DETECTION, (void *)&fastLinkDownDetConfig1, sizeof(fastLinkDownDetConfig1)); if(enhancedlink_enable == 0) { MDIO_enableLinkInterrupt(mdioBaseAddress, 0, phy0addr, MDIO_LINKSEL_MDIO_MODE); MDIO_enableLinkInterrupt(mdioBaseAddress, 1, phy1addr, MDIO_LINKSEL_MDIO_MODE); } else { MDIO_enableLinkInterrupt(mdioBaseAddress, 0, phy0addr, MDIO_LINKSEL_MLINK_MODE); MDIO_enableLinkInterrupt(mdioBaseAddress, 1, phy1addr, MDIO_LINKSEL_MLINK_MODE); } /* Enable MII mode for DP83869 PHY */ /* Operation mode of DP83826E is MII mode */ //ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_ENABLE_MII, NULL, 0); /* Disable 1G advertisement and sof-reset to restart auto-negotiation in case 1G link was establised */ /* But DP83826E is not use 1G by default */ //ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_DISABLE_1000M_ADVERTISEMENT, NULL, 0); //ETHPHY_command(gEthPhyHandle[CONFIG_ETHPHY0], ETHPHY_CMD_SOFT_RESTART, NULL, 0); }
Here is EtherCAT parts schemetic.
[Fig. 4 DP83826E]
[Fig. 5 Phy0, Phy1 Strap]
SMI Address |
Strap1 | Strap2 | Strap3 | Strap4 | Strap6 | |
Phy0 | 0x00 | Pullup | not connect | not connect | not connect | Pullup |
Phy1 | 0x01 | Pullip | Pullup | not connect | not connect | Pullup |
[Table. 1 Strap configuration for DP83826]
[Fig. 6 Magnetics and connector]
What is my mistake ? Could you please help me to solve this problem?