Skip to content

Commit

Permalink
stm32h7: merge GPIO MPU regions.
Browse files Browse the repository at this point in the history
We were being careful and tiling three MPU regions to the exact
boundaries of the implemented GPIO blocks on STM32H7. However, this also
meant we were out of MPU slots. I need to map a region into sys for the
external interrupt work.

Here I've merged the regions into a single, slightly larger region. This
technically exposes some undefined address space to the sys task.
However, it _sure looks_ like the remaining space is reserved by ST for
the addition of more GPIO blocks, since they've been stuffing more ports
in here in past models. Since we won't be touching that address space --
and we can be fairly certain of that thanks to mostly-safe code -- I'd
argue that this doesn't increase our risk.
  • Loading branch information
cbiffle committed Dec 12, 2023
1 parent d330c01 commit 8ac5acf
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/demo-stm32h7-nucleo/app-h743.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ name = "drv-stm32xx-sys"
features = ["h743"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/demo-stm32h7-nucleo/app-h753.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/gemini-bu/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/gimlet/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/gimletlet/app-mgmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/gimletlet/base-gimletlet2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/psc/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
2 changes: 1 addition & 1 deletion app/sidecar/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true
task-slots = ["jefe"]

Expand Down
12 changes: 2 additions & 10 deletions chips/stm32h7/chip.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@
address = 0x58024400
size = 1024

[gpios1]
[gpios]
address = 0x58020000
size = 0x2000

[gpios2]
address = 0x58022000
size = 0x0800

[gpios3]
address = 0x58022800
size = 0x0400
size = 0x4000

[spi1]
address = 0x40013000
Expand Down
2 changes: 1 addition & 1 deletion test/tests-psc/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ name = "drv-stm32xx-sys"
features = ["h753"]
priority = 1
max-sizes = {flash = 2048, ram = 1024}
uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"]
uses = ["rcc", "gpios", "system_flash"]
start = true

[tasks.i2c_driver]
Expand Down

0 comments on commit 8ac5acf

Please sign in to comment.