Skip to content

Commit 08f2e25

Browse files
committed
Fixed address invalid error when whole flash is written
1 parent e9774f2 commit 08f2e25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

firmware/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ static int cmd_nand_write_end(prog_t *prog)
566566
{
567567
chip_info_t *chip_info = chip_info_selected_get();
568568

569+
if (!prog->page.offset)
570+
goto Exit;
571+
569572
if (!prog->addr_is_valid)
570573
{
571574
ERROR_PRINT("Write address is not set\r\n");
@@ -574,9 +577,6 @@ static int cmd_nand_write_end(prog_t *prog)
574577

575578
prog->addr_is_valid = 0;
576579

577-
if (!prog->page.offset)
578-
goto Exit;
579-
580580
if (nand_write(prog, chip_info))
581581
return make_error_status(&prog->usb, ERR_NAND_WR);
582582

0 commit comments

Comments
 (0)