293 Star 1.6K Fork 379

GVP合宙Luat / LuatOS

 / 详情

[🐛Bug]: esp32s3中的fatfs例程工作不正常

待办的
创建于  
2024-04-20 15:16

描述一下这个bug / Describe the bug

打算采用esp32s3的spi2来实现tf外扩存储的功能,先用fatfs中的例程测试,发现找不到tf卡,日志见下方。为了验证tf卡本身是否有问题,用手头的air105开发板去接tf卡和读卡电路,同样是fatfs的例程,是能工作正常的,往tf卡中写入了3个文件。请确认,esp32s3的fatfs例程是否能正常工作?esp32s3的固件是最新用云编译生成的

复现步骤 / To Reproduce

用esp32s3的开发板连tf卡座

如果正常,应该是什么样 / Expected behavior

截图 / Screenshots

日志 / Logs

[2024-04-20 15:06:24.389] D/vmheap Found 8192 kbyte PSRAM
[2024-04-20 15:06:24.389] D/vmheap Use 4096 kbyte PSRAM for Lua VM
[2024-04-20 15:06:24.389] I/main LuatOS@ESP32S3 base 23.11 bsp V1007 32bit
[2024-04-20 15:06:24.389] I/main ROM Build: Apr 18 2024 19:17:16
[2024-04-20 15:06:24.452] I/fs script zone as romfs
[2024-04-20 15:06:24.452] D/main loadlibs luavm 4194296 12640 13408
[2024-04-20 15:06:24.452] D/main loadlibs sys 8642912 4274940 4274964
[2024-04-20 15:06:25.483] D/fatfs init sdcard at spi=2 cs=14
[2024-04-20 15:06:25.483] E (2941) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.483] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.483] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.483]
[2024-04-20 15:06:25.483] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.483] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.483] I/user.fatfs err 3
[2024-04-20 15:06:25.483] E (2943) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.483] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.483] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.483]
[2024-04-20 15:06:25.483] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.483] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.483] D/fatfs f_open /boottime 3
[2024-04-20 15:06:25.483] D/vfs fopen /sd/boottime rb not found
[2024-04-20 15:06:25.483] I/user.fs boot count 0
[2024-04-20 15:06:25.483] E (2946) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.483] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.483] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.483]
[2024-04-20 15:06:25.483] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.483] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.483] D/fatfs f_open /boottime 3
[2024-04-20 15:06:25.483] D/vfs fopen /sd/boottime wb not found
[2024-04-20 15:06:25.483] W/user.sdio mount not good?!
[2024-04-20 15:06:25.483] I/user.fsstat true 456 0 512 spiffs
[2024-04-20 15:06:25.483] I/user.fsstat true 1639936464 558128182 512 fatfs
[2024-04-20 15:06:25.483] E (2950) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.483] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.483] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.483]
[2024-04-20 15:06:25.483] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.483] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.524] E (3002) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.524] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.524] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.524]
[2024-04-20 15:06:25.524] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.524] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.524] D/fatfs f_open /test_a 3
[2024-04-20 15:06:25.524] D/vfs fopen /sd/test_a w not found
[2024-04-20 15:06:25.524] E (3004) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.524] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.524] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.524]
[2024-04-20 15:06:25.524] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.524] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.524] D/fatfs f_open /test_a 3
[2024-04-20 15:06:25.524] D/vfs fopen /sd/test_a a+ not found
[2024-04-20 15:06:25.524] E (3007) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.524] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.524] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.524]
[2024-04-20 15:06:25.524] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.524] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.524] D/fatfs f_open /test_a 3
[2024-04-20 15:06:25.524] D/vfs fopen /sd/test_a r not found
[2024-04-20 15:06:25.524] E (3010) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.524] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.524] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.524]
[2024-04-20 15:06:25.524] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.524] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.596] D/fatfs f_open /testline 3
[2024-04-20 15:06:25.596] D/vfs fopen /sd/testline w not found
[2024-04-20 15:06:25.656] E (3113) spi_master: spi_bus_add_device(345): invalid host
[2024-04-20 15:06:25.656] E/SPI_TF cmd 0 arg 0 result -6
[2024-04-20 15:06:25.656] 40 00 00 00 00 95 FF FF FF FF FF FF FF FF
[2024-04-20 15:06:25.656]
[2024-04-20 15:06:25.656] D/SPI_TF sdcard init fail!
[2024-04-20 15:06:25.656] D/SPI_TF SDHC error, please reboot tf card
[2024-04-20 15:06:25.656] D/fatfs f_open /testline 3
[2024-04-20 15:06:25.656] D/vfs fopen /sd/testline r not found

PACK包版本 / Version

LuatOS-SoC_V1007_ESP32S3

验证

  • 检查过该问题,之前没有人提过 / Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 提供了最小可复现工程或详细的复现步骤,确保开发者可以复现 / The provided reproduction is a minimal reproducible example of the bug.
  • 已经提供了完整的报错信息、日志、截图,没有经过删减。

评论 (1)

天马流星 创建了任务

我昨天也想用esp32c3来读写tf卡,也是同样的问题,最新云编译的固件,后来搜到这个
[🐛Bug]: 使用fatfs的spi挂载sd卡,无法挂载(air101)
老问题了,还没修

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
863936 tranrran 1578934205
Lua
1
https://gitee.com/openLuat/LuatOS.git
git@gitee.com:openLuat/LuatOS.git
openLuat
LuatOS
LuatOS

搜索帮助