Skip to content

Commit

Permalink
Preliminary stm32h7 exti support.
Browse files Browse the repository at this point in the history
This adds a slightly-hacked-up EXTI driver for STM32H7. It is currently
statically configured to deliver interrupts from one pin to one task,
because that's what we initially needed. We are going to improve this.
  • Loading branch information
cbiffle committed Mar 29, 2024
1 parent f394e07 commit 4f29df0
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/demo-stm32h7-nucleo/app-h753.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ request_reset = ["hiffy"]
name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 2048}
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]
Expand Down
17 changes: 13 additions & 4 deletions app/gimlet/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,21 @@ notifications = ["eth-irq", "mdio-timer-irq", "wake-timer", "jefe-state-change"]

[tasks.sys]
name = "drv-stm32xx-sys"
features = ["h753"]
features = ["h753", "exti"]
priority = 1
max-sizes = {flash = 2048, ram = 2048}
uses = ["rcc", "gpios", "system_flash"]
uses = ["rcc", "gpios", "system_flash", "syscfg", "exti"]
start = true
task-slots = ["jefe"]
notifications = ["exti-wildcard-irq"]

[tasks.sys.interrupts]
"exti.exti0" = "exti-wildcard-irq"
"exti.exti1" = "exti-wildcard-irq"
"exti.exti2" = "exti-wildcard-irq"
"exti.exti3" = "exti-wildcard-irq"
"exti.exti4" = "exti-wildcard-irq"
"exti.exti9_5" = "exti-wildcard-irq"
"exti.exti15_10" = "exti-wildcard-irq"

[tasks.spi2_driver]
name = "drv-stm32h7-spi-server"
Expand Down Expand Up @@ -128,7 +137,7 @@ max-sizes = {flash = 65536, ram = 16384 }
stacksize = 2800
start = true
task-slots = ["i2c_driver", "sensor", "gimlet_seq"]
notifications = ["timer"]
notifications = ["timer", "external_badness"]

[tasks.hiffy]
name = "task-hiffy"
Expand Down
5 changes: 5 additions & 0 deletions drv/stm32xx-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
drv-stm32xx-gpio-common = { path = "../stm32xx-gpio-common", features = ["server-support"] }
drv-stm32xx-sys-api = { path = "../stm32xx-sys-api" }
drv-stm32xx-uid = { path = "../../drv/stm32xx-uid" }
hubris-num-tasks = { path = "../../sys/num-tasks", features = ["task-enum"], optional = true }
task-jefe-api = { path="../../task/jefe-api" }
userlib = { path = "../../sys/userlib" }

Expand All @@ -20,6 +21,7 @@ zerocopy = { workspace = true }

[build-dependencies]
idol = { workspace = true }
build-util = { path = "../../build/util" }

[features]
family-stm32h7 = ["stm32h7", "drv-stm32xx-uid/family-stm32h7"]
Expand All @@ -33,6 +35,9 @@ g070 = ["family-stm32g0", "stm32g0/stm32g070", "drv-stm32xx-sys-api/g070", "drv-
g0b1 = ["family-stm32g0", "stm32g0/stm32g0b1", "drv-stm32xx-sys-api/g0b1", "drv-stm32xx-gpio-common/model-stm32g0b1"]
no-ipc-counters = ["idol/no-counters"]

# Enable external interrupt controller support.
exti = ["dep:hubris-num-tasks"]

# Disables the Jefe dependency, for use in tests where the test-runner task is
# used as supervisor, rather than Jefe.
#
Expand Down
2 changes: 2 additions & 0 deletions drv/stm32xx-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
build_util::build_notifications()?;

idol::Generator::new()
.with_counters(
idol::CounterSettings::default().with_server_counters(false),
Expand Down
Loading

0 comments on commit 4f29df0

Please sign in to comment.