Skip to content

Commit 4468292

Browse files
committed
Add Debug USB mode
Signed-off-by: Sven Peter <[email protected]>
1 parent 9a23e62 commit 4468292

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/cd321x.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ impl Device {
265265
}
266266
self.dven(&vdos[1..2])
267267
}
268+
269+
pub(crate) fn debugusb(&mut self) -> Result<()> {
270+
let vdos: [u32; 2] = [0x5ac8012, 0x1824606];
271+
info!("Putting target into DebugUSB mode...");
272+
self.vdms(VdmSopType::SopStar, &vdos)
273+
}
268274
}
269275

270276
impl Drop for Device {

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn vdmtool() -> Result<()> {
5050
clap::Command::new("reboot serial").about("reboot the target and enter serial mode"),
5151
)
5252
.subcommand(clap::Command::new("serial").about("enter serial mode on both ends"))
53+
.subcommand(clap::Command::new("debugusb").about("enter Debug USB mode on target"))
5354
.subcommand(clap::Command::new("dfu").about("put the target into DFU mode"))
5455
.subcommand(clap::Command::new("nop").about("Do nothing"))
5556
.arg_required_else_help(true)
@@ -91,6 +92,9 @@ fn vdmtool() -> Result<()> {
9192
Some(("serial", _)) => {
9293
device.serial()?;
9394
}
95+
Some(("debugusb", _)) => {
96+
device.debugusb()?;
97+
}
9498
_ => {}
9599
}
96100
Ok(())

0 commit comments

Comments
 (0)