pub struct JLink { /* private fields */ }
Expand description
A J-Link probe.
Implementations§
Source§impl JLink
impl JLink
Sourcepub fn read_swo_speeds(&self, mode: SwoMode) -> Result<SwoSpeedInfo, JlinkError>
pub fn read_swo_speeds(&self, mode: SwoMode) -> Result<SwoSpeedInfo, JlinkError>
Reads the probe’s SWO capture speed information.
This requires the probe to support Capability::Swo
.
Sourcepub fn swo_start(
&mut self,
mode: SwoMode,
speed: u32,
buf_size: u32,
) -> Result<(), JlinkError>
pub fn swo_start( &mut self, mode: SwoMode, speed: u32, buf_size: u32, ) -> Result<(), JlinkError>
Starts capturing SWO data.
This will switch the probe to SWD interface mode if necessary (required for SWO capture).
Requires the probe to support Capability::Swo
.
§Parameters
mode
: The SWO data encoding mode to use.speed
: The data rate to capture at (when usingSwoMode::Uart
, this is the UART baud rate).buf_size
: The size (in Bytes) of the on-device buffer to allocate for the SWO data.
Sourcepub fn swo_read<'a>(
&self,
data: &'a mut [u8],
) -> Result<SwoData<'a>, JlinkError>
pub fn swo_read<'a>( &self, data: &'a mut [u8], ) -> Result<SwoData<'a>, JlinkError>
Reads captured SWO data from the probe and writes it to data
.
This needs to be called regularly after SWO capturing has been started. If it is not called
often enough, the buffer on the probe will fill up and device data will be dropped. You can
call SwoData::did_overrun
to check for this condition.
Note: the probe firmware seems to dislike many short SWO reads (as in, the probe will fall off the bus and reset), so it is recommended to use a buffer that is the same size as the on-probe data buffer.
Source§impl JLink
impl JLink
Sourcepub fn capabilities(&self) -> Capabilities
pub fn capabilities(&self) -> Capabilities
Returns the supported J-Link capabilities.
Sourcepub fn read_max_mem_block(&self) -> Result<u32, JlinkError>
pub fn read_max_mem_block(&self) -> Result<u32, JlinkError>
Reads the maximum mem block size in Bytes.
This requires the probe to support Capability::GetMaxBlockSize
.
Sourcepub fn set_kickstart_power(&mut self, enable: bool) -> Result<(), JlinkError>
pub fn set_kickstart_power(&mut self, enable: bool) -> Result<(), JlinkError>
Enable/Disable the Target Power Supply of the probe.
This is not available on all J-Links.
Trait Implementations§
Source§impl DebugProbe for JLink
impl DebugProbe for JLink
Source§fn select_protocol(
&mut self,
protocol: WireProtocol,
) -> Result<(), DebugProbeError>
fn select_protocol( &mut self, protocol: WireProtocol, ) -> Result<(), DebugProbeError>
Source§fn active_protocol(&self) -> Option<WireProtocol>
fn active_protocol(&self) -> Option<WireProtocol>
Source§fn speed_khz(&self) -> u32
fn speed_khz(&self) -> u32
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>
Source§fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>
fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>
Source§fn select_jtag_tap(&mut self, index: usize) -> Result<(), DebugProbeError>
fn select_jtag_tap(&mut self, index: usize) -> Result<(), DebugProbeError>
Source§fn scan_chain(&self) -> Result<&[ScanChainElement], DebugProbeError>
fn scan_chain(&self) -> Result<&[ScanChainElement], DebugProbeError>
Source§fn target_reset(&mut self) -> Result<(), DebugProbeError>
fn target_reset(&mut self) -> Result<(), DebugProbeError>
Source§fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>
fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>
Source§fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>
fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>
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>
RiscvInterfaceBuilder
object, which can be used to set up a communication
interface with chips using the RISC-V architecture. Read moreSource§fn get_swo_interface(&self) -> Option<&dyn SwoAccess>
fn get_swo_interface(&self) -> Option<&dyn SwoAccess>
Source§fn get_swo_interface_mut(&mut self) -> Option<&mut dyn SwoAccess>
fn get_swo_interface_mut(&mut self) -> Option<&mut dyn SwoAccess>
Source§fn has_arm_interface(&self) -> bool
fn has_arm_interface(&self) -> bool
Source§fn has_riscv_interface(&self) -> bool
fn has_riscv_interface(&self) -> bool
Source§fn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>
fn into_probe(self: Box<Self>) -> Box<dyn DebugProbe>
Source§fn try_as_dap_probe(&mut self) -> Option<&mut dyn DapProbe>
fn try_as_dap_probe(&mut self) -> Option<&mut dyn DapProbe>
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)>
Source§fn get_target_voltage(&mut self) -> Result<Option<f32>, DebugProbeError>
fn get_target_voltage(&mut self) -> Result<Option<f32>, DebugProbeError>
Ok(None)
if the probe doesn’t support reading the target voltage.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>
Source§fn has_xtensa_interface(&self) -> bool
fn has_xtensa_interface(&self) -> bool
Source§fn try_into_jlink(&mut self) -> Result<&mut JLink, DebugProbeError>
fn try_into_jlink(&mut self) -> Result<&mut JLink, DebugProbeError>
Source§impl SwoAccess for JLink
impl SwoAccess for JLink
Source§fn enable_swo(&mut self, config: &SwoConfig) -> Result<(), ArmError>
fn enable_swo(&mut self, config: &SwoConfig) -> Result<(), ArmError>
Source§fn disable_swo(&mut self) -> Result<(), ArmError>
fn disable_swo(&mut self) -> Result<(), ArmError>
Source§fn swo_buffer_size(&mut self) -> Option<usize>
fn swo_buffer_size(&mut self) -> Option<usize>
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>
timeout
duration. Read moreAuto Trait Implementations§
impl Freeze for JLink
impl RefUnwindSafe for JLink
impl Send for JLink
impl Sync for JLink
impl Unpin for JLink
impl UnwindSafe for JLink
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
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,
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,
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,
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,
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,
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,
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,
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,
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>
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>
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<Probe> JTAGAccess for Probewhere
Probe: DebugProbe + RawJtagIo + 'static,
impl<Probe> JTAGAccess for Probewhere
Probe: DebugProbe + RawJtagIo + 'static,
Source§fn scan_chain(&mut self) -> Result<(), DebugProbeError>
fn scan_chain(&mut self) -> Result<(), DebugProbeError>
Source§fn set_idle_cycles(&mut self, idle_cycles: u8)
fn set_idle_cycles(&mut self, idle_cycles: u8)
Source§fn idle_cycles(&self) -> u8
fn idle_cycles(&self) -> u8
Source§fn read_register(
&mut self,
address: u32,
len: u32,
) -> Result<Vec<u8>, DebugProbeError>
fn read_register( &mut self, address: u32, len: u32, ) -> Result<Vec<u8>, DebugProbeError>
Source§fn write_register(
&mut self,
address: u32,
data: &[u8],
len: u32,
) -> Result<Vec<u8>, DebugProbeError>
fn write_register( &mut self, address: u32, data: &[u8], len: u32, ) -> Result<Vec<u8>, DebugProbeError>
Source§fn write_dr(
&mut self,
data: &[u8],
len: u32,
) -> Result<Vec<u8>, DebugProbeError>
fn write_dr( &mut self, data: &[u8], len: u32, ) -> Result<Vec<u8>, DebugProbeError>
Source§fn write_register_batch(
&mut self,
writes: &JtagCommandQueue,
) -> Result<DeferredResultSet, BatchExecutionError>
fn write_register_batch( &mut self, writes: &JtagCommandQueue, ) -> Result<DeferredResultSet, BatchExecutionError>
Source§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,
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,
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,
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
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
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
self
, then passes self.deref()
into the pipe function.Source§impl<Probe> RawDapAccess for Probewhere
Probe: DebugProbe + RawProtocolIo + JTAGAccess + 'static,
impl<Probe> RawDapAccess for Probewhere
Probe: DebugProbe + RawProtocolIo + JTAGAccess + 'static,
Source§fn raw_read_register(
&mut self,
port: PortType,
address: u8,
) -> Result<u32, ArmError>
fn raw_read_register( &mut self, port: PortType, address: u8, ) -> Result<u32, ArmError>
Source§fn raw_read_block(
&mut self,
port: PortType,
address: u8,
values: &mut [u32],
) -> Result<(), ArmError>
fn raw_read_block( &mut self, port: PortType, address: u8, values: &mut [u32], ) -> Result<(), ArmError>
Source§fn raw_write_register(
&mut self,
port: PortType,
address: u8,
value: u32,
) -> Result<(), ArmError>
fn raw_write_register( &mut self, port: PortType, address: u8, value: u32, ) -> Result<(), ArmError>
Source§fn raw_write_block(
&mut self,
port: PortType,
address: u8,
values: &[u32],
) -> Result<(), ArmError>
fn raw_write_block( &mut self, port: PortType, address: u8, values: &[u32], ) -> Result<(), ArmError>
Source§fn swj_pins(
&mut self,
pin_out: u32,
pin_select: u32,
pin_wait: u32,
) -> Result<u32, DebugProbeError>
fn swj_pins( &mut self, pin_out: u32, pin_select: u32, pin_wait: u32, ) -> Result<u32, DebugProbeError>
Source§fn into_probe(self: Box<Probe>) -> Box<dyn DebugProbe>
fn into_probe(self: Box<Probe>) -> Box<dyn DebugProbe>
DebugProbe
.Source§fn jtag_sequence(
&mut self,
bit_len: u8,
tms: bool,
bits: u64,
) -> Result<(), DebugProbeError>
fn jtag_sequence( &mut self, bit_len: u8, tms: bool, bits: u64, ) -> Result<(), DebugProbeError>
Source§fn swj_sequence(
&mut self,
bit_len: u8,
bits: u64,
) -> Result<(), DebugProbeError>
fn swj_sequence( &mut self, bit_len: u8, bits: u64, ) -> Result<(), DebugProbeError>
Source§fn core_status_notification(
&mut self,
_: CoreStatus,
) -> Result<(), DebugProbeError>
fn core_status_notification( &mut self, _: CoreStatus, ) -> Result<(), DebugProbeError>
CoreStatus
of the chip attached to the probe.Source§fn configure_jtag(&mut self, _skip_scan: bool) -> Result<(), DebugProbeError>
fn configure_jtag(&mut self, _skip_scan: bool) -> Result<(), DebugProbeError>
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
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
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
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
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
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
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
.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
.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
.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
.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
.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
.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
.tap_deref()
only in debug builds, and is erased in release
builds.