diff --git a/src/target/adiv5.c b/src/target/adiv5.c index dd2b1f0fad5..880e240bad9 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -581,19 +581,21 @@ static void adiv5_component_probe( designer_code = (pidr & PIDR_JEP106_CONT_MASK) >> (PIDR_JEP106_CONT_OFFSET - 8U) | (pidr & PIDR_JEP106_CODE_MASK) >> PIDR_JEP106_CODE_OFFSET; - if (designer_code == JEP106_MANUFACTURER_ERRATA_STM32WX || designer_code == JEP106_MANUFACTURER_ERRATA_CS) { - /** - * see 'JEP-106 code list' for context, here we are aliasing codes that are non compliant with the - * JEP-106 standard to their expected codes, this is later used to determine the correct probe function. - */ - DEBUG_WARN("Patching Designer code 0x%03" PRIx16 " -> 0x%03u\n", designer_code, JEP106_MANUFACTURER_STM); - designer_code = JEP106_MANUFACTURER_STM; - } } else { /* legacy ascii code */ designer_code = (pidr & PIDR_JEP106_CODE_MASK) >> PIDR_JEP106_CODE_OFFSET | ASCII_CODE_FLAG; } + if (designer_code == JEP106_MANUFACTURER_ERRATA_STM32WX || designer_code == JEP106_MANUFACTURER_ERRATA_CS || + designer_code == JEP106_MANUFACTURER_ERRATA_CS_ASCII) { + /** + * see 'JEP-106 code list' for context, here we are aliasing codes that are non compliant with the + * JEP-106 standard to their expected codes, this is later used to determine the correct probe function. + */ + DEBUG_WARN("Patching Designer code %03x -> %03x\n", designer_code, JEP106_MANUFACTURER_STM); + designer_code = JEP106_MANUFACTURER_STM; + } + /* Extract part number from the part id register. */ const uint16_t part_number = pidr & PIDR_PN_MASK; @@ -622,8 +624,9 @@ static void adiv5_component_probe( DEBUG_ERROR("Fault reading ROM table entry\n"); else if (memtype) ap->flags |= ADIV5_AP_FLAGS_HAS_MEM; - DEBUG_INFO("ROM: Table BASE=0x%" PRIx32 " SYSMEM=%u, Manufacturer %03x Partno %03x\n", addr, memtype, - designer_code, part_number); + DEBUG_INFO("ROM: Table BASE=0x%" PRIx32 " SYSMEM=%u, Manufacturer %03x Partno %03x (PIDR = 0x%08" PRIx32 + "%08" PRIx32 ")\n", + addr, memtype, designer_code, part_number, (uint32_t)(pidr >> 32), (uint32_t)pidr); for (uint32_t i = 0; i < 960U; i++) { adiv5_dp_error(ap->dp); diff --git a/src/target/jep106.h b/src/target/jep106.h index 659f016928d..f9225067151 100644 --- a/src/target/jep106.h +++ b/src/target/jep106.h @@ -79,7 +79,8 @@ * This code is not listed in the JEP106 standard, but is used by some stm32f1 clones * since we're not using this code elsewhere let's switch to the stm code. */ -#define JEP106_MANUFACTURER_ERRATA_CS 0x555U +#define JEP106_MANUFACTURER_ERRATA_CS 0x555U +#define JEP106_MANUFACTURER_ERRATA_CS_ASCII 0x8055U /* * CPU2 for STM32W(L|B) uses ARM's JEP-106 continuation code (4) instead of