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

Adding metadata and persistent panic info #827

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
* Serial terminal is available on USB for settings configurations
* Reboot to DFU support added via the serial terminal for remote bootloading
* The `meta` topic now contains metadata about the compiler, firmware, and hardware similar to
Booster
* Panic information is now persisted after reboot and available via telemetry and the USB serial
console.

### Changed
* Broker is no longer configured at compile time, but is maintained in device memory
Expand Down
163 changes: 162 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ documentation = "https://docs.rs/stabilizer/"
edition = "2021"
# keep MSRV in sync in ci.yaml and Cargo.toml
rust-version = "1.65"
build = "build.rs"
exclude = [
".gitignore",
"doc/",
Expand All @@ -34,6 +35,7 @@ default-target = "thumbv7em-none-eabihf"
members = ["ad9959", "serial-settings"]

[dependencies]
panic-persist = { version = "0.3", features = ["utf8", "custom-panic-handler"] }
sequential-storage = "0.6"
embedded-io = "0.6"
embedded-storage = "0.3"
Expand Down Expand Up @@ -71,6 +73,10 @@ miniconf = "0.9.0"
smoltcp-nal = { version = "0.4.1", features = ["shared-stack"]}
bbqueue = "0.5"
postcard = "1"
bit_field = "0.10.2"

[build-dependencies]
built = { version = "0.7", features = ["git2"], default-features = false }

[dependencies.stm32h7xx-hal]
version = "0.15.1"
Expand All @@ -80,6 +86,7 @@ features = ["stm32h743v", "rt", "ethernet", "xspi", "usb_hs"]

[patch.crates-io.usbd-serial]
git = "https://github.com/rust-embedded-community/usbd-serial"
rev = "096742c1c480f6f63c1a936a3c23ede7993c624d"

[features]
nightly = [ ]
Expand Down
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
fn main() {
built::write_built_file()
.expect("Failed to acquire build-time information");
println!("cargo:rerun-if-changed=memory.x");
}
10 changes: 8 additions & 2 deletions memory.x
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ MEMORY
RAM_B (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
FLASH1 (rx) : ORIGIN = 0x08100000, LENGTH = 1024K
BOOTFLAG_RAM: ORIGIN = 0x2001FC00, LENGTH = 1K
PERSISTENT_RAM: ORIGIN = 0x2001FC00, LENGTH = 1K
}

_bootflag = ORIGIN(BOOTFLAG_RAM);
/*
* Persistent memory has a u32 bootflag at the beginning and then the remainder is used for
* persisting panic information between boots.
*/
_bootflag = ORIGIN(PERSISTENT_RAM);
_panic_dump_start = ORIGIN(PERSISTENT_RAM) + 4;
_panic_dump_end = ORIGIN(PERSISTENT_RAM) + LENGTH(PERSISTENT_RAM) - 4;

SECTIONS {
.axisram (NOLOAD) : ALIGN(8) {
Expand Down
1 change: 1 addition & 0 deletions src/bin/dual-iir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ mod app {
env!("CARGO_BIN_NAME"),
&settings.broker,
&settings.id,
stabilizer.metadata,
);

let generator = network.configure_streaming(StreamFormat::AdcDacData);
Expand Down
1 change: 1 addition & 0 deletions src/bin/lockin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ mod app {
env!("CARGO_BIN_NAME"),
&settings.broker,
&settings.id,
stabilizer.metadata,
);

let generator = network.configure_streaming(StreamFormat::AdcDacData);
Expand Down
Loading