From ce273889fc5b382578ff88a4a06686b6b1a8b274 Mon Sep 17 00:00:00 2001 From: James Turton Date: Tue, 14 Jun 2022 17:20:59 +0300 Subject: [PATCH] rp: Refector rp_flash_write Fix typo in debug message --- src/target/rp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/target/rp.c b/src/target/rp.c index e828a5a..f1ac428 100644 --- a/src/target/rp.c +++ b/src/target/rp.c @@ -277,15 +277,15 @@ static int rp_flash_write(struct target_flash *f, target_addr dest, const void *src, size_t len) { DEBUG_INFO("RP Write 0x%08" PRIx32 " len 0x%" PRIx32 "\n", dest, (uint32_t)len); + target *t = f->t; if ((dest & 0xff) || (len & 0xff)) { - DEBUG_WARN("Unaligned erase\n"); + DEBUG_WARN("Unaligned write\n"); return -1; } - target *t = f->t; - rp_flash_prepare(t); + dest -= t->flash->start; struct rp_priv_s *ps = (struct rp_priv_s*)t->target_storage; /* Write payload to target ram */ - dest -= XIP_FLASH_START; + rp_flash_prepare(t); bool ret = 0; #define MAX_WRITE_CHUNK 0x1000 while (len) {