Skip to content

Commit 5e68f88

Browse files
committed
Add flash index field as requested
1 parent f8a3945 commit 5e68f88

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

app/cosmo/base.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ features = ["stm32h753", "usart6", "baud_rate_3M", "hardware_flow_control", "vla
258258
uses = ["usart6", "dbgmcu"]
259259
interrupts = {"usart6.irq" = "usart-irq"}
260260
priority = 9
261-
max-sizes = {flash = 72000, ram = 65536}
261+
max-sizes = {flash = 74000, ram = 65536}
262262
stacksize = 5400
263263
start = true
264264
task-slots = ["sys", { cpu_seq = "cosmo_seq" }, "hf", "control_plane_agent", "net", "packrat", "i2c_driver", { spi_driver = "spi2_driver" }, "sprot", "auxflash"]

app/gimlet/base.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ features = ["stm32h753", "uart7", "baud_rate_3M", "hardware_flow_control", "vlan
243243
uses = ["uart7", "dbgmcu"]
244244
interrupts = {"uart7.irq" = "usart-irq"}
245245
priority = 8
246-
max-sizes = {flash = 72000, ram = 65536}
246+
max-sizes = {flash = 74000, ram = 65536}
247247
stacksize = 5376
248248
start = true
249249
task-slots = ["sys", { cpu_seq = "gimlet_seq" }, "hf", "control_plane_agent", "net", "packrat", "i2c_driver", { spi_driver = "spi2_driver" }, "sprot"]

task/host-sp-comms/src/main.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,11 +1027,18 @@ impl ServerImpl {
10271027
total_count: new_ct,
10281028
});
10291029

1030+
let flashidx = match self.hf.get_dev() {
1031+
Ok(HfDevSelect::Flash0) => 0,
1032+
Ok(HfDevSelect::Flash1) => 1,
1033+
Err(_) => 0xFF,
1034+
};
1035+
10301036
// ereport!
10311037
_ = self.ereporter.deliver_ereport(&HostBootFail {
10321038
n: new_ct,
10331039
msglen: n as u32,
10341040
reason,
1041+
flashidx,
10351042
});
10361043
Some(SpToHost::Ack)
10371044
}
@@ -1071,9 +1078,17 @@ impl ServerImpl {
10711078
total_count: new_ct,
10721079
});
10731080

1081+
let flashidx = match self.hf.get_dev() {
1082+
Ok(HfDevSelect::Flash0) => 0,
1083+
Ok(HfDevSelect::Flash1) => 1,
1084+
Err(_) => 0xFF,
1085+
};
1086+
1087+
// ereport!
10741088
_ = self.ereporter.deliver_ereport(&HostPanic {
10751089
n: new_ct,
10761090
msglen: n as u32,
1091+
flashidx,
10771092
});
10781093

10791094
Some(SpToHost::Ack)
@@ -2094,6 +2109,9 @@ struct HostPanic {
20942109
/// This quantity may be less than the amount received, as it is capped
20952110
/// by the available storage space allocated (`MAX_HOST_FAIL_MESSAGE_LEN`).
20962111
msglen: u32,
2112+
/// The flash boot index, directly correlated to which boot slot we are
2113+
/// operating from. Currently 0 (BSU: A), 1 (BSU: B), or 0xFF (unknown).
2114+
flashidx: u8,
20972115
}
20982116

20992117
/// An ereport represent a host reported boot failure
@@ -2112,4 +2130,7 @@ struct HostBootFail {
21122130
msglen: u32,
21132131
/// The reported reason code for the host boot failure
21142132
reason: u8,
2133+
/// The flash boot index, directly correlated to which boot slot we are
2134+
/// operating from. Currently 0 (BSU: A), 1 (BSU: B), or 0xFF (unknown).
2135+
flashidx: u8,
21152136
}

0 commit comments

Comments
 (0)