mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
adjust attack threshold trip for recording attack
in practice we're seeing multiple trips to the glitch detector when power down discharge is slow.
This commit is contained in:
parent
84e276f712
commit
9d5851bd98
1 changed files with 4 additions and 2 deletions
|
|
@ -19,7 +19,9 @@ pub const WIPE_THRESHOLD: u32 = 127;
|
||||||
/// This number is empirically tuned. The main issue is we don't want to notch up the
|
/// This number is empirically tuned. The main issue is we don't want to notch up the
|
||||||
/// counter during "slow shutdowns" where the power supply falls gradually enough that
|
/// counter during "slow shutdowns" where the power supply falls gradually enough that
|
||||||
/// the glitch detector can fire.
|
/// the glitch detector can fire.
|
||||||
const DISTURB_THRESHOLD: u32 = 2;
|
/// Empirically, during a shutdown, this reaches a value of around 10 on some boards.
|
||||||
|
/// Margin it up to 16, to avoid false alarms.
|
||||||
|
const DISTURB_THRESHOLD: u32 = 16;
|
||||||
|
|
||||||
/// This is the range of delays we will pick from whenever we attempt a random delay,
|
/// This is the range of delays we will pick from whenever we attempt a random delay,
|
||||||
/// expressed as a number of bits.
|
/// expressed as a number of bits.
|
||||||
|
|
@ -434,7 +436,7 @@ pub fn glitch_handler(attacks_since_boot: u32) {
|
||||||
// even output something on the DUART - this could be used as a trigger to prevent shutdown
|
// even output something on the DUART - this could be used as a trigger to prevent shutdown
|
||||||
// but at this point diagnostics are useful for seeing why the system shut down unexpectedly.
|
// but at this point diagnostics are useful for seeing why the system shut down unexpectedly.
|
||||||
#[cfg(feature = "debug-countermeasures")]
|
#[cfg(feature = "debug-countermeasures")]
|
||||||
crate::println!("Attack thresh");
|
crate::println!("Attack thresh trip: {}", attacks_since_boot);
|
||||||
crate::sigcheck::die_no_std();
|
crate::sigcheck::die_no_std();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue