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.

MCU-PLUS-SDK-AM243X: DP83826E-driver does not set LED2 as needed.

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: DP83826E, DP83826I, AM2434

Hello,

we are using the MCU PLUS SDK 08.04.00.01.

On our board we have the DP83826-Ethernet Phy. We use the LEDs directly connected to the PHY: LED0 for Rx/Tx and LED2 for Link/100Mbit-signaling.
There is the DP83826E-driver available inside the SDK and I guess it's also usable for the DP83826-derivate.

So I tried setting it up like this:

                ETHPHY_DP83826E_LedSourceConfig ledConfig;
                ETHPHY_DP83826E_LedBlinkRateConfig_s ledBlinkConfig;
                /* ACT-LED */
                ledConfig.ledNum = ETHPHY_DP83826E_LED0;
                ledConfig.mode = ETHPHY_DP83826E_LED_MODE_LINK_OK_AND_BLINK_ON_RX_TX;
                ETHPHY_command(&ethPhyConfig_, ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig, sizeof(ledConfig));

                /* LK-LED */
                ledConfig.ledNum = ETHPHY_DP83826E_LED2;
                ledConfig.mode = ETHPHY_DP83826E_LED_MODE_SPEED_100BTX;
                ETHPHY_command(&ethPhyConfig_, ETHPHY_CMD_CONFIGURE_LED_SOURCE, (void *)&ledConfig, sizeof(ledConfig));

                ledBlinkConfig.rate = ETHPHY_DP83826E_LED_BLINK_RATE_200_MS;
                ETHPHY_command(&ethPhyConfig_, ETHPHY_CMD_CONFIGURE_LED_BLINK_RATE, (void *)&ledBlinkConfig, sizeof(ledBlinkConfig));

unfortunately the LED2 stays off. I also tried setting it to ETHPHY_DP83826E_LED_MODE_LINK_OK, but also no success.

I checked the driver-implementation and can't see why it should not work.

I then checked the data sheet and also I cannot identify the problem.

The driver seems to init the LEDCFG-register correctly and the LED2_GPIO_CFG (which is set to 0008h = LED2 as default anyway) too.

Then I tried setting the LEDCFG2 (0x469)-register directly to 0xFFFF to check if the PHY would work and we may have a problem in hw. but then suddenly the LED turns on. so the LED2_drv_val set to 1 works.

I am not sure if I need to configure something special additionally but the data sheet does not tell to take any more action neither does the criver inside the SDK provide any more options on this.

Could it also be that the PHY itself has a bug here?

Our new layout is based on this implementation and it is important that this one works correctly.

Best regards

Felix

  • HI Felix

    We have started looking into the issue.

  • Hi Felix,

    There is the DP83826E-driver available inside the SDK and I guess it's also usable for the DP83826-derivate.

    This assumption may not be correct as phy specific driver accesses phy specific register. Can you please take in initiative on getting driver for the particular phy you are using.

    Could you also mention which derivative of dp83826 phy are you using?

    BR

    Nilabh A.

  • Hi Nilabh,

    I just checked and the datasheet for both derivates are exactly the same. So there is only one data sheet for the 83826 at all: www.ti.com/.../DP83826E In the data sheet the different derivates are distinguished:

    We are not sure where to get the driver for the "without E"-derivate, but as said, the registers shall be the same all the way. We are using the DP83826I.

    Best regards

    Felix

  • HI Felix,

    What is the example here you are using this phy driver with? This phy driver can be used only with icss emac based examples. This driver will not be valid if used with enet based examples or Kunbus stack based examples as they are having their own implementation of the phy driver.

    BR

    Nilabh A.

  • Hey Nilabh,

    we do not use any example for it. We use it with icss-emac. This is used together with the pru-icss and the ethphy-drivers which then are used by a third-party stack (not Kunbus). Since we have access to the source code we checked if there is any additional phy-config done or anything but that's not the case. there are just some (not LED-related) phy-configs done for MDIX, full-duplex, autonegotiation and a check for the identity of the phy.
    This is done via the same driver-functions (MDIO_phyRegRead / MDIO_phyRegWrite).

    Best regards
    Felix

  • Hey Felix,

    In that case you can refer mcu_plus_sdk\examples\industrial_comms\ethercat_slave_beckhoff_ssc_demo\am263x-cc\tiescsoc.c which shows the usage of the same phy for ethercat example. You should be able to find any config you might be missing as this demo has successfully shown configuring this led.

    Let me know if you need any other info.

    BR

    Nilabh A.

  • Hello Nilhab,

    thanks. That was exactly the example I used to get my mentioned code in the first post. Is there something wrong with the code? I used the function tiesc_ethphyInit as reference.

    And we can for example configure the blink-rate for the activity led. Only the link/100MBits led on LED2 is not working.

    Best regards
    Felix

  • Okay, I have few questions here, which board are you using, is it am263x, if no then please ensure that the pin you are using is connected to the actual led. 

    I will try it on my end on am263 for which the driver was written to ensure there is nothing wrong with code or driver.

  • We use our own board with AM2434.
    I can just provide a snippet:

  • Can you please verify the above schematics if LED2 signal is mapped to actual led.

    Also Felix, please provide complete schematics for review. You can share it it in personal e2e message.

    BR

    Nilabh A.

  • So I rechecked the Datasheet.
    It states:

    So it is possible to configure the COL (in the schematic, Pin 28) to LED2.
    This is done via the registers.
    So our call to

    jumps to the driver to:

    to

    to

    and


    the ETHPHY_DP83826E_LED2_GPIO_CFG_REG has 0x0305 as value.
    Which is the correct register according to the datasheet:

    and phyRegVal is 0. So it must be LED2.

    In the same function the mode is configured, where ETHPHY_DP83826E_LEDCFG_LED2_SHIFT is 0x0008:


    according to the data sheet, everything is correct here:


    The data sheet does not mention to configure anything additional.

  • Hi Felix,

    I will get back once the review is done. Appreciate your patience.

  • Hi Felix,

    As we discussed in the weekly meeting yesterday, please put the documentation error you discovered for DP83826E here, so that we can inform the phy team to make the necessary changes. Thanks.

    Best regards,

    Ming

  • Hey Ming an Nilhab,

    so our colleague found out the following:

    If I read out the default values of the register LEDCFG from the DP83826E, I get 0b0110 0110 0101 back, but this is strange because only 3 nibbles are returned. According to the data sheet, the default value should look like this: 0b0101 0110 0110 0101.

    If I change it like this it works:


    So with the shifted bits we can set the LED2.

    Best regards

    Felix