Skip to main content
Visitor II
February 27, 2020
Question

Ethernet link and activity LEDs on stm32mp157-dk2 board?

  • February 27, 2020
  • 8 replies
  • 2706 views

How can I make these LEDs work on stm32mp157-dk2 board? Ethernet interface is working fine, but both link and activity LEDs are always OFF. I need to have a visual confirmation that Ethernet has some TX/RX activity and thus need these LEDs working. Anyone got an idea?

-albertr

    This topic has been closed for replies.

    8 replies

    albertrAuthor
    Visitor II
    February 27, 2020

    I mean two LEDs on Ethernet connector on the board.... Is it limitation of the linux driver, or it needs to be enabled via device tree or some other parameters? Ethernet works fine otherwise.

    -albertr

    Visitor II
    February 27, 2020

    ​Hi Albertr,

    the two diods are integral part of the used connector - https://datasheet.lcsc.com/szlcsc/YDS-48F-01GYD2NL_C179766.pdf (from DK2 schematics).

    There's no link between them and device tree.

    I tried on two dk2 boards - yellow one always working.

    So it must be a hw issue on your board.

    BR,

    Milan

    albertrAuthor
    Visitor II
    February 27, 2020

    Here's the kernel boot messages I'm getting on this board related to the ethernet interface:

    [   1.518408] stm32-dwmac 5800a000.ethernet: PTP uses main clock

    [   1.522821] stm32-dwmac 5800a000.ethernet: no reset control found

    [   1.529012] stm32-dwmac 5800a000.ethernet: No phy clock provided...

    [   1.544024] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42

    [   1.549651] stm32-dwmac 5800a000.ethernet:  DWMAC4/5

    [   1.554527] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported

    [   1.561870] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported

    [   1.569183] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported

    [   1.576025] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported

    [   1.582316] stm32-dwmac 5800a000.ethernet: TSO supported

    [   1.587629] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer

    [   1.595442] stm32-dwmac 5800a000.ethernet: TSO feature enabled

    [  10.131928] Generic PHY stmmac-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)

    [  10.245763] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found

    [  10.300456] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported

    [  10.335022] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock

    [  69.677063] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

    ethtool identifies the driver as "st_gmac" thou:

    # ethtool -i eth0

    driver: st_gmac

    version: Jan_2016

    firmware-version:

    expansion-rom-version:

    bus-info:

    supports-statistics: yes

    supports-test: no

    supports-eeprom-access: no

    supports-register-dump: yes

    supports-priv-flags: no

    -albertr

    albertrAuthor
    Visitor II
    February 27, 2020

    Hi Milan,

    I'm not sure about hardware issues with my board, everything (including ethernet interface) seems to work fine.

    I've tried to find how these LEDs are being controlled, but didn't find anything in ethernet glue driver code.

    Do you happen to know which code is responsible to controlling these LEDs?

    -albertr

    Visitor II
    February 28, 2020

    ​Hi Albertr,

    in my kernel boot messages I see:

    [ 9.1322492] RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)

    Could you please first upgrade to the latest v1.2.0 and test again?

    BR,

    Milan

    albertrAuthor
    Visitor II
    February 28, 2020

    Hi Milan,

    So I see that your kernel is using a different PHY, mine is using the following:

    root@stm32mp1:~# dmesg | grep PHY   

    [  10.131928] Generic PHY stmmac-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)

    What is v1.2.0? Is it OpenSTLinux distribution version? I'm currently using the following:

    root@stm32mp1:~# cat /etc/os-release

    ID="openstlinux-weston"

    NAME="ST OpenSTLinux - Weston - (A Yocto Project Based Distro)"

    VERSION="2.6-snapshot-20191008 (thud)"

    VERSION_ID="2.6-snapshot-20191008"

    PRETTY_NAME="ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 2.6-snapshot-20191008 (thud)"

    Howver, it looks like I've just forgot to compile Realtek RTL8211F PHY driver, doh... I'll fix it and will let you know.

    root@stm32mp1:~# zcat /proc/config.gz | grep REALTEK_PHY     

    # CONFIG_REALTEK_PHY is not set

    Thanks,

    -albertr

    albertrAuthor
    Visitor II
    February 28, 2020

    Ah, found the software ver.1.2.0 on the following page:

    https://my.st.com/content/my_st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32-mpu-openstlinux-distribution/stm32mp1dev.license=1582900870004.product=Yocto_SDK.version=1.2.0.html

    I'm not even sure which release I'm currently running, the files are dated back to Sept 2019, it looks like the original filename I've downloaded was "en.SOURCES-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09.tar", so it's probably release 1.1.0?

    -albertr

    albertrAuthor
    Visitor II
    February 28, 2020

    Alright, I read the release notes, and it looks like I need to start using linux kernel built from1.2.0 sources, so I can use CubeMX ver.5.6.0 for device tree generation.

    -albertr

    albertrAuthor
    Visitor II
    March 1, 2020

    @mleo​ ,

    I have booted up a new kernel compiled with REALTEK_PHY driver from 1.2.0 software sources (2020-02-19).

    However, it didn't fix the problem for me, still both lights on Ethernet connector and not working.

    Can anyone please point me to the right direction on which software controls these LEDs?

    root@stm32mp1:~# dmesg | grep PHY

    kern :info : [Sun Mar 1 16:52:44 2020] RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)

    -albertr

    albertrAuthor
    Visitor II
    March 1, 2020

    I've just realized that stm32mp157-dk2 board on 1Gbit ethernet network will have both LEDs on RJ45 connector OFF by design ;) !

    So with 1Gbit connection it will turn ON small LED on the board located next to the RJ45 connector, and it will somewhat blink it on TX/RX activity. That's all.

    No wonder I missed it... Doh! So I guess it all works as designed on this board.

    If anyone knows of any possibility to control these LEDs on RJ45 connector instead, please let me know. Also, which software piece is controlling these LEDs?

    I would love to try to modify it to light up LEDs on RJ45 connector instead (one for link status, another for activity. Isn't it kinda standard?)

    -albertr

    albertrAuthor
    Visitor II
    March 2, 2020