Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
SDIO总线
STM32F411CEU6 使用SDIO 1bit 挂载SD NAND文件系统 成功,列出一个细节问题
发布于 2025-01-17 21:32:17 浏览:36
订阅该版
搞了两天 STM32F411CEU6上挂载sd nand,终于成功了。 板子上使用的是sdio 1bit方式进行驱动,参考了很多博客教程,都遇到了不能挂载的问题。 提示如下 ``` \ | / - RT - Thread Operating System / | \ 4.0.5 build Jan 16 2025 21:31:48 2006 - 2021 Copyright by rt-thread team [D/drv.sdio] enable sdio irq [D/main] Hello RT-Thread! msh />[D/drv.sdio] clk:0 width:1 power:UP [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:0 ARG:0x00000000 RES:NONE rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000080 [00000000 00000000 00000000 00000000] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:8 ARG:0x000001aa RES:R7 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [000001AA 00000000 00000000 00000000] [D/drv.sdio] CMD:5 ARG:0x00000000 RES:R4 rw:- len:0 blksize:0 [D/drv.sdio] err:0x00000004, CTIMEOUT cmd:5 arg:0x00000000 rw:- len:0 blksize:0 [D/drv.sdio] CMD:55 ARG:0x00000000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00400120 00000000 00000000 00000000] [D/drv.sdio] CMD:41 ARG:0x00000000 RES:R3 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000001 [00FF8000 00000000 00000000 00000000] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:0 ARG:0x00000000 RES:NONE rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000080 [00FF8000 00000000 00000000 00000000] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:8 ARG:0x000001aa RES:R7 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [000001AA 00000000 00000000 00000000] [D/drv.sdio] CMD:55 ARG:0x00000000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000120 00000000 00000000 00000000] [D/drv.sdio] CMD:41 ARG:0x40018000 RES:R3 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000001 [00FF8000 00000000 00000000 00000000] [D/drv.sdio] CMD:55 ARG:0x00000000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000120 00000000 00000000 00000000] [D/drv.sdio] CMD:41 ARG:0x40018000 RES:R3 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000001 [80FF8000 00000000 00000000 00000000] [D/drv.sdio] CMD:2 ARG:0x00000000 RES:R2 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [1623454D 4B202020 C800014D 9AAA5570] [D/drv.sdio] CMD:3 ARG:0x00000000 RES:R6 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [21710500 4B202020 C800014D 9AAA5570] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:9 ARG:0x21710000 RES:R2 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [007F0032 535A80F0 6EBBFF9F 1680002A] [I/SDIO] SD card capacity 492544 KB. [D/drv.sdio] CMD:7 ARG:0x21710000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000700 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:55 ARG:0x21710000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000920 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:51 ARG:0x00000000 RES:R1 rw:r len:8 blksize:8 [D/drv.sdio] sta:0x00000500 [00000920 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:6 ARG:0x00fffff1 RES:R1 rw:r len:64 blksize:64 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:6 ARG:0x80fffff1 RES:R1 rw:r len:64 blksize:64 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] clk:1000000 width:1 power:ON [D/drv.sdio] CMD:55 ARG:0x21710000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000440 [00000920 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:6 ARG:0x00000002 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000440 [00000920 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] clk:1000000 width:4 power:ON [D/drv.sdio] CMD:16 ARG:0x00000200 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000440 [00000900 535A80F0 6EBBFF9F 1680002A] [D/SDIO] probe mmcsd block device! [D/drv.sdio] CMD:17 ARG:0x00000000 RES:R1 rw:r len:512 blksize:512 [D/drv.sdio] disable sdio irq [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] ``` 后来,猜测rtthread sdio驱动中有可能不是1bit通信,在drv_sdio.c中查找,最终确认了问题。 ``` #ifndef SDIO_USING_1_BIT host->flags = MMCSD_BUSWIDTH_4 | MMCSD_MUTBLKWRITE | MMCSD_SUP_SDIO_IRQ; #else host->flags = MMCSD_MUTBLKWRITE | MMCSD_SUP_SDIO_IRQ; #endif ``` 这里如果没有定义 `#define SDIO_USING_1_BIT` 那么默认使用4bit通信。 因此在board.h中必须启用sdio1bit ``` /** if you want to use sdio you can use the following instructions. * * STEP 1, open sdio driver framework support in the RT-Thread Settings file * * STEP 2, define macro related to the sdio * such as BSP_USING_SDIO * * STEP 3, copy your sdio init function from stm32xxxx_hal_msp.c generated by stm32cubemx to the end of board.c file * such as void HAL_SD_MspInit(SD_HandleTypeDef* hsd) * * STEP 4, modify your stm32xxxx_hal_config.h file to support sdio peripherals. define macro related to the peripherals * such as #define HAL_SD_MODULE_ENABLED * * STEP 5, config your device file system or another applications * */ #define SDIO_USING_1_BIT #define BSP_USING_SDIO ``` 成功后的打印信息如下 ``` \ | / - RT - Thread Operating System / | \ 4.0.5 build Jan 17 2025 21:11:19 2006 - 2021 Copyright by rt-thread team [D/drv.sdio] enable sdio irq [D/main] Hello RT-Thread! msh />[D/drv.sdio] clk:0 width:1 power:UP [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:0 ARG:0x00000000 RES:NONE rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000080 [00000000 00000000 00000000 00000000] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:8 ARG:0x000001aa RES:R7 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [000001AA 00000000 00000000 00000000] [D/drv.sdio] CMD:5 ARG:0x00000000 RES:R4 rw:- len:0 blksize:0 [D/drv.sdio] err:0x00000004, CTIMEOUT cmd:5 arg:0x00000000 rw:- len:0 blksize:0 [D/drv.sdio] CMD:55 ARG:0x00000000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00400120 00000000 00000000 00000000] [D/drv.sdio] CMD:41 ARG:0x00000000 RES:R3 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000001 [00FF8000 00000000 00000000 00000000] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:0 ARG:0x00000000 RES:NONE rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000080 [00FF8000 00000000 00000000 00000000] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:8 ARG:0x000001aa RES:R7 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [000001AA 00000000 00000000 00000000] [D/drv.sdio] CMD:55 ARG:0x00000000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000120 00000000 00000000 00000000] [D/drv.sdio] CMD:41 ARG:0x40018000 RES:R3 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000001 [00FF8000 00000000 00000000 00000000] [D/drv.sdio] CMD:55 ARG:0x00000000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000120 00000000 00000000 00000000] [D/drv.sdio] CMD:41 ARG:0x40018000 RES:R3 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000001 [80FF8000 00000000 00000000 00000000] [D/drv.sdio] CMD:2 ARG:0x00000000 RES:R2 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [1623454D 4B202020 C800014D 9AAA5570] [D/drv.sdio] CMD:3 ARG:0x00000000 RES:R6 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [21710500 4B202020 C800014D 9AAA5570] [D/drv.sdio] clk:400000 width:1 power:ON [D/drv.sdio] CMD:9 ARG:0x21710000 RES:R2 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [007F0032 535A80F0 6EBBFF9F 1680002A] [I/SDIO] SD card capacity 492544 KB. [D/drv.sdio] CMD:7 ARG:0x21710000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000700 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:55 ARG:0x21710000 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000040 [00000920 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:51 ARG:0x00000000 RES:R1 rw:r len:8 blksize:8 [D/drv.sdio] sta:0x00000500 [00000920 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:6 ARG:0x00fffff1 RES:R1 rw:r len:64 blksize:64 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] CMD:6 ARG:0x80fffff1 RES:R1 rw:r len:64 blksize:64 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] [D/drv.sdio] clk:1000000 width:1 power:ON [D/drv.sdio] CMD:16 ARG:0x00000200 RES:R1 rw:- len:0 blksize:0 [D/drv.sdio] sta:0x00000440 [00000900 535A80F0 6EBBFF9F 1680002A] [D/SDIO] probe mmcsd block device! [D/drv.sdio] CMD:17 ARG:0x00000000 RES:R1 rw:r len:512 blksize:512 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] found part[0], begin: 121344, size: 480.905MB ``` 可以看到最后打印出来分区信息了。 尝试挂载,也正常。 ``` msh />mount sd0 / elm mount device sd0(elm) onto / ... [D/drv.sdio] CMD:17 ARG:0x0001da00 RES:R1 rw:r len:512 blksize:512 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] succeed! msh /> msh /> msh /> msh />ls Directory /: [D/drv.sdio] CMD:17 ARG:0x0003c000 RES:R1 rw:r len:512 blksize:512 [D/drv.sdio] sta:0x00000500 [00000900 535A80F0 6EBBFF9F 1680002A] System Volume Inform
msh /> msh /> ``` 撤~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
查看更多
0
个回答
默认排序
按发布时间排序
暂无答案,快来添加答案吧
撰写答案
登录
注册新账号
关注者
0
被浏览
36
关于作者
Mr Wangdu
这家伙很懒,什么也没写!
提问
1
回答
0
被采纳
0
关注TA
发私信
相关问题
1
代码分享,stm32f407的sdio驱动。
2
求个在STM32F103 RTT上使用SDIO接口的例子
3
是否能增加一个 SDIO AP61xx 的驱动呢
4
sdio和fsmc驱动lcd冲突
5
发现了sdio_unregister_driver里的一个bug
6
用sdio框架驱动过w8801(wifi模块)的坛友请进(已解决)
7
关于rt-thread系统sdio驱动框架使用
8
问题请教,关于在rt-thread中调试RT1052中调试sdio wifi模块
9
【文件系统学习】+海中陆地+RT-Thread文件系统学习挂载SDIO...
10
sdio驱动是怎么使用的?也没有文档和例程啊
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
【RT-Thread】【ci】【scons】将ci.attachconfig.yml和scons结合使用
2
Rt-thread中OTA下载后,bootloader不搬程序
3
ulog 日志 LOG_HEX 输出时间改为本地日期时间
4
在RT-Thread Studio中构建前执行python命令
5
研究一了一段时间RTT,直接标准版上手太难,想用nano,但又舍不得组件
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
I2C_IIC
ESP8266
UART
WIZnet_W5500
ota在线升级
cubemx
PWM
flash
freemodbus
BSP
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
flashDB
GD32
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
xusiwei1236
8
个答案
2
次被采纳
踩姑娘的小蘑菇
1
个答案
2
次被采纳
用户名由3_15位
9
个答案
1
次被采纳
bernard
4
个答案
1
次被采纳
RTT_逍遥
3
个答案
1
次被采纳
本月文章贡献
聚散无由
2
篇文章
15
次点赞
catcatbing
2
篇文章
5
次点赞
Wade
2
篇文章
4
次点赞
Ghost_Girls
1
篇文章
7
次点赞
xiaorui
1
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部