Skip to content

Commit 8233402

Browse files
committed
Added bad block notification for write command
1 parent 81e00ec commit 8233402

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

firmware/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,13 @@ static int cmd_nand_write_data(usb_t *usb, prog_addr_t *prog_addr, page_t *page)
288288
if ((status = nand_write_page(page->buf, page->page,
289289
chip_info->page_size)) != NAND_READY)
290290
{
291-
return -1;
291+
if (nand_read_status() == NAND_ERROR)
292+
{
293+
if (send_bad_block_info(prog_addr->addr))
294+
return -1;
295+
}
296+
else
297+
return -1;
292298
}
293299

294300
prog_addr->addr += chip_info->page_size;

0 commit comments

Comments
 (0)