Skip to content

v0.5.0

Latest

Choose a tag to compare

@adeepn adeepn released this 09 Jun 14:47
4d81c0f

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.4 will not pick up 0.5.x. Bump both digits explicitly.

Diff for review

  • Previous tag: v0.4.1d316cee6ec
  • This release: main HEAD — 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-phy to ^0.3 and dev-dependency on eth-phy-lan87xx to ^0.3. Under the mdio-phy feature this crate re-exports Speed and Duplex from eth_mdio_phy, so downstream consumers see the upstream renames:
    • Speed::Mbps10 / Speed::Mbps100Speed::_10M / Speed::_100M (matches esp_hal::ethernet::phy::Speed variant naming).
    • LinkStatus { speed, duplex } + Option<LinkStatus> signalling → LinkState { up: bool, speed, duplex }.
    • PHY drivers' poll_link return: 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 new Result<LinkState, _> shape and drop the PhySpeed / PhyDuplex rename aliases.
  • src/emac.rs: doc-comments and internal match arms updated to the _10M / _100M variant names.
  • README.md: drop the PhySpeed / PhyDuplex alias-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 / EmacDriver API 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.

Full changelog