cmsisDAP: modify order of backend autoselection
This commit is contained in:
parent
3e5fb18c67
commit
edafbf541f
|
|
@ -107,14 +107,6 @@ CmsisDAP::CmsisDAP(const cable_t &cable, int index, uint32_t clkHZ, int8_t verbo
|
|||
break;
|
||||
case BACKEND_AUTOSELECT:
|
||||
char t[256];
|
||||
try {
|
||||
_backend = BACKEND_HID;
|
||||
initWithHID(cable, index, verbose);
|
||||
break;
|
||||
} catch (std::runtime_error const& e) {
|
||||
snprintf(t, sizeof(t), "try HID init but failed with: %s", e.what());
|
||||
printInfo(t);
|
||||
}
|
||||
try {
|
||||
_backend = BACKEND_USBBULK;
|
||||
initWithBulk(cable, verbose);
|
||||
|
|
@ -123,6 +115,14 @@ CmsisDAP::CmsisDAP(const cable_t &cable, int index, uint32_t clkHZ, int8_t verbo
|
|||
snprintf(t, sizeof(t), "try USB bulk init but failed with: %s", e.what());
|
||||
printInfo(t);
|
||||
}
|
||||
try {
|
||||
_backend = BACKEND_HID;
|
||||
initWithHID(cable, index, verbose);
|
||||
break;
|
||||
} catch (std::runtime_error const& e) {
|
||||
snprintf(t, sizeof(t), "try HID init but failed with: %s", e.what());
|
||||
printInfo(t);
|
||||
}
|
||||
throw std::runtime_error("Error: no USB backend available");
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
*/
|
||||
|
||||
Jtag::Jtag(const cable_t &cable, const jtag_pins_conf_t *pin_conf,
|
||||
const std::string &dev, int backend,
|
||||
const std::string &dev,
|
||||
const std::string &serial, uint32_t clkHZ, int8_t verbose,
|
||||
const std::string &ip_adr, int port,
|
||||
const bool invert_read_edge, const std::string &firmware_path,
|
||||
|
|
@ -178,7 +178,7 @@ Jtag::Jtag(const cable_t &cable, const jtag_pins_conf_t *pin_conf,
|
|||
#endif
|
||||
case MODE_CMSISDAP:
|
||||
#ifdef ENABLE_CMSISDAP
|
||||
_jtag = new CmsisDAP(cable, cable.config.index, clkHZ, verbose, backend);
|
||||
_jtag = new CmsisDAP(cable, cable.config.index, clkHZ, verbose, BACKEND_AUTOSELECT);
|
||||
break;
|
||||
#else
|
||||
std::cerr << "Jtag: support for cmsisdap was not enabled at compile time" << std::endl;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
class Jtag {
|
||||
public:
|
||||
Jtag(const cable_t &cable, const jtag_pins_conf_t *pin_conf,
|
||||
const std::string &dev, int backend,
|
||||
const std::string &dev,
|
||||
const std::string &serial, uint32_t clkHZ, int8_t verbose,
|
||||
const std::string &ip_adr, int port,
|
||||
const bool invert_read_edge = false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue