X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstm32f2x.c;h=eab19348cfda4c4f0ea7458c1dc0ec58cf1b8009;hb=b9cb2027b327461030321020af54956c03716b6d;hp=a7aba2b3bd98190d1b13cb0a08b46b89d836a9b9;hpb=f9b673322ce0958d530066434a2d21ea1c1710de;p=openocd.git diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index a7aba2b3bd..eab19348cf 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -258,7 +258,7 @@ static int stm32x_unlock_reg(struct target *target) return retval; if (ctrl & FLASH_LOCK) { - LOG_ERROR("flash not unlocked STM32_FLASH_CR: %x", ctrl); + LOG_ERROR("flash not unlocked STM32_FLASH_CR: %" PRIx32, ctrl); return ERROR_TARGET_FAILURE; } @@ -290,7 +290,7 @@ static int stm32x_unlock_option_reg(struct target *target) return retval; if (ctrl & OPT_LOCK) { - LOG_ERROR("options not unlocked STM32_FLASH_OPTCR: %x", ctrl); + LOG_ERROR("options not unlocked STM32_FLASH_OPTCR: %" PRIx32, ctrl); return ERROR_TARGET_FAILURE; } @@ -481,7 +481,7 @@ static int stm32x_protect(struct flash_bank *bank, int set, int first, int last) return ERROR_OK; } -static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer, +static int stm32x_write_block(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; @@ -541,7 +541,7 @@ static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer, retval = target_write_buffer(target, write_algorithm->address, sizeof(stm32x_flash_write_code), - (uint8_t *)stm32x_flash_write_code); + stm32x_flash_write_code); if (retval != ERROR_OK) return retval; @@ -589,7 +589,7 @@ static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer, LOG_ERROR("flash memory write protected"); if (error != 0) { - LOG_ERROR("flash write failed = %08x", error); + LOG_ERROR("flash write failed = %08" PRIx32, error); /* Clear but report errors */ target_write_u32(target, STM32_FLASH_SR, error); retval = ERROR_FAIL; @@ -608,7 +608,7 @@ static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer, return retval; } -static int stm32x_write(struct flash_bank *bank, uint8_t *buffer, +static int stm32x_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; @@ -779,6 +779,9 @@ static int stm32x_probe(struct flash_bank *bank) case 0x423: max_flash_size_in_kb = 256; break; + case 0x433: + max_flash_size_in_kb = 512; + break; default: LOG_WARNING("Cannot identify target as a STM32 family."); return ERROR_FAIL; @@ -927,6 +930,7 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size) break; case 0x423: + case 0x433: device_str = "STM32F4xx (Low Power)"; switch (rev_id) {