Breaking release — propagates the upstream esp_hal::ethernet::mac::LinkState shape + Speed::_10M/_100M renames through the mdio-phy feature re-exports. Final crate in the coordinated 0.3 release wave:
| Crate | Version |
|---|---|
eth-mdio-phy |
0.3.0 (publish FIRST) |
eth-phy-lan87xx |
0.3.0 |
eth-phy-lan867x |
0.2.0 |
esp-emac |
0.5.0 ← this release (publish LAST) |
Pre-1.0 SemVer caveat. Cargo's caret on
^0.4will not pick up0.5.x. Bump both digits explicitly.
Diff for review
- Previous tag:
v0.4.1—d316cee6ec - This release:
mainHEAD —4d81c0f6fa - Full diff: v0.4.1...main
Publish-order precondition
Both eth-mdio-phy 0.3.0 and eth-phy-lan87xx 0.3.0 must be on crates.io before publishing this release (the first is a registry dependency under the mdio-phy feature; the second is a dev-dependency exercised by the bundled embassy_net_lan8720a.rs example).
Why 0.5.0, not 0.4.2
Under the mdio-phy feature, esp-emac re-exports Speed and Duplex from eth_mdio_phy. The eth-mdio-phy 0.2 → 0.3 rename (Mbps10/100 → _10M/_100M, Option<LinkStatus> → LinkState { up, ... }) bleeds through these re-exports and breaks any downstream code that matches on esp_emac::Speed::Mbps100 etc. Cargo SemVer bumps the left-most non-zero component on any breaking change — pre-1.0 that's the minor.
Breaking — transitive eth-mdio-phy 0.3
- Bump dependency on
eth-mdio-phyto^0.3and dev-dependency oneth-phy-lan87xxto^0.3. Under themdio-phyfeature this crate re-exportsSpeedandDuplexfrometh_mdio_phy, so downstream consumers see the upstream renames:Speed::Mbps10/Speed::Mbps100→Speed::_10M/Speed::_100M(matchesesp_hal::ethernet::phy::Speedvariant naming).LinkStatus { speed, duplex }+Option<LinkStatus>signalling →LinkState { up: bool, speed, duplex }.- PHY drivers'
poll_linkreturn:Result<Option<LinkStatus>, _>→Result<LinkState, _>.
Speed and Duplex are #[non_exhaustive] in the trait crate (eth-mdio-phy) — any remaining match arms over them in downstream code must add a wildcard. LinkState is an open struct, so match/destructure patterns continue to work without ...
Breaking — defmt 1.0
Bump optional defmt dependency from ^0.3 to ^1.0. esp-hal 1.1.x and embassy-net 0.9.x already require defmt ^1.0.1; without this bump any downstream that enables the defmt feature on this crate alongside a current esp-hal / embassy-net release would end up with two defmt versions in its lock graph (defmt global-logger ABI is not version-compatible across 0.3 → 1.0 — real link error, not a noisy warning). Use sites are only defmt::Format derives and defmt::warn!(...) calls, source-compatible across the jump.
Migration
// before (0.4.x with eth-mdio-phy 0.2)
match phy.poll_link(mdio) {
Ok(Some(link)) => {
emac.set_speed(link.speed); // Speed::Mbps100
emac.set_duplex(link.duplex);
}
Ok(None) => { /* link down */ }
Err(e) => return Err(e.into()),
}
// after (0.5.0 with eth-mdio-phy 0.3)
match phy.poll_link(mdio) {
Ok(state) if state.up => {
emac.set_speed(state.speed); // Speed::_100M
emac.set_duplex(state.duplex);
}
Ok(_) => { /* link down */ }
Err(e) => return Err(e.into()),
}If your firmware copy-pasted the 0.4.x example pattern with use esp_emac::emac::{Duplex as EmacDuplex, Speed as EmacSpeed}; — drop both aliases. Under the mdio-phy feature esp_emac::Speed and Duplex are now the same type identity as eth_mdio_phy::Speed and Duplex, no conversion needed at the seam.
Changed
examples/embassy_net_lan8720a.rs: rewrite the PHY poll loop to use the newResult<LinkState, _>shape and drop thePhySpeed/PhyDuplexrename aliases.src/emac.rs: doc-comments and internal match arms updated to the_10M/_100Mvariant names.README.md: drop thePhySpeed/PhyDuplexalias-naming guidance; correct the HW checksum offload paragraph to reflect 0.4.1's engine-disable (it had still claimed "unconditional" from the 0.3.0 era).
Notes
- No source-level changes to the public
Emac/EmacDriverAPI surface beyond the transitive type renames above. - No behavioural diff observed on JXD-PM380-E1ETH bench vs 0.4.1 across TX/RX paths, DMA descriptor handling, link bring-up sequence, instrumentation. Wave-level smoke test: link UP
_100M Full, DHCP, iperf2 cycles complete.