Skip to content

Commit 47287a4

Browse files
authored
Merge pull request #515 from stm32-rs/fix-flash
Fix flash
2 parents 6a8d6f4 + 1df3703 commit 47287a4

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.cargo/config.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[target.thumbv7m-none-eabi]
2-
runner = 'arm-none-eabi-gdb'
2+
runner = 'probe-rs run --chip STM32F103C8Tx'
33
rustflags = [
44
"-C", "link-arg=-Tlink.x",
5+
#"-C", "link-arg=-Tdefmt.x",
56
]
67

78
[build]
89
target = "thumbv7m-none-eabi"
10+
11+
[env]
12+
DEFMT_LOG = "info"

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ features = ["stm32f103", "rtic", "high"]
1818
default-target = "x86_64-unknown-linux-gnu"
1919

2020
[dependencies]
21-
cortex-m = "0.7.6"
22-
cortex-m-rt = "0.7.1"
21+
defmt = { version = "0.3.8", optional = true }
22+
cortex-m = { version = "0.7.7", features = ["critical-section-single-core"] }
23+
cortex-m-rt = "0.7.3"
2324
nb = "1.1"
2425
embedded-dma = "0.2.0"
2526
bxcan = "0.8.0"
@@ -73,7 +74,7 @@ stm32f103 = ["stm32f1/stm32f103", "has-can", "stm32-usbd"]
7374
stm32f105 = ["stm32f1/stm32f107", "connectivity"]
7475
stm32f107 = ["stm32f1/stm32f107", "connectivity"]
7576

76-
defmt = ["stm32f1/defmt"]
77+
defmt = ["dep:defmt", "stm32f1/defmt"]
7778

7879
# Devices with 64 or 128 Kb ROM
7980
medium = []

src/gpio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ where
845845
}
846846
8..=15 => {
847847
gpio.crh()
848-
.modify(|_, w| unsafe { w.mode(N - 16).bits(speed as u8) });
848+
.modify(|_, w| unsafe { w.mode(N - 8).bits(speed as u8) });
849849
}
850850
_ => unreachable!(),
851851
}
@@ -979,8 +979,8 @@ where
979979
}
980980
8..=15 => {
981981
gpio.crh().modify(|_, w| unsafe {
982-
w.mode(N - 16).bits(MODE::MODE as u8);
983-
w.cnf(N - 16).bits(MODE::CNF as u8)
982+
w.mode(N - 8).bits(MODE::MODE as u8);
983+
w.cnf(N - 8).bits(MODE::CNF as u8)
984984
});
985985
}
986986
_ => unreachable!(),

0 commit comments

Comments
 (0)