diff --git a/src/target/adiv5.c b/src/target/adiv5.c index af6251a..961af57 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -294,9 +294,10 @@ static uint32_t adiv5_mem_read32(ADIv5_AP_t *ap, uint32_t addr) static uint32_t adiv5_ap_read_id(ADIv5_AP_t *ap, uint32_t addr) { uint32_t res = 0; + uint8_t data[16]; + adiv5_mem_read(ap, data, addr, sizeof(data)); for (int i = 0; i < 4; i++) { - uint32_t x = adiv5_mem_read32(ap, addr + 4 * i); - res |= (x & 0xff) << (i * 8); + res |= (data[4 * i] << (i * 8)); } return res; }