Skip to content

Commit d60a9b5

Browse files
committed
Added bad block notification for read command
1 parent 4c2b86f commit d60a9b5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

firmware/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,15 @@ static int cmd_nand_read(usb_t *usb)
394394
{
395395
status = nand_read_page(page.buf, page.page, chip_info->page_size);
396396
if (status != NAND_READY)
397-
goto Error;
397+
{
398+
if (nand_read_status() == NAND_ERROR)
399+
{
400+
if (send_bad_block_info(prog_addr.addr))
401+
goto Error;
402+
}
403+
else
404+
goto Error;
405+
}
398406

399407
while (page.offset < chip_info->page_size && read_cmd->len)
400408
{

0 commit comments

Comments
 (0)