From: OpenOCD-Gerrit <ope...@us...> - 2022-03-12 09:33:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 57c1e491801c6e67cb8b429bcf5c0ecf1bcef27b (commit) from 2586fec922ae9ea9bea345f40598e0367934d22c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 57c1e491801c6e67cb8b429bcf5c0ecf1bcef27b Author: Tomas Vanek <va...@fb...> Date: Tue Nov 16 17:10:12 2021 +0100 flash/stm32f1x,f2x: fix endianess in slow fallback flash write Use target_write_memory() instead of target_write_u16() Change-Id: I2389fe7a5fa18c9bc9c1aad8b8ddd64608bf2566 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/6705 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c index 29a3b7e06..6972bae2d 100644 --- a/src/flash/nor/stm32f1x.c +++ b/src/flash/nor/stm32f1x.c @@ -592,10 +592,7 @@ static int stm32x_write(struct flash_bank *bank, const uint8_t *buffer, LOG_WARNING("couldn't use block writes, falling back to single memory accesses"); while (words_remaining > 0) { - uint16_t value; - memcpy(&value, buffer, sizeof(uint16_t)); - - retval = target_write_u16(target, bank->base + offset, value); + retval = target_write_memory(target, bank->base + offset, 2, 1, buffer); if (retval != ERROR_OK) goto reset_pg_and_lock; diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index 58edca7e1..622ef3423 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -856,15 +856,12 @@ static int stm32x_write(struct flash_bank *bank, const uint8_t *buffer, Wait for the BSY bit to be cleared */ while (words_remaining > 0) { - uint16_t value; - memcpy(&value, buffer + bytes_written, sizeof(uint16_t)); - retval = target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_CR), FLASH_PG | FLASH_PSIZE_16); if (retval != ERROR_OK) return retval; - retval = target_write_u16(target, address, value); + retval = target_write_memory(target, address, 2, 1, buffer + bytes_written); if (retval != ERROR_OK) return retval; ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32f1x.c | 5 +---- src/flash/nor/stm32f2x.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |