From 52fdf78cf3fdc9a8c8e86f012b968939b2f12319 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Sat, 16 Dec 2023 08:33:02 +0000 Subject: [PATCH] adiv5: Fixed a missing widening cast to legalise the AP ID readout shifting --- 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 6f8e9882396..137162f8091 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -373,7 +373,7 @@ static uint32_t adiv5_ap_read_id(adiv5_access_port_s *ap, uint32_t addr) uint8_t data[16]; adiv5_mem_read(ap, data, addr, sizeof(data)); for (size_t i = 0; i < 4U; ++i) - res |= (data[4U * i] << (i * 8U)); + res |= (uint32_t)data[4U * i] << (i * 8U); return res; }