jtag: for unknown IDCODE display a more complete error
This commit is contained in:
parent
0a43d1b797
commit
687503673e
15
src/jtag.cpp
15
src/jtag.cpp
|
|
@ -5,8 +5,10 @@
|
||||||
|
|
||||||
#include <libusb.h>
|
#include <libusb.h>
|
||||||
|
|
||||||
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -152,9 +154,16 @@ int Jtag::detectChain(int max_dev)
|
||||||
found = search_and_insert_device_with_idcode(tmp);
|
found = search_and_insert_device_with_idcode(tmp);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
char error[256];
|
uint16_t mfg = IDCODE2MANUFACTURERID(tmp);
|
||||||
snprintf(error, 256, "Unknown device with IDCODE: 0x%08x",
|
uint8_t part = IDCODE2PART(tmp);
|
||||||
tmp);
|
uint8_t vers = IDCODE2VERS(tmp);
|
||||||
|
|
||||||
|
char error[1024];
|
||||||
|
snprintf(error, sizeof(error),
|
||||||
|
"Unknown device with IDCODE: 0x%08x"
|
||||||
|
" (manufacturer: 0x%03x (%s),"
|
||||||
|
" part: 0x%02x vers: 0x%x", tmp,
|
||||||
|
mfg, list_manufacturer[mfg].c_str(), part, vers);
|
||||||
throw std::runtime_error(error);
|
throw std::runtime_error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue