Skip to content

Commit

Permalink
Move the thermal config from RAM into flash (oxidecomputer#838)
Browse files Browse the repository at this point in the history
This brings the thermal task from 18648 to 17720 bytes of flash (a small
improvement)

More importantly, it drops the stack usage from 7392 to 3560, meaning we can
shrink the RAM usage by 8192!
  • Loading branch information
mkeeter authored Oct 7, 2022
1 parent 9280a15 commit d57c2a7
Show file tree
Hide file tree
Showing 7 changed files with 545 additions and 546 deletions.
35 changes: 23 additions & 12 deletions app/gimlet/rev-b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ task-slots = ["sys", "i2c_driver"]
name = "task-thermal"
features = ["itm", "gimlet"]
priority = 5
max-sizes = {flash = 32768, ram = 16384 }
stacksize = 8000
max-sizes = {flash = 32768, ram = 8192 }
stacksize = 4504
start = true
task-slots = ["i2c_driver", "sensor", "gimlet_seq", "jefe"]

Expand Down Expand Up @@ -438,7 +438,8 @@ segment = 1
address = 0b110_1010
device = "nvmebmc"
description = "U.2 A NVMe Basic Management Command"
sensors = { temperature = 1, names = ["U2_N0"] }
sensors = { temperature = 1 }
name = "U2_N0"
refdes = "J206"
removable = true

Expand Down Expand Up @@ -469,7 +470,8 @@ segment = 2
address = 0b110_1010
device = "nvmebmc"
description = "U.2 B NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N1"] }
sensors = { temperature = 1 }
name = "U2_N1"
refdes = "J207"
removable = true

Expand Down Expand Up @@ -500,7 +502,8 @@ segment = 3
address = 0b110_1010
device = "nvmebmc"
description = "U.2 C NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N2"] }
sensors = { temperature = 1 }
name = "U2_N2"
refdes = "J208"
removable = true

Expand Down Expand Up @@ -531,7 +534,8 @@ segment = 4
address = 0b110_1010
device = "nvmebmc"
description = "U.2 D NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N3"] }
sensors = { temperature = 1 }
name = "U2_N3"
refdes = "J209"
removable = true

Expand Down Expand Up @@ -562,7 +566,8 @@ segment = 1
address = 0b110_1010
device = "nvmebmc"
description = "U.2 E NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N4"] }
sensors = { temperature = 1 }
name = "U2_N4"
refdes = "J210"
removable = true

Expand Down Expand Up @@ -593,7 +598,8 @@ segment = 2
address = 0b110_1010
device = "nvmebmc"
description = "U.2 F NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N5"] }
sensors = { temperature = 1 }
name = "U2_N5"
refdes = "J211"
removable = true

Expand Down Expand Up @@ -624,7 +630,8 @@ segment = 3
address = 0b110_1010
device = "nvmebmc"
description = "U.2 G NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N6"] }
sensors = { temperature = 1 }
name = "U2_N6"
refdes = "J212"
removable = true

Expand Down Expand Up @@ -655,7 +662,8 @@ segment = 4
address = 0b110_1010
device = "nvmebmc"
description = "U.2 H NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N7"] }
sensors = { temperature = 1 }
name = "U2_N7"
refdes = "J213"
removable = true

Expand Down Expand Up @@ -686,7 +694,8 @@ segment = 1
address = 0b110_1010
device = "nvmebmc"
description = "U.2 I NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N8"] }
sensors = { temperature = 1 }
name = "U2_N8"
refdes = "J214"
removable = true

Expand Down Expand Up @@ -717,7 +726,8 @@ segment = 2
address = 0b110_1010
device = "nvmebmc"
description = "U.2 J NVMe Basic Management Control"
sensors = { temperature = 1, names = ["U2_N9"] }
sensors = { temperature = 1 }
name = "U2_N9"
refdes = "J215"
removable = true

Expand Down Expand Up @@ -753,6 +763,7 @@ mux = 1
segment = 4
address = 0x4c
device = "tmp451"
name = "t6"
sensors = { temperature = 1 }
description = "T6 temperature sensor"
refdes = "U491"
Expand Down
2 changes: 1 addition & 1 deletion build/i2c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl ConfigGenerator {
}

pub fn generate_header(&mut self) -> Result<()> {
writeln!(&mut self.output, "mod i2c_config {{")?;
writeln!(&mut self.output, "pub(crate) mod i2c_config {{")?;
Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions drv/i2c-devices/src/tmp451.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl From<Error> for ResponseCode {
}

/// Selects whether this sensor reads the local or remote temperature
#[derive(Copy, Clone)]
pub enum Target {
Local,
Remote,
Expand Down
Loading

0 comments on commit d57c2a7

Please sign in to comment.