硬汉嵌入式论坛

 找回密码
 立即注册
查看: 5382|回复: 3
收起左侧

[有问必答] 文件系统问题

[复制链接]

36

主题

70

回帖

178

积分

初级会员

积分
178
发表于 2015-5-12 08:20:33 | 显示全部楼层 |阅读模式
#define    _MAX_SS        512        /* 512, 1024, 2048 or 4096 */
/* Maximum sector size to be handled.
/  Always set 512 for memory card and hard disk but a larger value may be
/  required for on-board flash memory, floppy disk and optical disk.
/  When _MAX_SS is larger than 512, it configures FatFs to variable sector size
/  and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */


扇区的大小可以在这四个数字中选择吗?我用V3版本,将spi flash做成文件系统,能不能直接将扇区大小设置成4096,但我将其设定为4096的时候在底层驱动diskio.c中的读取一个扇区的函数中,读取后发现会进入硬件错误,是不是因为4096太大了,还是因为spi flash的缘故
回复

使用道具 举报

336

主题

2042

回帖

3055

积分

版主

Rank: 7Rank: 7Rank: 7

积分
3055
发表于 2015-5-12 09:46:00 | 显示全部楼层
我做的系统都比较小,没有用过文件系统.

内容来自[新鲜事]
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107374
QQ
发表于 2015-5-12 21:44:15 | 显示全部楼层
不是两个参数呢吗,设置下范围就行了。
#define    _MIN_SS        512
#define    _MAX_SS        4096
/* These options configure the range of sector size to be supported. (512, 1024, 2048 or
/  4096) Always set both 512 for most systems, all memory card and harddisk. But a larger
/  value may be required for on-board flash memory and some type of optical media.
/  When _MAX_SS is larger than _MIN_SS, FatFs is configured to variable sector size and
/  GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
回复

使用道具 举报

36

主题

70

回帖

178

积分

初级会员

积分
178
 楼主| 发表于 2015-6-19 13:27:46 | 显示全部楼层

回 eric2013 的帖子

eric2013:不是两个参数呢吗,设置下范围就行了。
#define    _MIN_SS        512
#define    _MAX_SS        4096
/* These options configure the range of se .. (2015-05-12 21:44) 
我的意思是,spiflash 4k为一个扇区,读取函数没问题。我在文件系统中的读取函数中,读取数据后,会进入硬件错误。我遇到过在堆栈空间不够时会出现这样的情况。不知道是不是这个问题造成的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-28 19:44 , Processed in 0.219623 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表