From 9b5d9fbfcab7a51463ab98019e67ca3f667035e6 Mon Sep 17 00:00:00 2001 From: Matous Hybl Date: Wed, 3 Nov 2021 17:01:48 +0100 Subject: [PATCH] Fix v2 ethernet pin definitions. Fix ethernet example for H7 nucleos. --- embassy-stm32/src/eth/v2/mod.rs | 4 ++-- examples/stm32h7/Cargo.toml | 2 +- examples/stm32h7/memory.x | 5 +++++ examples/stm32h7/src/bin/eth.rs | 4 ++-- stm32-data | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 examples/stm32h7/memory.x diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index 001ac315..2f2dc4f3 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs @@ -429,8 +429,8 @@ macro_rules! impl_pin { } crate::pac::peripheral_pins!( - ($inst:ident, eth, ETH, $pin:ident, REF_CLK) => { - impl_pin!($pin, RefClkPin, 11); + ($inst:ident, eth, ETH, $pin:ident, REF_CLK, $af:expr) => { + impl_pin!($pin, RefClkPin, $af); }; ($inst:ident, eth, ETH, $pin:ident, MDIO, $af:expr) => { impl_pin!($pin, MDIOPin, $af); diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index eed4882c..e83ee358 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml @@ -19,7 +19,7 @@ defmt-error = [] [dependencies] embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-trace"] } embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } -embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "stm32h743zi", "net", "memory-x", "time-driver-tim2"] } +embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "stm32h743zi", "net", "time-driver-tim2"] } embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt-debug", "defmt", "tcp", "medium-ethernet", "pool-16"] } embassy-macros = { path = "../../embassy-macros" } diff --git a/examples/stm32h7/memory.x b/examples/stm32h7/memory.x new file mode 100644 index 00000000..c23c397a --- /dev/null +++ b/examples/stm32h7/memory.x @@ -0,0 +1,5 @@ +MEMORY +{ + FLASH : ORIGIN = 0x8000000, LENGTH = 1024K + RAM : ORIGIN = 0x24000000, LENGTH = 128K +} \ No newline at end of file diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index acb6ef3a..c1b203b8 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs @@ -105,8 +105,8 @@ fn main() -> ! { let state = STATE.put(State::new()); let eth = unsafe { ETH.put(Ethernet::new( - state, p.ETH, eth_int, p.PA1, p.PA2, p.PC1, p.PA7, p.PC4, p.PC5, p.PB12, p.PB13, - p.PB11, LAN8742A, mac_addr, 1, + state, p.ETH, eth_int, p.PA1, p.PA2, p.PC1, p.PA7, p.PC4, p.PC5, p.PG13, p.PB13, + p.PG11, LAN8742A, mac_addr, 0, )) }; diff --git a/stm32-data b/stm32-data index ed9819e9..d05e6384 160000 --- a/stm32-data +++ b/stm32-data @@ -1 +1 @@ -Subproject commit ed9819e91fed1da71bc5c4b994c7f03a4d66d84f +Subproject commit d05e63848bdc75f19153297633ad27501d76792d