This is an automated email from Gerrit. Tarek BOCHKATI ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/6065
-- gerrit commit 92ab281543d5fc52743b2d778716153920f211c8 Author: Tarek BOCHKATI <[email protected]> Date: Sun Feb 14 21:46:09 2021 +0100 flash/stm32l4x: add optional flash bank arguments for DBGMCU_IDCODE this is mainly to workaround an issue with some STM32WL5x early cuts, which cannot read the DBGMCU registers from AP1 (using the second core) Change-Id: Idb4ce8eeb765d964548248304049a33fc5bccc1e Signed-off-by: Tarek BOCHKATI <[email protected]> diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 63d2d31..a79f62a 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -538,7 +538,7 @@ static const struct stm32l4_part_info stm32l4_parts[] = { }, }; -/* flash bank stm32l4x <base> <size> 0 0 <target#> */ +/* flash bank stm32l4x <base> <size> 0 0 <target#> [mcu_idcode] */ FLASH_BANK_COMMAND_HANDLER(stm32l4_flash_bank_command) { struct stm32l4_flash_bank *stm32l4_info; @@ -563,6 +563,10 @@ FLASH_BANK_COMMAND_HANDLER(stm32l4_flash_bank_command) stm32l4_info->otp_enabled = false; stm32l4_info->user_bank_size = bank->size; + stm32l4_info->idcode = 0; + if (CMD_ARGC == 7) + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[6], stm32l4_info->idcode); + return ERROR_OK; } @@ -1476,13 +1480,16 @@ static int stm32l4_probe(struct flash_bank *bank) const struct stm32l4_part_info *part_info; uint16_t flash_size_kb = 0xffff; uint32_t device_id; + int retval; stm32l4_info->probed = false; - /* read stm32 device id registers */ - int retval = stm32l4_read_idcode(bank, &stm32l4_info->idcode); - if (retval != ERROR_OK) - return retval; + /* read stm32 device id registers, if not specified by the user */ + if (stm32l4_info->idcode == 0) { + retval = stm32l4_read_idcode(bank, &stm32l4_info->idcode); + if (retval != ERROR_OK) + return retval; + } device_id = stm32l4_info->idcode & 0xFFF; -- _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
