各位大侠,请教一个TFFS的问题。

st311 2008-03-21 12:01:14
在flash中创建TFFS(没有bootrom),添加组件后,tffsShow显示id正确。

1。
usrTffsConfig(0,0,“tffs0”)返回-1。

sysTffsFormat返回-1。

问题出在sysTffsFormat上,我打印调试信息发现,在写文件系统信息时跨了几个扇区写的,比如:
扇区大小是:0x20000
sector 0:在0xc0000000处写了几十字节的信息,在0xc0004000的地方写了几个字节的信息
sector 1:在0xc0002000处写了几十字节的信息,在0xc0006000的地方写了几个字节的信息
sector 2:在0xc0004000处写了几十字节的信息,此处写的时候就出现问题,返回错误了。

请问,format的时候,写信息内容的区域是由什么参数控制的?是在每个扇区头都写吗?


2。看过系统文件中各种类型的sysTffs.c文件,有的是SIMM,有的是DIMM,有的是RFA的,他们有什么区别?可以随便用吗?我用AMD spansion的S29GL系列flash应该用哪一种呢?

3。FLASH_BASE_ADDR和FLASH_SIZE两个宏除了在register函数和setwindowsize函数里用到外,其他地方有没有调用?
这两个宏与config.h中BOOT FLASH的定义重复了。我在sysTffs.c中将这两个宏改了名字,不知道会不会影响到其他地方?

4.syslib.c文件中的内存映射表需要改什么吗?已经包含了FLASH的映射,但宏定义是和sysTffs.c中的不一样,不知道有没有影响,测试map函数可以正常转换地址的。

谢谢!
...全文
517 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
meiZiNick 2008-04-30
  • 打赏
  • 举报
回复
这个简单啊,网上搜一下就得到答案了.
netksks 2008-03-21
  • 打赏
  • 举报
回复
I am learning ,so I cann't tell you,but interesting to it.
heileonback 2008-03-21
  • 打赏
  • 举报
回复
我最近也在做TFFS
用在NAND FLASH上
不过tffsDevCreate()不能成功...

和楼主一样
启动后tffsShow可以得到正确的信息,
usrTffsConfig 运行到tffsDevCreate()就不正确了,创建设备失败
sysTffsFormat 也是返回-1;

希望哪位大侠能指条道,看看问题出在哪里...谢谢
Table of Contents 1 Introduction ...................................................................................................... 4 1.1 Scope ................................................................................................................... 4 1.2 Background ......................................................................................................... 4 1.3 Overview ............................................................................................................. 4 1.4 Implemented File Functionality ......................................................................... 5 1.4.1 Basic ............................................................................................................................... 5 1.4.2 Access Attributes ............................................................................................................ 5 1.4.3 Protective Mode .............................................................................................................. 7 1.4.4 Access Monitor ............................................................................................................... 7 1.5 Disk Usage Saturation ........................................................................................ 7 2 Application Programming Interfaces (APIs) .................................................. 9 2.1 The TFFS Protection Application Programming Interface (TP-API) ................ 9 2.1.1 TFFS Usage Protection .................................................................................................. 9 2.1.1.1 Pseudo Code Example .......................................................................................... 9 2.1.1.2 Posix Code Example ............................................................................................ 10 2.1.1.3 sig_semRead ....................................................................................................... 11 2.1.1.4 sig_semWrite ....................................................................................................... 11 2.1.1.5 wai_semRead ...................................................................................................... 11 2.1.1.6 wai_semWrite....................................................................................................... 11 2.1.2 Protective Mode Application Programming Interface ................................................... 11 2.1.3 Monitor Protection Application Programming Interface ................................................ 11 2.2 The TFFS User Application Programming Interface (TU-API) ....................... 13 2.2.1 tffsChange .................................................................................................................... 13 2.2.2 tffsChdir ........................................................................................................................ 14 2.2.3 tffsClearerr .................................................................................................................... 14 2.2.4 tffsDelete ....................................................................................................................... 15 2.2.5 tffsDiagMode ................................................................................................................. 15 2.2.6 tffsExists ....................................................................................................................... 16 2.2.7 tffsFclose ...................................................................................................................... 16 2.2.8 tffsFeof .......................................................................................................................... 17 2.2.9 tffsFerror ....................................................................................................................... 17 2.2.10 tffsFflush ....................................................................................................................... 17 2.2.11 tffsFopen ....................................................................................................................... 18 2.2.12 tffsFormat ...................................................................................................................... 19 2.2.13 tffsFread ........................................................................................................................ 20 2.2.14 tffsFseek ....................................................................................................................... 20 2.2.15 tffsFwrite ....................................................................................................................... 21 2.2.16 tffsGetBlockInfo ............................................................................................................ 21 2.2.17 tffsGetPath .................................................................................................................... 22 2.2.18 tffsGetRoot .................................................................................................................... 22 2.2.19 tffsInit ............................................................................................................................ 22 2.2.20 tffsLsdir ......................................................................................................................... 23 2.2.21 tffsMkdir ........................................................................................................................ 24 2.2.22 tffsMonitorAdd ............................................................................................................... 25 2.2.23 tffsMonitorRemove ........................................................................................................ 26 2.2.24 tffsMount ....................................................................................................................... 27 2.2.25 tffsReclaim .................................................................................................................... 28 2.2.26 tffsResize ...................................................................................................................... 29 2.2.27 tffsRewind ..................................................................................................................... 29 2.2.28 tffsTruncate ................................................................................................................... 30 2.2.29 tffsUnmount .................................................................................................................. 30

2,177

社区成员

发帖
与我相关
我的任务
社区描述
xworks是美国 Wind River System 公司( 以下简称风河公司 ,即 WRS 公司)推出的一个实时操作系统。
社区管理员
  • VxWorks开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧