diff options
| author | Fabian Wolter <[email protected]> | 2025-07-17 18:00:27 +0200 |
|---|---|---|
| committer | Fabian Wolter <[email protected]> | 2025-07-17 18:00:27 +0200 |
| commit | 233bd18fae2da8017a611b9b4f3210af90ff8710 (patch) | |
| tree | a9f07d7953c009f63ed9976e20e8158874e8d4da | |
| parent | a18e79eddbda2d58a05af51d1f06f16059a58578 (diff) | |
STM32F107: Fix inadvertent re-configuration of the SWJ/JTAG pins when activating the (R)MII interface
| -rw-r--r-- | embassy-stm32/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/eth/v1/mod.rs | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index eaf8bafbf..0266b53b6 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -81,7 +81,7 @@ futures-util = { version = "0.3.30", default-features = false } | |||
| 81 | sdio-host = "0.9.0" | 81 | sdio-host = "0.9.0" |
| 82 | critical-section = "1.1" | 82 | critical-section = "1.1" |
| 83 | #stm32-metapac = { version = "16" } | 83 | #stm32-metapac = { version = "16" } |
| 84 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-85e2c0f43f3460b3305a2f97962bd39deed09d13" } | 84 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-f761780b74faf840220b367b15d556b9e10c2334" } |
| 85 | 85 | ||
| 86 | vcell = "0.1.3" | 86 | vcell = "0.1.3" |
| 87 | nb = "1.0.0" | 87 | nb = "1.0.0" |
| @@ -110,7 +110,7 @@ proc-macro2 = "1.0.36" | |||
| 110 | quote = "1.0.15" | 110 | quote = "1.0.15" |
| 111 | 111 | ||
| 112 | #stm32-metapac = { version = "16", default-features = false, features = ["metadata"]} | 112 | #stm32-metapac = { version = "16", default-features = false, features = ["metadata"]} |
| 113 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-85e2c0f43f3460b3305a2f97962bd39deed09d13", default-features = false, features = ["metadata"] } | 113 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-f761780b74faf840220b367b15d556b9e10c2334", default-features = false, features = ["metadata"] } |
| 114 | 114 | ||
| 115 | [features] | 115 | [features] |
| 116 | default = ["rt"] | 116 | default = ["rt"] |
diff --git a/embassy-stm32/src/eth/v1/mod.rs b/embassy-stm32/src/eth/v1/mod.rs index 01e321bce..b9746231f 100644 --- a/embassy-stm32/src/eth/v1/mod.rs +++ b/embassy-stm32/src/eth/v1/mod.rs | |||
| @@ -122,7 +122,10 @@ impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P> { | |||
| 122 | 122 | ||
| 123 | // Select RMII (Reduced Media Independent Interface) | 123 | // Select RMII (Reduced Media Independent Interface) |
| 124 | // Must be done prior to enabling peripheral clock | 124 | // Must be done prior to enabling peripheral clock |
| 125 | AFIO.mapr().modify(|w| w.set_mii_rmii_sel(true)); | 125 | AFIO.mapr().modify(|w| { |
| 126 | w.set_mii_rmii_sel(true); | ||
| 127 | w.set_swj_cfg(crate::pac::afio::vals::SwjCfg::NO_OP); | ||
| 128 | }); | ||
| 126 | 129 | ||
| 127 | RCC.ahbenr().modify(|w| { | 130 | RCC.ahbenr().modify(|w| { |
| 128 | w.set_ethen(true); | 131 | w.set_ethen(true); |
| @@ -316,7 +319,10 @@ impl<'d, T: Instance, P: Phy> Ethernet<'d, T, P> { | |||
| 316 | 319 | ||
| 317 | // Select MII (Media Independent Interface) | 320 | // Select MII (Media Independent Interface) |
| 318 | // Must be done prior to enabling peripheral clock | 321 | // Must be done prior to enabling peripheral clock |
| 319 | AFIO.mapr().modify(|w| w.set_mii_rmii_sel(false)); | 322 | AFIO.mapr().modify(|w| { |
| 323 | w.set_mii_rmii_sel(false); | ||
| 324 | w.set_swj_cfg(crate::pac::afio::vals::SwjCfg::NO_OP); | ||
| 325 | }); | ||
| 320 | 326 | ||
| 321 | RCC.ahbenr().modify(|w| { | 327 | RCC.ahbenr().modify(|w| { |
| 322 | w.set_ethen(true); | 328 | w.set_ethen(true); |
