|
From: OpenOCD-Gerrit <ope...@us...> - 2022-10-08 07:52:58
|
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 af75d70dc5e6d83c57c6e8ee1a23ef9b472d2d52 (commit)
from 0cedf10f8fd618b78190ce32a40f26dec0fb8253 (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 af75d70dc5e6d83c57c6e8ee1a23ef9b472d2d52
Author: Keith Packard <ke...@ke...>
Date: Wed Sep 28 14:02:52 2022 -0700
flash/nor/at91samd: Use 32-bit register writes for ST-Link compat
ST-Link v2 dongles can be used with many cortex-m parts, but they have
one limitation -- they can only perform 8-bit and 32-bit writes to the
target. 16-bit writes are done using a pair of 8-bit writes. While not
usually an issue, in the case of the at91samd flash driver, the 16-bit
'command' register must have both halves written in the same
operation.
Fortunately, this register has two pad bytes above it in the address
space, making it safe to always access with 32-bit operations.
Change-Id: I44b0db9406982a8db5818c0533d3101618741db2
Signed-off-by: Keith Packard <ke...@ke...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7234
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c
index a0252a276..f213444d1 100644
--- a/src/flash/nor/at91samd.c
+++ b/src/flash/nor/at91samd.c
@@ -543,7 +543,8 @@ static int samd_issue_nvmctrl_command(struct target *target, uint16_t cmd)
}
/* Issue the NVM command */
- res = target_write_u16(target,
+ /* 32-bit write is used to ensure atomic operation on ST-Link */
+ res = target_write_u32(target,
SAMD_NVMCTRL + SAMD_NVMCTRL_CTRLA, SAMD_NVM_CMD(cmd));
if (res != ERROR_OK)
return res;
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/at91samd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|