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

[RSDK-8708] add coredump reader #309

Merged
merged 5 commits into from
Sep 18, 2024

Conversation

npmenard
Copy link
Member

@npmenard npmenard commented Sep 6, 2024

No description provided.

@npmenard npmenard requested a review from a team as a code owner September 6, 2024 15:10
micro-rdk/src/esp32/coredump.rs Outdated Show resolved Hide resolved

const CORE_FRAGMENT_SIZE: usize = 3072;

impl DoCommand for Coredump {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth having a comment outlining the three commands that can be sent, their expected values, and the high-level expected behavior

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

})?;

if first_bytes[7] != 0xFF {
len = usize::from_le_bytes(first_bytes[0..4].try_into().unwrap()); // safe because we would have read 4 bytes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to make sure I understand: we only need to do this once because even if someone erases the coredump via DoCommand, a coredump can only be written in a situation that what prompt a restart and result in reconfiguration? Is this correct? Or is there a situation in which something can be written to the coredump and a restart does not occur (meaning this sensor's state won't be properly reset)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coredump is only written on panic/abort whether from rust or C. So during the lifetime of the program the coredump exists until we erase it

Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mattjperez mattjperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
the embedded DoCommand docs would be great

@npmenard npmenard merged commit 617fe41 into viamrobotics:main Sep 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants