diff --git a/src/platforms/hosted/cmsis_dap.c b/src/platforms/hosted/cmsis_dap.c index 6c58578e..4d2bb0bd 100644 --- a/src/platforms/hosted/cmsis_dap.c +++ b/src/platforms/hosted/cmsis_dap.c @@ -47,7 +47,7 @@ uint8_t mode; /*- Variables ---------------------------------------------------------------*/ static hid_device *handle = NULL; static uint8_t hid_buffer[1024 + 1]; -static int report_size = 512 + 1; // TODO: read actual report size +static int report_size = 64 + 1; // TODO: read actual report size /* LPC845 Breakout Board Rev. 0 report invalid response with > 65 bytes */ int dap_init(bmp_info_t *info) { @@ -129,14 +129,7 @@ static uint32_t dap_dp_low_access(struct ADIv5_DP_s *dp, uint8_t RnW, static uint32_t dap_dp_read_reg(ADIv5_DP_t *dp, uint16_t addr) { - uint32_t res; - if (addr & ADIV5_APnDP) { - dap_dp_low_access(dp, ADIV5_LOW_READ, addr, 0); - res = dap_dp_low_access(dp, ADIV5_LOW_READ, - ADIV5_DP_RDBUFF, 0); - } else { - res = dap_dp_low_access(dp, ADIV5_LOW_READ, addr, 0); - } + uint32_t res = dap_dp_low_access(dp, ADIV5_LOW_READ, addr, 0); DEBUG_PROBE("dp_read %04x %08" PRIx32 "\n", addr, res); return res; } diff --git a/src/platforms/hosted/dap.c b/src/platforms/hosted/dap.c index 73bf3c0a..0f0efee8 100644 --- a/src/platforms/hosted/dap.c +++ b/src/platforms/hosted/dap.c @@ -394,7 +394,7 @@ unsigned int dap_read_block(ADIv5_AP_t *ap, void *dest, uint32_t src, buf[2] = sz & 0xff; buf[3] = (sz >> 8) & 0xff; buf[4] = SWD_AP_DRW | DAP_TRANSFER_RnW; - dbg_dap_cmd(buf, 1023, 5 + 1); + dbg_dap_cmd(buf, 1023, 5); unsigned int transferred = buf[0] + (buf[1] << 8); if (buf[2] >= DAP_TRANSFER_FAULT) { DEBUG_WARN("dap_read_block @ %08" PRIx32 " fault -> line reset\n", src);