Skip to content

Commit 77c7a53

Browse files
committed
Fix k230_parse_toc to handle erased SPI-NAND TOC slots
1 parent d568654 commit 77c7a53

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

board/kendryte/common/k230_boot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,8 @@ static int k230_parse_toc(void *toc_buf)
695695
for (int i = 0; i < K230_TOC_MAX_ENTRIES; i++) {
696696
struct k230_toc_entry *dst = &toc.entries[toc.entry_count];
697697

698-
if (src->name[0] == '\0') {
698+
/* SPI-NAND keeps unwritten TOC slots erased as 0xff. */
699+
if ((src->name[0] == '\0') || ((u8)src->name[0] == 0xff)) {
699700
break;
700701
}
701702

0 commit comments

Comments
 (0)