Skip to content

Commit 142840d

Browse files
committed
add a sample for the lcd of the stm32h745i-disco
1 parent 2800889 commit 142840d

File tree

6 files changed

+531
-0
lines changed

6 files changed

+531
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[target.thumbv7em-none-eabihf]
2+
runner = 'probe-rs run --chip STM32H745XI'
3+
4+
[build]
5+
target = "thumbv7em-none-eabihf"
6+
7+
[env]
8+
DEFMT_LOG = "trace"

examples/stm32h745cm7/Cargo.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[package]
2+
edition = "2024"
3+
name = "embassy-stm32h745-cm7-examples"
4+
version = "0.1.0"
5+
license = "MIT OR Apache-2.0"
6+
publish = false
7+
8+
[dependencies]
9+
embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = ["defmt", "stm32h745xi-cm7", "time-driver-any", "exti", "memory-x", "unstable-pac"] }
10+
embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] }
11+
embassy-embedded-hal = { version = "0.5.0", path = "../../embassy-embedded-hal" }
12+
embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13+
embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
14+
embassy-futures = { version = "0.1.2", path = "../../embassy-futures" }
15+
16+
defmt = "1.0.1"
17+
defmt-rtt = "1.0.0"
18+
19+
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
20+
cortex-m-rt = "0.7.0"
21+
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
22+
heapless = { version = "0.8", default-features = false }
23+
embedded-graphics = { version = "0.8.1" }
24+
tinybmp = { version = "0.5" }
25+
26+
# cargo build/run
27+
[profile.dev]
28+
codegen-units = 1
29+
debug = 2
30+
debug-assertions = true # <-
31+
incremental = false
32+
opt-level = 3 # <-
33+
overflow-checks = true # <-
34+
35+
# cargo test
36+
[profile.test]
37+
codegen-units = 1
38+
debug = 2
39+
debug-assertions = true # <-
40+
incremental = false
41+
opt-level = 3 # <-
42+
overflow-checks = true # <-
43+
44+
# cargo build/run --release
45+
[profile.release]
46+
codegen-units = 1
47+
debug = 2
48+
debug-assertions = false # <-
49+
incremental = false
50+
lto = 'fat'
51+
opt-level = 3 # <-
52+
overflow-checks = false # <-
53+
54+
# cargo test --release
55+
[profile.bench]
56+
codegen-units = 1
57+
debug = 2
58+
debug-assertions = false # <-
59+
incremental = false
60+
lto = 'fat'
61+
opt-level = 3 # <-
62+
overflow-checks = false # <-
63+
64+
[package.metadata.embassy]
65+
build = [
66+
{ target = "thumbv7em-none-eabihf", artifact-dir = "out/examples/stm32h745cm7" }
67+
]

examples/stm32h745cm7/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This example demonstrates how to use the display on the STM32H745I-DISCO board. It runs on the Cortex M7 core. It does not do anything with the CM4 core, so if you find that you have "weird" issues, disable the CM4 core using ``option byte`` ``BCM4=0`` or just flash an empty loop onto it.
2+
3+
You can set the option byte using the following command:
4+
5+
```sh
6+
.\STM32_Programmer_CLI.exe -c port=SWD -ob BCM4=0 BCM7=1
7+
```
8+
9+
---
10+
11+
The display code was adapted from [the STM32H735 sample](../stm32h735/src/bin/ltdc.rs).
12+
13+
If you're interested in creating a multi-core application, please take a look at the stm32h755 examples ([cm4](../stm32h755cm4) and [cm7](../stm32h755cm7)).

examples/stm32h745cm7/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
println!("cargo:rustc-link-arg-bins=--nmagic");
3+
println!("cargo:rustc-link-arg-bins=-Tlink.x");
4+
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
5+
}
6.63 KB
Binary file not shown.

0 commit comments

Comments
 (0)