File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
270276impl Drop for Device {
Original file line number Diff line number Diff 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 ( ( ) )
You can’t perform that action at this time.
0 commit comments