From: Keith Packard Date: Sun, 6 Nov 2022 04:28:44 +0000 (-0700) Subject: Add a long delay between flash writes X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=8b8613dd147c89b2cd867662e8e0264657834963;p=fw%2Fopenocd Add a long delay between flash writes Change-Id: I9be285320b31b71f0aace5f559195714609f461b Signed-off-by: Keith Packard --- 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;