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.
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 valueTakeaway
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 以太网拔网线没有识别到网线已拔掉