esp-emac 0.2.0
First public release of esp-emac on crates.io. Bundled with eth-mdio-phy 0.2.0, eth-phy-lan87xx 0.2.0, and eth-phy-lan867x 0.1.0.
Pre-flight:
eth-mdio-phy 0.2.0must already be on crates.io before this release publishes —cargo publishwill pull the registry copy of that trait crate during--verify. Publish in this order:eth-mdio-phy→eth-phy-lan87xx→eth-phy-lan867x→esp-emac.
Breaking
SpeedandDuplexare now re-exports ofeth_mdio_phy::{Speed, Duplex}(gated by featuremdio-phy) rather than locally defined enums withFrom<eth_mdio_phy::*>conversions. Call sites that used to writeemac.set_speed(status.speed.into())drop the.into()— the types are literally the same now. Without themdio-phyfeature the symbols are no longer exposed from the crate; drop down tocrate::regs::mac::set_speed_100mbps/set_duplex_fullfor raw register control.Emac::stop()now returnsErr(EmacError::TxFlushTimeout)when the FTF poll exhaustsTX_FIFO_FLUSH_TIMEOUT_USinstead of silently returningOk(()). The rest of the teardown still runs unconditionally, so the driver state still ends up atInitializedandstart()is safe to retry — the new error is a recoverable warning, not a state-machine corruption signal. Callers that pattern-match onOk(())need a wildcard or explicit handling of the new variant.- MSRV bumped from 1.75 to 1.88, matching what
esp-hal = "1.1"declares in its own manifest (esp-hal 1.0carried the same 1.88 pin). The previous declaration was mis-advertised. - Bump
eth-mdio-phydependency pin from^0.1.1to^0.2.0. Trait crate'sSpeed/Duplexbecame#[non_exhaustive]in that release. - Bump
embassy-syncfrom^0.7to^0.8(cascade fromesp-hal 1.1requirement). - Bump
esp-halfrom^1.0.0to^1.1.0.
Added
EmacError::TxFlushTimeoutvariant (lands as a non-breaking variant addition becauseEmacErroris#[non_exhaustive]).Emac::set_speed/set_duplexnow match eachSpeed/Duplexvariant explicitly. The trait-crate types became#[non_exhaustive]ineth-mdio-phy 0.2, so a future variant (e.g. a hypotheticalSpeed::Mbps1000) compiles transparently but has no register encoding on ESP32 EMAC. Such inputs are clamped to 100 Mbps (highest mode the peripheral physically supports) / Full duplex, with adefmt::warn!under thedefmtfeature flagging the mismatch.
Fixed
- Two clippy errors under
cargo +esp clippy --target xtensa-esp32-none-elf -D warnings:redundant_guardsatemac.rs:208(collapsedRmiiClockConfig::InternalApll { gpio, .. } if matches!(gpio, ClkGpio::Gpio0)intoRmiiClockConfig::InternalApll { gpio: ClkGpio::Gpio0, .. }) andlet_unit_valueatemac.rs:474(esp_hal::interrupt::enablereturns(), the priorlet _ =was dead). examples/embassy_net_lan8720a.rsnow compiles againstesp-rtos 0.3.0andembassy-executor 0.10:esp_rtos::starttakes aSoftwareInterrupt<'static, 0>second argument, andSpawner::spawnnow returns()while#[task]fns returnResult<SpawnToken<_>, SpawnError>(the.unwrap()belongs on the task call, not the spawn)..cargo/config.tomlnow emits-Tlinkall.xso the xtensa example links from a clean target dir. Pre-existing latent bug —linkall.xshipped from esp-hal'sOUT_DIRviacargo:rustc-link-search, but nothing emitted a-T, so a fresh build would fail with hundreds ofundefined referencesymbols (_stack_end_cpu0, every interrupt-vector entry from the esp32 PAC). Now caught by theexample-xtensaCI job.
Documentation
- New "Recovery from task respawn" section in the embassy-net module rustdoc covering the
static mut EMACre-borrow path:init()is one-shot, so a respawned task must callstop()+start()to bring the engine back up rather than silently ignoringEmacError::AlreadyInitialized. [package.metadata.docs.rs]now setsdefault-target = "riscv32imc-unknown-none-elf"and drops theesp-halfeature. docs.rs cannot satisfyxtensa-esp32-none-elf(rustc upstream has no xtensa target, and docs.rs does not carry the Microchip fork), so the previous metadata produced a "Documentation: failed" badge. Matches the convention every other esp-rs crate (esp-hal, esp-println, esp-backtrace, esp-storage, esp-radio) already uses.
Compatibility
| Component | Version |
|---|---|
eth-mdio-phy |
0.2.0 |
eth-phy-lan87xx |
0.2.0 |
eth-phy-lan867x |
0.1.0 |
esp-emac (this crate) |
0.2.0 |
esp-hal |
1.1.0 |
esp-rtos |
0.3.0 |
embassy-executor |
0.10 |
Pre-1.0 SemVer note. Cargo's caret on
^0.1will not pick up0.2.x— both digits are treated as the major axis below 1.0. Update youresp-emac = "0.1"requirement to"0.2"to pick up this release.
Full CHANGELOG: CHANGELOG.md