pub trait CoreInterface: MemoryInterface {
Show 33 methods // Required methods fn wait_for_core_halted(&mut self, timeout: Duration) -> Result<(), Error>; fn core_halted(&mut self) -> Result<bool, Error>; fn status(&mut self) -> Result<CoreStatus, Error>; fn halt(&mut self, timeout: Duration) -> Result<CoreInformation, Error>; fn run(&mut self) -> Result<(), Error>; fn reset(&mut self) -> Result<(), Error>; fn reset_and_halt( &mut self, timeout: Duration ) -> Result<CoreInformation, Error>; fn step(&mut self) -> Result<CoreInformation, Error>; fn read_core_reg( &mut self, address: RegisterId ) -> Result<RegisterValue, Error>; fn write_core_reg( &mut self, address: RegisterId, value: RegisterValue ) -> Result<(), Error>; fn available_breakpoint_units(&mut self) -> Result<u32, Error>; fn hw_breakpoints(&mut self) -> Result<Vec<Option<u64>>, Error>; fn enable_breakpoints(&mut self, state: bool) -> Result<(), Error>; fn set_hw_breakpoint( &mut self, unit_index: usize, addr: u64 ) -> Result<(), Error>; fn clear_hw_breakpoint(&mut self, unit_index: usize) -> Result<(), Error>; fn registers(&self) -> &'static CoreRegisters; fn program_counter(&self) -> &'static CoreRegister; fn frame_pointer(&self) -> &'static CoreRegister; fn stack_pointer(&self) -> &'static CoreRegister; fn return_address(&self) -> &'static CoreRegister; fn hw_breakpoints_enabled(&self) -> bool; fn architecture(&self) -> Architecture; fn core_type(&self) -> CoreType; fn instruction_set(&mut self) -> Result<InstructionSet, Error>; fn fpu_support(&mut self) -> Result<bool, Error>; fn floating_point_register_count(&mut self) -> Result<usize, Error>; fn reset_catch_set(&mut self) -> Result<(), Error>; fn reset_catch_clear(&mut self) -> Result<(), Error>; fn debug_core_stop(&mut self) -> Result<(), Error>; // Provided methods fn debug_on_sw_breakpoint(&mut self, _enabled: bool) -> Result<(), Error> { ... } fn on_session_stop(&mut self) -> Result<(), Error> { ... } fn enable_vector_catch( &mut self, _condition: VectorCatchCondition ) -> Result<(), Error> { ... } fn disable_vector_catch( &mut self, _condition: VectorCatchCondition ) -> Result<(), Error> { ... }
}
Expand description

A generic interface to control a MCU core.

Required Methods§

source

fn wait_for_core_halted(&mut self, timeout: Duration) -> Result<(), Error>

Wait until the core is halted. If the core does not halt on its own, a DebugProbeError::Timeout error will be returned.

source

fn core_halted(&mut self) -> Result<bool, Error>

Check if the core is halted. If the core does not halt on its own, a DebugProbeError::Timeout error will be returned.

source

fn status(&mut self) -> Result<CoreStatus, Error>

Returns the current status of the core.

source

fn halt(&mut self, timeout: Duration) -> Result<CoreInformation, Error>

Try to halt the core. This function ensures the core is actually halted, and returns a DebugProbeError::Timeout otherwise.

source

fn run(&mut self) -> Result<(), Error>

Continue to execute instructions.

source

fn reset(&mut self) -> Result<(), Error>

Reset the core, and then continue to execute instructions. If the core should be halted after reset, use the reset_and_halt function.

source

fn reset_and_halt( &mut self, timeout: Duration ) -> Result<CoreInformation, Error>

Reset the core, and then immediately halt. To continue execution after reset, use the reset function.

source

fn step(&mut self) -> Result<CoreInformation, Error>

Steps one instruction and then enters halted state again.

source

fn read_core_reg(&mut self, address: RegisterId) -> Result<RegisterValue, Error>

Read the value of a core register.

source

fn write_core_reg( &mut self, address: RegisterId, value: RegisterValue ) -> Result<(), Error>

Write the value of a core register.

source

fn available_breakpoint_units(&mut self) -> Result<u32, Error>

Returns all the available breakpoint units of the core.

source

fn hw_breakpoints(&mut self) -> Result<Vec<Option<u64>>, Error>

Read the hardware breakpoints from FpComp registers, and adds them to the Result Vector. A value of None in any position of the Vector indicates that the position is unset/available. We intentionally return all breakpoints, irrespective of whether they are enabled or not.

source

fn enable_breakpoints(&mut self, state: bool) -> Result<(), Error>

Enables breakpoints on this core. If a breakpoint is set, it will halt as soon as it is hit.

source

fn set_hw_breakpoint( &mut self, unit_index: usize, addr: u64 ) -> Result<(), Error>

Sets a breakpoint at addr. It does so by using unit bp_unit_index.

source

fn clear_hw_breakpoint(&mut self, unit_index: usize) -> Result<(), Error>

Clears the breakpoint configured in unit unit_index.

source

fn registers(&self) -> &'static CoreRegisters

Returns a list of all the registers of this core.

source

fn program_counter(&self) -> &'static CoreRegister

Returns the program counter register.

source

fn frame_pointer(&self) -> &'static CoreRegister

Returns the stack pointer register.

source

fn stack_pointer(&self) -> &'static CoreRegister

Returns the frame pointer register.

source

fn return_address(&self) -> &'static CoreRegister

Returns the return address register, a.k.a. link register.

source

fn hw_breakpoints_enabled(&self) -> bool

Returns true if hardware breakpoints are enabled, false otherwise.

source

fn architecture(&self) -> Architecture

Get the Architecture of the Core.

source

fn core_type(&self) -> CoreType

Get the CoreType of the Core

source

fn instruction_set(&mut self) -> Result<InstructionSet, Error>

Determine the instruction set the core is operating in This must be queried while halted as this is a runtime decision for some core types

source

fn fpu_support(&mut self) -> Result<bool, Error>

Determine if an FPU is present. This must be queried while halted as this is a runtime decision for some core types.

source

fn floating_point_register_count(&mut self) -> Result<usize, Error>

Determine the number of floating point registers. This must be queried while halted as this is a runtime decision for some core types.

source

fn reset_catch_set(&mut self) -> Result<(), Error>

Set the reset catch setting.

This configures the core to halt after a reset.

use reset_catch_clear to clear the setting again.

source

fn reset_catch_clear(&mut self) -> Result<(), Error>

Clear the reset catch setting.

This will reset the changes done by reset_catch_set.

source

fn debug_core_stop(&mut self) -> Result<(), Error>

Called when we stop debugging a core.

Provided Methods§

source

fn debug_on_sw_breakpoint(&mut self, _enabled: bool) -> Result<(), Error>

Configure the target to ensure software breakpoints will enter Debug Mode.

source

fn on_session_stop(&mut self) -> Result<(), Error>

Called during session stop to do any pending cleanup

source

fn enable_vector_catch( &mut self, _condition: VectorCatchCondition ) -> Result<(), Error>

Enables vector catching for the given condition

source

fn disable_vector_catch( &mut self, _condition: VectorCatchCondition ) -> Result<(), Error>

Disables vector catching for the given condition

Implementors§

source§

impl<'probe> CoreInterface for Armv7a<'probe>

source§

impl<'probe> CoreInterface for Armv7m<'probe>

source§

impl<'probe> CoreInterface for Armv8a<'probe>

source§

impl<'probe> CoreInterface for Armv8m<'probe>

source§

impl<'probe> CoreInterface for Riscv32<'probe>

source§

impl<'probe> CoreInterface for Xtensa<'probe>

source§

impl<'probe> CoreInterface for Core<'probe>