pub struct StLink<D: StLinkUsb> { /* private fields */ }
Expand description
An ST-Link debugger and programmer.
Implementations§
Source§impl<D: StLinkUsb> StLink<D>
impl<D: StLinkUsb> StLink<D>
Sourcepub fn set_swd_frequency(
&mut self,
frequency: SwdFrequencyToDelayCount,
) -> Result<(), DebugProbeError>
pub fn set_swd_frequency( &mut self, frequency: SwdFrequencyToDelayCount, ) -> Result<(), DebugProbeError>
sets the SWD frequency.
Sourcepub fn set_jtag_frequency(
&mut self,
frequency: JTagFrequencyToDivider,
) -> Result<(), DebugProbeError>
pub fn set_jtag_frequency( &mut self, frequency: JTagFrequencyToDivider, ) -> Result<(), DebugProbeError>
Sets the JTAG frequency.
Sourcepub fn start_trace_reception(
&mut self,
config: &SwoConfig,
) -> Result<(), DebugProbeError>
pub fn start_trace_reception( &mut self, config: &SwoConfig, ) -> Result<(), DebugProbeError>
Starts reading SWO trace data.
Sourcepub fn stop_trace_reception(&mut self) -> Result<(), DebugProbeError>
pub fn stop_trace_reception(&mut self) -> Result<(), DebugProbeError>
Stops reading SWO trace data.
Trait Implementations§
Source§impl DebugProbe for StLink<StLinkUsbDevice>
impl DebugProbe for StLink<StLinkUsbDevice>
Source§fn speed_khz(&self) -> u32
fn speed_khz(&self) -> u32
Get the currently used maximum speed for the debug protocol in kHz. Read more
Source§fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>
fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>
Set the speed in kHz used for communication with the target device. Read more
Source§fn set_scan_chain(
&mut self,
scan_chain: Vec<ScanChainElement>,
) -> Result<(), DebugProbeError>
fn set_scan_chain( &mut self, scan_chain: Vec<ScanChainElement>, ) -> Result<(), DebugProbeError>
Set the JTAG scan chain information for the target under debug. Read more
Source§fn scan_chain(&self) -> Result<&[ScanChainElement], DebugProbeError>
fn scan_chain(&self) -> Result<&[ScanChainElement], DebugProbeError>
Returns the JTAG scan chain
Source§fn target_reset(&mut self) -> Result<(), DebugProbeError>
fn target_reset(&mut self) -> Result<(), DebugProbeError>
This should hard reset the target device.
Source§fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>
fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>
This should assert the reset pin of the target via debug probe.
Source§fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>
fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>
This should deassert the reset pin of the target via debug probe.
Source§fn select_protocol(
&mut self,
protocol: WireProtocol,
) -> Result<(), DebugProbeError>
fn select_protocol( &mut self, protocol: WireProtocol, ) -> Result<(), DebugProbeError>
Selects the transport protocol to be used by the debug probe.
Source§fn active_protocol(&self) -> Option<WireProtocol>
fn active_protocol(&self) -> Option<WireProtocol>
Get the transport protocol currently in active use by the debug probe.
Source§fn get_swo_interface(&self) -> Option<&dyn SwoAccess>
fn get_swo_interface(&self) -> Option<&dyn SwoAccess>
Get a SWO interface from the debug probe. Read more
Source§fn get_swo_interface_mut(&mut self) -> Option<&mut dyn SwoAccess>
fn get_swo_interface_mut(&mut self) -> Option<&mut dyn SwoAccess>
Get a mutable SWO interface from the debug probe. Read more
Source§fn has_arm_interface(&self) -> bool
fn has_arm_interface(&self) -> bool
Check if the probe offers an interface to debug ARM chips.
Source§fn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>
fn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>
Boxes itself.
Source§fn try_get_arm_interface<'probe>(
self: Box<Self>,
) -> Result<Box<dyn UninitializedArmProbe + 'probe>, (Box<dyn DebugProbe>, DebugProbeError)>
fn try_get_arm_interface<'probe>( self: Box<Self>, ) -> Result<Box<dyn UninitializedArmProbe + 'probe>, (Box<dyn DebugProbe>, DebugProbeError)>
Get the dedicated interface to debug ARM chips. To check that the
probe actually supports this, call DebugProbe::has_arm_interface first.
Source§fn get_target_voltage(&mut self) -> Result<Option<f32>, DebugProbeError>
fn get_target_voltage(&mut self) -> Result<Option<f32>, DebugProbeError>
Reads the target voltage in Volts, if possible. Returns
Ok(None)
if the probe doesn’t support reading the target voltage.Source§fn select_jtag_tap(&mut self, index: usize) -> Result<(), DebugProbeError>
fn select_jtag_tap(&mut self, index: usize) -> Result<(), DebugProbeError>
Selects the JTAG TAP to be used for communication.
Source§fn try_get_riscv_interface_builder<'probe>(
&'probe mut self,
) -> Result<Box<dyn RiscvInterfaceBuilder<'probe> + 'probe>, DebugProbeError>
fn try_get_riscv_interface_builder<'probe>( &'probe mut self, ) -> Result<Box<dyn RiscvInterfaceBuilder<'probe> + 'probe>, DebugProbeError>
Try to get a
RiscvInterfaceBuilder
object, which can be used to set up a communication
interface with chips using the RISC-V architecture. Read moreSource§fn has_riscv_interface(&self) -> bool
fn has_riscv_interface(&self) -> bool
Check if the probe offers an interface to debug RISC-V chips.
Source§fn try_get_xtensa_interface<'probe>(
&'probe mut self,
_state: &'probe mut XtensaDebugInterfaceState,
) -> Result<XtensaCommunicationInterface<'probe>, DebugProbeError>
fn try_get_xtensa_interface<'probe>( &'probe mut self, _state: &'probe mut XtensaDebugInterfaceState, ) -> Result<XtensaCommunicationInterface<'probe>, DebugProbeError>
Get the dedicated interface to debug Xtensa chips. Ensure that the
probe actually supports this by calling DebugProbe::has_xtensa_interface first.
Source§fn has_xtensa_interface(&self) -> bool
fn has_xtensa_interface(&self) -> bool
Check if the probe offers an interface to debug Xtensa chips.
Source§fn try_as_dap_probe(&mut self) -> Option<&mut dyn DapProbe>
fn try_as_dap_probe(&mut self) -> Option<&mut dyn DapProbe>
Try creating a DAP interface for the given probe. Read more
Source§fn try_into_jlink(&mut self) -> Result<&mut JLink, DebugProbeError>
fn try_into_jlink(&mut self) -> Result<&mut JLink, DebugProbeError>
Try to get a J-Link interface from the debug probe.
Source§impl<D: StLinkUsb> SwoAccess for StLink<D>
impl<D: StLinkUsb> SwoAccess for StLink<D>
Source§fn enable_swo(&mut self, config: &SwoConfig) -> Result<(), ArmError>
fn enable_swo(&mut self, config: &SwoConfig) -> Result<(), ArmError>
Configure a SwoAccess interface for reading SWO data.
Source§fn disable_swo(&mut self) -> Result<(), ArmError>
fn disable_swo(&mut self) -> Result<(), ArmError>
Disable SWO reading on this SwoAccess interface.
Source§fn read_swo_timeout(&mut self, timeout: Duration) -> Result<Vec<u8>, ArmError>
fn read_swo_timeout(&mut self, timeout: Duration) -> Result<Vec<u8>, ArmError>
Read SWO data for up to
timeout
duration. Read moreSource§fn read_swo(&mut self) -> Result<Vec<u8>, ArmError>
fn read_swo(&mut self) -> Result<Vec<u8>, ArmError>
Read any available SWO data without waiting. Read more
Source§fn swo_poll_interval_hint(&mut self, config: &SwoConfig) -> Option<Duration>
fn swo_poll_interval_hint(&mut self, config: &SwoConfig) -> Option<Duration>
Request an estimated best time to wait between polls of
read_swo
. Read moreSource§fn swo_buffer_size(&mut self) -> Option<usize>
fn swo_buffer_size(&mut self) -> Option<usize>
Request the probe SWO buffer size, if known.
Auto Trait Implementations§
impl<D> Freeze for StLink<D>where
D: Freeze,
impl<D> RefUnwindSafe for StLink<D>where
D: RefUnwindSafe,
impl<D> Send for StLink<D>where
D: Send,
impl<D> Sync for StLink<D>where
D: Sync,
impl<D> Unpin for StLink<D>where
D: Unpin,
impl<D> UnwindSafe for StLink<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.