Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/stm32h745cm7/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target.thumbv7em-none-eabihf]
runner = 'probe-rs run --chip STM32H745XI'

[build]
target = "thumbv7em-none-eabihf"

[env]
DEFMT_LOG = "trace"
67 changes: 67 additions & 0 deletions examples/stm32h745cm7/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[package]
edition = "2024"
name = "embassy-stm32h745-cm7-examples"
version = "0.1.0"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = ["defmt", "stm32h745xi-cm7", "time-driver-any", "exti", "memory-x", "unstable-pac"] }
embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] }
embassy-embedded-hal = { version = "0.5.0", path = "../../embassy-embedded-hal" }
embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
embassy-futures = { version = "0.1.2", path = "../../embassy-futures" }

defmt = "1.0.1"
defmt-rtt = "1.0.0"

cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
cortex-m-rt = "0.7.0"
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
heapless = { version = "0.8", default-features = false }
embedded-graphics = { version = "0.8.1" }
tinybmp = { version = "0.5" }

# cargo build/run
[profile.dev]
codegen-units = 1
debug = 2
debug-assertions = true # <-
incremental = false
opt-level = 3 # <-
overflow-checks = true # <-

# cargo test
[profile.test]
codegen-units = 1
debug = 2
debug-assertions = true # <-
incremental = false
opt-level = 3 # <-
overflow-checks = true # <-

# cargo build/run --release
[profile.release]
codegen-units = 1
debug = 2
debug-assertions = false # <-
incremental = false
lto = 'fat'
opt-level = 3 # <-
overflow-checks = false # <-

# cargo test --release
[profile.bench]
codegen-units = 1
debug = 2
debug-assertions = false # <-
incremental = false
lto = 'fat'
opt-level = 3 # <-
overflow-checks = false # <-

[package.metadata.embassy]
build = [
{ target = "thumbv7em-none-eabihf", artifact-dir = "out/examples/stm32h745cm7" }
]
13 changes: 13 additions & 0 deletions examples/stm32h745cm7/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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.

You can set the option byte using the following command:

```sh
.\STM32_Programmer_CLI.exe -c port=SWD -ob BCM4=0 BCM7=1
```

---

The display code was adapted from [the STM32H735 sample](../stm32h735/src/bin/ltdc.rs).

If you're interested in creating a multi-core application, please take a look at the stm32h755 examples ([cm4](../stm32h755cm4) and [cm7](../stm32h755cm7)).
5 changes: 5 additions & 0 deletions examples/stm32h745cm7/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fn main() {
println!("cargo:rustc-link-arg-bins=--nmagic");
println!("cargo:rustc-link-arg-bins=-Tlink.x");
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
}
Binary file added examples/stm32h745cm7/src/bin/ferris.bmp
Binary file not shown.
Loading