stlink: separate stlink core from USB functions