Skip to main content

Host

Trait Host 

Source
pub trait Host<T> {
    // Required methods
    fn reset(&mut self, dtm: &mut T, halt: bool) -> Result<(), String>;
    fn program(
        &mut self,
        dtm: &mut T,
        segments: &[(u32, Vec<u8>)],
    ) -> Result<(), String>;
}
Expand description

en: What only the session’s owner can do to the target: reset it and write code flash. With one (Ch32Target::with_host) the server offers load (vFlash, with a memory map) and the monitor commands GDB front ends send to OpenOCD (reset halt, halt, reset, resume, gdb_sync). ja: session の持ち主にしかできないこと(target の reset と code flash の書き込み)。これがあると load(vFlash と memory map)と、GDB の front end が OpenOCD に送る monitor コマンドを受ける。

Required Methods§

Source

fn reset(&mut self, dtm: &mut T, halt: bool) -> Result<(), String>

en: Reset the target; with halt, hold it at its reset vector. ja: reset。halt なら reset vector で止める。

Source

fn program( &mut self, dtm: &mut T, segments: &[(u32, Vec<u8>)], ) -> Result<(), String>

en: Write segments (physical code-flash addresses, sorted, not overlapping) into code flash, erasing the pages they touch. The hart is halted. ja: code flash へ書く(hart は停止中)。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§