cmsis-dap: Handle ADI DP22 devices on probes not multidrop capable.

This commit is contained in:
Uwe Bonnes 2021-04-26 17:55:45 +02:00 committed by UweBonnes
parent 923edc7f7e
commit f9414d5826
3 changed files with 9 additions and 6 deletions

View File

@ -426,6 +426,8 @@ int dap_swdptap_init(ADIv5_DP_t *dp)
/* DAP_SWD_SEQUENCE does not do auto turnaround, use own!*/
dp->dp_low_read = dap_dp_low_read;
dp->dp_low_write = dap_dp_low_write;
} else {
dp->error = dap_dp_error;
}
dp->seq_out = dap_swdptap_seq_out;
dp->seq_out_parity = dap_swdptap_seq_out_parity;

View File

@ -121,8 +121,6 @@ int platform_adiv5_swdp_scan(uint32_t targetid)
{
info.is_jtag = false;
platform_max_frequency_set(cl_opts.opt_max_swj_frequency);
if (targetid && (info.bmp_type != BMP_TYPE_BMP))
DEBUG_WARN("Ignoring TARGETID for now!\n");
switch (info.bmp_type) {
case BMP_TYPE_BMP:
case BMP_TYPE_LIBFTDI:

View File

@ -108,8 +108,9 @@ int adiv5_swdp_scan(uint32_t targetid)
uint32_t idcode = 0;
volatile uint32_t target_id;
bool is_v2 = true;
if (!targetid) {
/* Try to read ID */
if (!targetid || (initial_dp->error != firmware_swdp_error)) {
/* No targetID given on the command line or probe can not
* handle multi-drop. Try to read ID */
dp_line_reset(initial_dp);
volatile struct exception e;
TRY_CATCH (e, EXCEPTION_ALL) {
@ -147,9 +148,11 @@ int adiv5_swdp_scan(uint32_t targetid)
adiv5_dp_write(initial_dp, ADIV5_DP_CTRLSTAT, 0);
break;
}
if (!initial_dp->dp_low_read)
/* E.g. CMSIS_DAP < V1.2 can not handle multu-drop!*/
if (initial_dp->error != firmware_swdp_error) {
DEBUG_WARN("CMSIS_DAP < V1.2 can not handle multi-drop!\n");
/* E.g. CMSIS_DAP < V1.2 can not handle multi-drop!*/
is_v2 = false;
}
} else {
is_v2 = false;
}