pub struct Backdoor { /* private fields */ }Expand description
A struct which represents an active backdoor loader connection.
Implementations§
Source§impl Backdoor
impl Backdoor
Sourcepub fn new(
dmi: OpenOcdDmi,
jtag_speed_khz: u64,
enumerate: bool,
) -> Result<Self>
pub fn new( dmi: OpenOcdDmi, jtag_speed_khz: u64, enumerate: bool, ) -> Result<Self>
Construct a Backdoor from a DMI connection to the backdoor TAP. Optionally
enumerate and discover information about all available targets.
pub fn enumerate(&mut self) -> Result<()>
Sourcepub fn set_done(self) -> Result<()>
pub fn set_done(self) -> Result<()>
Communicate with the backdoor loader that we are finished using it.
This transitions the bkdr_loader from it from its “Preload” state to “Mission mode”, causing it to re-route incoming JTAG back to the regular downstream interface.
Sourcepub fn targets(&self) -> &[BackdoorTargetInfo]
pub fn targets(&self) -> &[BackdoorTargetInfo]
Retrieve information about all of the targets available via the backdoor interface.
Sourcepub fn target_by_id(&mut self, id: u32) -> Option<BackdoorTarget<'_>>
pub fn target_by_id(&mut self, id: u32) -> Option<BackdoorTarget<'_>>
Borrow a target by its integer identifier. Only one BackdoorTarget can exist at a time.
Sourcepub fn target_by_id_str(
&mut self,
id: &str,
) -> Result<Option<BackdoorTarget<'_>>>
pub fn target_by_id_str( &mut self, id: &str, ) -> Result<Option<BackdoorTarget<'_>>>
Borrow a target by its string identifier. Only one BackdoorTarget can exist at a time.
Sourcepub fn write_target(
&mut self,
target_index: u8,
start: u32,
words: &[Word],
write_all: bool,
check_status: bool,
) -> Result<()>
pub fn write_target( &mut self, target_index: u8, start: u32, words: &[Word], write_all: bool, check_status: bool, ) -> Result<()>
Write a sequence of words at a given offset (word index) to a specified target’s memory.
The write_all parameter is used to control whether writes can be optimized by
maintaining shadow CSRs to determine when register contents have actually changed.
The check_status parameter is used to control whether the status bit is polled
after all words are written, to check for any errors.
Sourcepub fn read_target(
&mut self,
target_index: u8,
start: u32,
count: u32,
check_status: bool,
) -> Result<Vec<Word>>
pub fn read_target( &mut self, target_index: u8, start: u32, count: u32, check_status: bool, ) -> Result<Vec<Word>>
Read a sequence of words at a given offset (word index) from a specified target’s memory.
The check_status parameter is used to control whether the status bit is polled
after each word read, to check for any errors.
Sourcepub fn clear_target(
&mut self,
target_index: u8,
word: &Word,
check_status: bool,
) -> Result<()>
pub fn clear_target( &mut self, target_index: u8, word: &Word, check_status: bool, ) -> Result<()>
Clear the entire memory of a specified target with a given word.
An optimized fast-path for clearing memories, primarily used to replicate existing
bitstream synthesis defaults. The check_status parameter is used to control
whether the status bit is polled after clearing, to check for any errors.