debug(fat32): dir_find 打印 sfn_from_lfn 生成的 11 字节 hex——hello.elf 的 sfn 显示为 H(sfn[1]=0x00),定位 sfn 生成被破坏

This commit is contained in:
TermiNexus committed 2026-08-27 01:21:15 +08:00
1 parent f8ad5b7176
commit f6154bfed3
1 file changed
+6
@@ -719,6 +719,12 @@ class volinfo:
def dir_find(self, dp: dirobj | t.CPtr, name: t.CConst | t.CChar | t.CPtr, lfn_buf: t.CUInt16T | t.CPtr) -> FRESULT:
sfn: t.CArray[t.CChar, 12]
sfn_from_lfn(name, c.Addr(sfn[0]))
# [DIAG] sfn 生成字节 hex(hello.elf 应 HELLO..ELF,异常时显示 sfn=H)
_dbhs: t.CArray[t.CChar, 64]
viperlib.snprintf(c.Addr(_dbhs), 64, "[sfn] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
sfn[0], sfn[1], sfn[2], sfn[3], sfn[4], sfn[5],
sfn[6], sfn[7], sfn[8], sfn[9], sfn[10])
serial.puts(c.Addr(_dbhs))
_dbg_sfn: t.CArray[t.CChar, 16]
_si: t.CInt
for _si in range(11):