Skip to main content

select_base

Function select_base 

Source
pub fn select_base<C: CommandFactory>(tag: &Tag, args: &BaseArgs) -> UsbDev
Expand description

Finds the ST-LINK the arguments select, or exits.

With one base connected and no --base, that base is used. Otherwise --base bus:device must name one: a malformed value prints the help and exits 1, and no match exits 1 with “No matching device”. With no base connected it exits 1 with “No matching device” too. C is the tool’s clap parser, whose help is printed.

Only USB enumeration happens here; nothing is sent to the base or tag.