-
Notifications
You must be signed in to change notification settings - Fork 10
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
[RSDK-8708] add coredump reader #309
Conversation
|
||
const CORE_FRAGMENT_SIZE: usize = 3072; | ||
|
||
impl DoCommand for Coredump { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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
No description provided.