Enum lpc55::protected_flash::debug::DebugSetting
source · [−]pub enum DebugSetting {
Default,
Disabled,
Enabled,
Illegal,
Authenticate,
}
Expand description
Controls access of debuggers to specific subsystems.
To understand if access is possible:
- factory + customer setting: Enabled -> yes
- factor + customer set to Enabled or Authenticate -> need a prepared debug certificate (this is not implemented in this library)
- any setting Illegal => device may lock up
- any setting Disabled => access not possible!!
Peculiarities to be aware of:
- Factory settings (
CC_SOCU_PIN
,CC_SOCU_DFLT
) can be made stricter, but not relaxed, using customer settings (DCFG_CC_SOCU_NS_PIN
,DCFG_CC_SOCU_NS_DFLT
) - As long as the factory page is not sealed, the setting can be changed there.
- To change settings in the customer page, the ping/pong dance must be done.
- The enabled bit (“DFLT”) determines which setting is potentially in effect
- The fixed bit (“PIN”) determines whether a debugger may activate the potentially effective settings (by presenting a Debug Authentication certificate)
- The non-fixed enabled setting is illegal.
- All bits are written in the lower half-word, and must be also written in inverted form in the upper half-word.
- Except, it seems, the default / empty setting, where both PIN and DFLT words are all zero.
In this implementation, we disregard customer settings from configuration files, enforcing that only the firmware changes them.
TODO: We could also model the factory default, where the entire word is zeros. This would need some special handling + research.
Variants
Default
Default state at startup. Will only be accepted when writing to factory settings when all settings are default.
Disabled
Disabled at startup, debugging not possible
Enabled
Debugging enabled at startup (debugger can’t turn off). “Access to the sub-domain is always enabled.”
Illegal
According to UM 11126, 51.7.14, Table 1064: “Illegal setting. Part may lock-up if this setting is selected.”
Authenticate
Debugging disabled at startup, only authenticated debugger can access
Trait Implementations
sourceimpl Clone for DebugSetting
impl Clone for DebugSetting
sourcefn clone(&self) -> DebugSetting
fn clone(&self) -> DebugSetting
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for DebugSetting
impl Debug for DebugSetting
sourceimpl Default for DebugSetting
impl Default for DebugSetting
sourcefn default() -> Self
fn default() -> Self
Set to enabled, so that lpc55 factory-settings
does not
turn off debugging on an otherwise empty key, unless explicitly
configured to be turned off.
It might be possible to set the default to Self::Default
here,
if we research whether its valid for some settings to stay
0 in both bits and also in the “inverted” section.
sourceimpl<'de> Deserialize<'de> for DebugSetting
impl<'de> Deserialize<'de> for DebugSetting
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl From<[bool; 2]> for DebugSetting
impl From<[bool; 2]> for DebugSetting
sourceimpl Hash for DebugSetting
impl Hash for DebugSetting
sourceimpl Ord for DebugSetting
impl Ord for DebugSetting
sourcefn cmp(&self, other: &DebugSetting) -> Ordering
fn cmp(&self, other: &DebugSetting) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl PartialEq<DebugSetting> for DebugSetting
impl PartialEq<DebugSetting> for DebugSetting
sourcefn eq(&self, other: &DebugSetting) -> bool
fn eq(&self, other: &DebugSetting) -> bool
sourceimpl PartialOrd<DebugSetting> for DebugSetting
impl PartialOrd<DebugSetting> for DebugSetting
sourcefn partial_cmp(&self, other: &DebugSetting) -> Option<Ordering>
fn partial_cmp(&self, other: &DebugSetting) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl Serialize for DebugSetting
impl Serialize for DebugSetting
impl Copy for DebugSetting
impl Eq for DebugSetting
impl StructuralEq for DebugSetting
impl StructuralPartialEq for DebugSetting
Auto Trait Implementations
impl RefUnwindSafe for DebugSetting
impl Send for DebugSetting
impl Sync for DebugSetting
impl Unpin for DebugSetting
impl UnwindSafe for DebugSetting
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.