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.

AM2434: DP83822 driver

Part Number: AM2434
Other Parts Discussed in Thread: DP83869, SYSCONFIG

If there is a DP83822 version of the driver located at mcu_plus_sdk/source/board/ethphy/icss_emac/ethphy_dp83869.c, we would appreciate it if you could provide it.
 
Our board implements DP83822 as the PHY. The sample program seems to assume DP83869. When running the CiA402 sample program, MDIO_phyRead() does not receive an ACK from the PHY. One possible cause is that the implemented PHY and the PHY configured in SysConfig are different.
We changed SYSCONFIG > ETHPHY(ICSS-EMAC) > CONFIG_ETHPHY0 > ETHPHY Device to CUSTOM and set Custom Device Name to DP83822, but the build failed.
We believe the reason is that ethphy_dp83822.c and ethphy_dp83822.h do not exist under mcu_plus_sdk/source/board/ethphy/icss_emac/.
If you have ethphy_dp83822.c and ethphy_dp83822.h, please provide them.
  • Hi Shimondome Ryo,

    Currently, we do not support the dp83822 PHY driver in the icss_emac options as part of SDK. But you can implement the corresponding version based on the available PHY driver for dp83822 in  mcu_plus_sdk/source/board/ethphy/enet/rtos_drivers/src/dp83822.c 

    Along with that, I would like to get a clarification on the following comment:

    The sample program seems to assume DP83869

    Does this mean during the PHY bring up, the DP83822 is being recognized as DP83869? If yes, then the driver binding is not properly handled. You would have to update the available PHY driver list with the corresponding part numbers and driver files available in the workspace.

    Please let us know if you need more support to enable this.

    Thanks and regards,
    Teja.

  • Dear Teja,

    Thank you for your message.

    I would appreciate it if you could kindly guide me through the steps to implement the corresponding version based on dp83822.c.

    Regarding my comment: “The sample program seems to assume DP83869,”
    I’d like to clarify that I am currently modifying the AM243x-LP ICSDK sample program to run on a custom board I designed.
    Since the AM243x-LP board includes the DP83869 PHY, the ICSDK is configured accordingly.
    However, my custom board uses the DP83822 PHY, so I would like to understand how to properly configure the ICSDK to support DP83822.

    Thank you again for your continued support.

    Best regards,
    Ryo Shimodome

  • Hi Ryo Shimodome,

    You can follow the guidelines given in the MCU PLUS SDK for the enet section to integrate Custom PHYs. The process required to link the drivers is same between ICSS-EMAC and ENET. You can find the resource in the following link.

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/custom_enetphy_guide.html

    You would have to port the driver to expose the same API functionalities as of the existing ethphy_dp83869.c in the new driver as well.

    Thanks and regards,
    Teja.

  • Please let me confirm the procedure. If there are any mistakes or missing steps, please point them out.

    • Edit ETHPHY (ICSS-EMAC) instead of ETHPHY (Enet CPSW/ICSS)

      • ETHPHY Device: CUSTOM
      • Custom Device Name: DP83822
    • Copy several files to the directory where main.c is located:

      • C:\ti\mcu_plus_sdk_am243x_11_01_00_17\source\board\ethphy\enet\rtos_drivers\src\dp83822.c
      • C:\ti\mcu_plus_sdk_am243x_11_01_00_17\source\board\ethphy\enet\rtos_drivers\src\dp83822_priv.h
      • C:\ti\mcu_plus_sdk_am243x_11_01_00_17\source\board\ethphy\enet\rtos_drivers\src\phy_common_priv.c
      • C:\ti\mcu_plus_sdk_am243x_11_01_00_17\source\board\ethphy\enet\rtos_drivers\src\phy_common_priv.h
      • C:\ti\mcu_plus_sdk_am243x_11_01_00_17\source\board\ethphy\enet\rtos_drivers\include\dp83822.h
      • C:\ti\mcu_plus_sdk_am243x_11_01_00_17\source\board\ethphy\enet\rtos_drivers\include\phy_common.h
    • Build using CCS

    Additional Information

    • The base sample program is the EtherCAT CiA402 sample from ICSDK.
    • When building, the following error occurs:
    undefined           first referenced
    symbol                 in file
    ---------           ----------------
    gEthPhyFxns_DP83822 ./syscfg/ti_board_open_close.o
  • Hi Ryo Shimodome,

    Please let me go through the details once more, and confirm the process. The documentation discusses about integration with MCU Plus SDK where the RTOS drivers are slightly differently maintained. Since this is a weekend, please allow me a couple of days to verify the changes required and update you in the same. 

    Thanks and regards,
    Teja.

  • Hi Ryo Shimodome,

    Please follow the steps below to start with enabling DP83822 support for ethphy:

    1. Edit ETHPHY (ICSS-EMAC) instead of ETHPHY (Enet CPSW/ICSS)

      • ETHPHY Device: CUSTOM
      • Custom Device Name: DP83822
    2. Make a copy of existing ethphy_dp83869/83826e drivers and rename the files and functions to dp83822
    3. Add the new C-file to the compilation in the make file: $(MCU_PLUS_SDK)/source/board/makefile.<platform>.<compiler>.<OS>
      (Ex: mcu_plus_sdk/source/board/makefile.am243x.r5f.ti-arm-clang.freertos)
    4. Update necessary macro definitions to the correct offsets of DP83822
    5. Update the corresponding functionalities of the APIs provided to fit with DP83822 and operate as expected.
    6. Clean and re-build the libraries
    7. Clean and rebuild the example

    With these steps, you should be able to enable the ethphy driver for DP83822 for emac driver. Please let us know if you have additional queries regarding this issue.

    Thanks and regards,
    Teja.

  • In addition to the steps you pointed out, I also performed the following:

    • Created CUST_PHY_dp83822.c and CUST_PHY_dp83822.h

    However, when running the EtherCAT CiA402 sample, it does not work properly:

    • The sub-device is not detected during scanning from the EtherCAT main device.
    • EC_SLV_APP_cia402Application() (the callback function registered with EC_API_SLV_CiA402_registerApplication()) is not called.

    Here are my questions:

    • Are ethphy_dp83822.c, CUST_PHY_dp83822.c, and CUST_PHY_dp83822.h provided?
    • Are there any other items that need to be configured in SysConfig?
    • Under what conditions is the callback function registered with EC_API_SLV_CiA402_registerApplication() called? (Packet reception?)
  • Hi Ryo Shimodome,

    Can you please check if the driver that you added is also made available as part of the available drivers in the ti_board_config.c? (Ex: gEnetPhyDrvs list)

    If not, then the PHY device would still use the generic PHY driver available as part of the list. Please ensure the generic driver is always the last entry in the list of available drivers.

    Regarding the issues with the EtherCAT application, I will assign this thread to the corresponding experts to help you with the problems.

    Thanks and regards,
    Teja.

  • I checked sysconfig/ti_board_config.c, but there is almost nothing written in it. The same goes for sysconfig/ti_board_config.h.

    ```

    ti_board_config.c

    #include "ti_board_config.h"

    /*
     * Auto generated file
     */

    void Board_init(void)
    {
    }

    void Board_deinit(void)
    {
    }

    ```

    ```

    ti_board_config.h

    /*
     * Auto generated file
     */

    #ifndef TI_BOARD_CONFIG_H
    #define TI_BOARD_CONFIG_H

    #include "ti_drivers_config.h"

    #ifdef __cplusplus
    extern "C" {
    #endif

    void Board_init(void);
    void Board_deinit(void);

    /*
     * EEPROM
     */
    #include <board/eeprom.h>

    /* EEPROM Instance Macros */
    #define CONFIG_EEPROM0 (0U)
    #define CONFIG_EEPROM_NUM_INSTANCES (1U)

    /*
     * FLASH
     */
    #include <board/flash.h>

    /* FLASH Instance Macros */
    #define CONFIG_FLASH0 (0U)
    #define CONFIG_FLASH_NUM_INSTANCES (1U)

    /*
     * LED
     */
    #include <board/led.h>

    /* LED Instance Macros */
    #define CONFIG_LED0 (0U)
    #define CONFIG_LED_STATUS (1U)
    #define CONFIG_LED_ERROR (2U)
    #define CONFIG_LED_NUM_INSTANCES (3U)

    /*
     * ETHPHY
     */
    #include <board/ethphy.h>
    /* ETHPHY specific include */

    /* ETHPHY Instance Macros */
    #define CONFIG_ETHPHY0 (0U)
    #define CONFIG_ETHPHY1 (1U)
    #define CONFIG_ETHPHY_NUM_INSTANCES (2U)


    #ifdef __cplusplus
    }
    #endif

    #endif /* TI_BOARD_CONFIG_H */

    ```

  • Hi,

    Please let me check with the industrial comms SDK, and get back to you on how to configure to use custom phy driver from sysconfig gui. This output looks different than the expectation. Can you please give some details on the SDK version that you are using? This will help in reproducing the issue and finding the right steps to unblock you further. 

    Thanks and regards,

    Teja

  • Sorry, the issue below has been resolved. 

    • The sub-device is not detected during scanning from the EtherCAT main device.
    • EC_SLV_APP_cia402Application() (the callback function registered with EC_API_SLV_CiA402_registerApplication()) is not called.

    The cause was the PHY LED0 configuration. I changed the bootstrap pin CRS from MODE2 to MODE4.
    MODE2: ON for Good Link, BLINK for TX/RX Activity
    MODE4: ON for Good Link, OFF for No Link

  • Sorry, the issue below has been resolved. 

    • The sub-device is not detected during scanning from the EtherCAT main device.
    • EC_SLV_APP_cia402Application() (the callback function registered with EC_API_SLV_CiA402_registerApplication()) is not called.

    The cause was the PHY LED0 configuration. I changed the bootstrap pin CRS from MODE2 to MODE4.
    MODE2: ON for Good Link, BLINK for TX/RX Activity
    MODE4: ON for Good Link, OFF for No Link

  • Hi,

    Thank you for the confirmation. Please let us know if you have any more queries further.

    Thanks and regards,
    Teja.

  • In the EtherCAT subdevice example for the AM243x-LP, the DP83869 driver is included, which uses the functions CUST_PHY_DP83869_readExtendedRegister() and CUST_PHY_DP83869_writeExtendedRegister(). Are equivalent functions required for the DP83822? Additionally, which extended registers must be properly configured for the DP83822?

    Thank you for your time. I have managed to resolve the matter myself.

  • Hi,

    Thank you for your update. Please let us know when you need any further clarifications.

    Thanks and regards,
    Teja.