X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstm32lx.c;h=b8b530624c60ec1c50bd822adadb5be0b3607675;hp=d36e518e9fa450a0f17919e09127731bb6789caa;hb=f97aafdfafb13d146cdcac31dca49d30b8b58edd;hpb=f132fcf636361009b4125827351ef01556d49b31 diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index d36e518e9f..b8b530624c 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -259,7 +259,7 @@ static int stm32lx_write_half_pages(struct flash_bank *bank, uint8_t *buffer, retval = target_write_buffer(target, write_algorithm->address, sizeof(stm32lx_flash_write_code), - (uint8_t *)stm32lx_flash_write_code); + stm32lx_flash_write_code); if (retval != ERROR_OK) { target_free_working_area(target, write_algorithm); return retval; @@ -550,6 +550,12 @@ static int stm32lx_probe(struct flash_bank *bank) first_bank_size_in_kb = 192; stm32lx_info->has_dual_banks = true; break; + case 0x437: + /* Dual bank, high density */ + max_flash_size_in_kb = 512; + first_bank_size_in_kb = 192; + stm32lx_info->has_dual_banks = true; + break; default: LOG_WARNING("Cannot identify target as a STM32L family."); return ERROR_FAIL; @@ -558,7 +564,8 @@ static int stm32lx_probe(struct flash_bank *bank) /* Get the flash size from target. 0x427 and 0x436 devices use a * different location for the Flash Size register, please see RM0038 r8 or * newer. */ - if ((device_id & 0xfff) == 0x427 || (device_id & 0xfff) == 0x436) + if ((device_id & 0xfff) == 0x427 || (device_id & 0xfff) == 0x436 || + (device_id & 0xfff) == 0x437) retval = target_read_u16(target, F_SIZE_MP, &flash_size_in_kb); else retval = target_read_u16(target, F_SIZE, &flash_size_in_kb); @@ -779,6 +786,10 @@ static int stm32lx_get_info(struct flash_bank *bank, char *buf, int buf_size) } break; + case 0x437: + device_str = "STM32L1xx (Medium+/High Density)"; + break; + default: snprintf(buf, buf_size, "Cannot identify target as a STM32L1"); return ERROR_FAIL;