Skip to content

Commit

Permalink
psc: start monitoring present/OK pins
Browse files Browse the repository at this point in the history
This will disable PSUs that are seen removed, and then delay turning
them back on for a bit after insertion. It will also respond to faults
by cycling PSUs in an attempt to clear them.

At this point the only event logging is in PSC RAM in a ringbuf.
  • Loading branch information
cbiffle committed May 2, 2024
1 parent cd539d1 commit 6f4fb31
Show file tree
Hide file tree
Showing 5 changed files with 622 additions and 10 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.

47 changes: 46 additions & 1 deletion app/psc/base.toml
Expand Up @@ -6,7 +6,7 @@ fwid = true

[kernel]
name = "psc"
requires = {flash = 32768, ram = 4880}
requires = {flash = 32768, ram = 5080}
features = ["dump"]

[caboose]
Expand Down Expand Up @@ -56,6 +56,42 @@ port = "E"
pin = 3
owner = {name = "sprot", notification = "rot_irq"}

# Note: present_l IRQs are missing because of a conflict with ROT_IRQ above;
# these signals are currently polled.

[tasks.sys.config.gpio-irqs.psu_pwr_ok_1]
port = "J"
pin = 6
owner = {name = "sequencer", notification = "psu_pwr_ok_1"}

[tasks.sys.config.gpio-irqs.psu_pwr_ok_2]
port = "J"
pin = 7
owner = {name = "sequencer", notification = "psu_pwr_ok_2"}

[tasks.sys.config.gpio-irqs.psu_pwr_ok_3]
port = "J"
pin = 8
owner = {name = "sequencer", notification = "psu_pwr_ok_3"}

[tasks.sys.config.gpio-irqs.psu_pwr_ok_4]
port = "J"
pin = 9
owner = {name = "sequencer", notification = "psu_pwr_ok_4"}

[tasks.sys.config.gpio-irqs.psu_pwr_ok_5]
port = "J"
pin = 10
owner = {name = "sequencer", notification = "psu_pwr_ok_5"}

[tasks.sys.config.gpio-irqs.psu_pwr_ok_6]
port = "J"
pin = 11
owner = {name = "sequencer", notification = "psu_pwr_ok_6"}




[tasks.i2c_driver]
name = "drv-stm32xx-i2c-server"
stacksize = 1048
Expand Down Expand Up @@ -86,6 +122,15 @@ priority = 4
stacksize = 4096
start = true
task-slots = ["jefe", "packrat", "i2c_driver", "sys"]
notifications = [
"psu_pwr_ok_1",
"psu_pwr_ok_2",
"psu_pwr_ok_3",
"psu_pwr_ok_4",
"psu_pwr_ok_5",
"psu_pwr_ok_6",
"timer",
]

[tasks.update_server]
name = "stm32h7-update-server"
Expand Down
2 changes: 2 additions & 0 deletions drv/psc-seq-server/Cargo.toml
Expand Up @@ -9,9 +9,11 @@ drv-psc-seq-api.path = "../psc-seq-api"
drv-stm32xx-sys-api = { path = "../../drv/stm32xx-sys-api", features = ["family-stm32h7"] }
task-jefe-api.path = "../../task/jefe-api"
userlib = { path = "../../sys/userlib", features = ["panic-messages"] }
ringbuf = { path = "../../lib/ringbuf" }

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

# This section is here to discourage RLS/rust-analyzer from doing test builds,
# since test builds don't work for cross compilation.
Expand Down
8 changes: 8 additions & 0 deletions drv/psc-seq-server/build.rs
@@ -0,0 +1,8 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// 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()?;
Ok(())
}

0 comments on commit 6f4fb31

Please sign in to comment.