From 8b8613dd147c89b2cd867662e8e0264657834963 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 5 Nov 2022 21:28:44 -0700 Subject: [PATCH] Add a long delay between flash writes Change-Id: I9be285320b31b71f0aace5f559195714609f461b Signed-off-by: Keith Packard --- src/flash/nor/at91samd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c index 45386dcba..cef84e5eb 100644 --- a/src/flash/nor/at91samd.c +++ b/src/flash/nor/at91samd.c @@ -930,8 +930,6 @@ static int samd_write(struct flash_bank *bank, const uint8_t *buffer, if (manual_wp || pg_offset + 4 * nw < chip->page_size) { res = samd_issue_nvmctrl_command(bank->target, SAMD_NVM_CMD_WP); } else { - /* Access through AHB is stalled while flash is being programmed */ - usleep(1000); res = samd_check_error(bank->target); } @@ -941,6 +939,9 @@ static int samd_write(struct flash_bank *bank, const uint8_t *buffer, goto free_pb; } + /* Access through AHB is stalled while flash is being programmed */ + usleep(100000); + /* We're done with the page contents */ count -= nb; offset += nb; -- 2.47.2