From 93a789f87b808b4a9efb7b6420ce8a29c681c98a Mon Sep 17 00:00:00 2001 From: Wanderingss <1624155937@qq.com> Date: Sun, 20 Sep 2026 05:36:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=89=8D?= =?UTF-8?q?=E6=B8=85=E7=A9=BAFTL=20map=E6=A0=91=EF=BC=88nand=5Fftl=5Fforma?= =?UTF-8?q?t=EF=BC=89=EF=BC=9A=E6=A0=B9=E6=B2=BB=E6=96=B0=E6=97=A7?= =?UTF-8?q?=E6=A0=91=E6=B7=B7=E5=90=88=E8=87=B4=E5=A4=8D=E4=BD=8D=E5=90=8E?= =?UTF-8?q?FAT=E6=8E=A2=E9=92=88=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=87=8D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=AD=BB=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/freertos.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Src/freertos.c b/Src/freertos.c index c0c371a1..f2fb6477 100644 --- a/Src/freertos.c +++ b/Src/freertos.c @@ -233,6 +233,10 @@ void StartDefaultTask(void *argument) DBG_INFO("[FS] no FAT volume, formatting NAND..."); static uint8_t fs_work[FF_MAX_SS]; MKFS_PARM opts = { FM_FAT32, 0, 0, 0, 0 }; + /* 格式化前清空 FTL map 树(2026-09-20 台架实证:不清则 mkfs 经旧树 + * 写新卷 → on-disk 树残留旧节点/旧绑定 → 复位后 resume 混用新旧 → + * FAT 探针失败 → 无限重格式化) */ + (void)nand_ftl_format(); fr = f_mkfs("", &opts, fs_work, sizeof(fs_work)); if (fr == FR_OK) { fr = f_mount(&default_fatfs, "", 1); @@ -279,6 +283,8 @@ void StartDefaultTask(void *argument) DBG_INFO("[FS] volume FAT invalid (fr=%d), reformatting...", (int)hfr); f_mount(NULL, "", 0); + /* 格式化前清空 FTL map 树(同首启路径:防新旧树混合) */ + (void)nand_ftl_format(); { static uint8_t fs_work2[FF_MAX_SS]; MKFS_PARM opts2 = { FM_FAT32, 0, 0, 0, 0 };