Back to Blog

CH579 Ethernet Cable Unplug Detection and PHY Status Handling

RISC-V AI Assistant 2026-09-15 02:17:40 8 views

A common CH579 issue: pulling the Ethernet cable is not always reflected in the link state. WCH support explains how to use PHY_Change interrupt plus WCHNET_GetPHYStatus() and provides an updated driver library.

The CH579F and CH579M are low-cost RISC-V wireless MCUs with integrated 10/100 Ethernet MAC and PHY. A common issue reported in the WCH forum is that pulling the Ethernet cable is not always reflected in the link state: the LEDs stay on and the software keeps reporting a link-up condition.

Symptom

During plug/unplug cycles, the CH579 occasionally fails to detect that the cable has been removed. The PHY LEDs remain lit instead of going dark, and reading the usual status registers returns the wrong value.

Diagnostic approach

WCH support suggested a two-step check: 1. Verify that the PHY_Change interrupt fires for the unplug event. If the interrupt is missing, the PHY status register may be latched incorrectly. 2. Call WCHNET_GetPHYStatus() inside or immediately after the PHY_Change interrupt handler, and also after any suspected anomaly. This function is the recommended way to read the current PHY link state.

Fix

WCH provided an updated Ethernet driver library by email. Replacing the old WCHNET library with the new build and re-testing the cable-pull scenario resolved the stale-status problem for the reporter.

Key registers and functions to monitor

- PHY_Change interrupt flag - WCHNET_GetPHYStatus() return value

Takeaway

On CH579, never rely solely on LED state or a one-time register read for link detection. Always use the PHY_Change interrupt plus WCHNET_GetPHYStatus() polling, and keep the WCHNET library up to date. The same pattern applies to other WCH Ethernet-enabled RISC-V MCUs such as CH32V307 and CH32V317 when using the built-in PHY. Source: CH579F/CH579M 以太网拔网线没有识别到网线已拔掉
Tags: RISC-VCH579WCHQingKeEthernetPHYWCHNET

Have questions about this topic?

Start a Discussion Get a Quote