From b7e7aa3f9ab6fbf345e1400f05baf5481188f26a Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 8 Oct 2021 12:59:18 +0200 Subject: [PATCH] adiv5: Either use only LL functions in cortexm_initial_halt or no LL at all. Platform implementation may disturb ADIV5_AP_DRW and so low_read DHCSR may give values other from registers --- src/target/adiv5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index d337d1fa..429d6125 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -337,7 +337,7 @@ static uint32_t cortexm_initial_halt(ADIv5_AP_t *ap) while (!platform_timeout_is_expired(&to)) { uint32_t dhcsr ; if (use_low_access) { - adiv5_dp_write(ap->dp, ADIV5_DP_CTRLSTAT, + adiv5_dp_low_access(ap->dp, ADIV5_LOW_WRITE, ADIV5_DP_CTRLSTAT, ctrlstat | (0xfff * ADIV5_DP_CTRLSTAT_TRNCNT)); adiv5_dp_low_access(ap->dp, ADIV5_LOW_WRITE, ADIV5_AP_DRW, dhcsr_ctl);