|
rt_thread1.2.0版本 ,bsp里面的lpc1768的例程。
SSP0作SPI驱动SD卡。
引脚改为,/* P0.16 SSEL (used as GPIO) */,/* P0.15 SCK0 */,/* P0.17 MISO0, P0.18 MOSI0 */。
SD卡初始化成功,然后File System init failed!
调试发现,问题出在这里:
/* mount sd card fat partition 1 as root directory */
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
rt_kprintf("File System initialized!\n");
else
rt_kprintf("File System init failed!\n");
跟踪到dfs_mount("sd0", "/", "elm", 0, 0) 里面,发现是这里返回了:
/* call mount of this filesystem */
if ((*ops)->mount(fs, rwflag, data) < 0)
{
/* close device */
if (dev_id != RT_NULL)
rt_device_close(fs->dev_id);
/* mount failed */
dfs_lock();
/* clear filesystem table entry */
rt_memset(fs, 0, sizeof(struct dfs_filesystem));
rt_kprintf("call mount of this filesystem.\n");
goto err1;
}
为什么呢??问题出在哪里了?? |
|