Skip to content

Commit 6365877

Browse files
committed
Check erase 2 command is defined
1 parent 78f6e74 commit 6365877

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

firmware/fsmc_nand.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ uint32_t nand_erase_block(uint32_t page)
419419
break;
420420
}
421421

422-
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = fsmc_cmd.erase2_cmd;
422+
if (fsmc_cmd.erase2_cmd != 0xFF)
423+
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = fsmc_cmd.erase2_cmd;
423424

424425
return nand_get_status();
425426
}

0 commit comments

Comments
 (0)