]> git.gag.com Git - fw/openocd/commitdiff
Add a long delay between flash writes
authorKeith Packard <keithp@keithp.com>
Sun, 6 Nov 2022 04:28:44 +0000 (21:28 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 6 Nov 2022 04:28:44 +0000 (21:28 -0700)
Change-Id: I9be285320b31b71f0aace5f559195714609f461b
Signed-off-by: Keith Packard <keithp@keithp.com>
src/flash/nor/at91samd.c

index 45386dcba29d3e9544c8fcac8ab64190213cec43..cef84e5eba16cffe0a659d2a32c2064a53b07518 100644 (file)
@@ -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;