Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable EXTI interrupt dispatch support in stm32xx-sys #1691

Merged
merged 2 commits into from
Mar 29, 2024
Merged
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
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
9 changes: 9 additions & 0 deletions chips/stm32h7/chip.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ address = 0x58001400
size = 1024
interrupts = { irq = 86 }

[syscfg]
address = 0x58000400
size = 1024

[exti]
address = 0x58000000
size = 1024
interrupts = { exti0 = 6, exti1 = 7, exti2 = 8, exti3 = 9, exti4 = 10, exti9_5 = 23, exti15_10 = 40 }

[usart1]
address = 0x40011000
size = 1024
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
Loading