(急请高手指导)VXWorks 5.5+PPC下 NOR flash文件系统异常问题
在使用PPC+vxWorks5.5环境下 ,在JS28F128 norflash上搭建 tffs文件系统,16M空间上低512K做boot,其余的做文件系统,格式化tffs文件系统等都成功,但长时间写文件,容易出现如下:
(1)将bootrom部分内容被修改了
(2)文件系统出现错误,复位后文件系统初始化失败
打印出的异常如下:
(a)
LTE ->0x1ea6288 (tApCtrlLogRecord): dosFsLib.c : Problem finding volume data, trying to use the next block as boot block.
0x1ea6288 (tApCtrlLogRecord): dosFsLib.c : Malformed boot sector. Offset 0, value 0.
(b)
0x1eccce0 (tApCtrlLogRecord): disk cache error: device 1ee2ed8 block 7851 errno c0006, disk removed while writing data, possible data loss
0x1eccce0 (tApCtrlLogRecord): disk cache error: device 1ee2ed8 block 84 errno c0006, disk removed while writing data, possible data loss
(c)
写日志进程suspend
部分配置如下:
#defineFLASH_BASE_ADRS0xFE000000/* Flash memory base address */
#defineFLASH_SIZE0x01000000L/* Flash memory size */
PHYS_MEM_DESC sysPhysMemDesc [] =
{
....
{
(void *) FLASH_BASE_ADRS,
(void *) FLASH_BASE_ADRS,
FLASH_SIZE, /* 16 m - I28F128 window */
VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE |
VM_STATE_MASK_GUARDED,
VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT |
VM_STATE_GUARDED
},
FLStatus i28f016Identify(FLFlash vol)
{
....
vol.chipSize = FLASH_SIZE;
vol.erasableBlockSize = 0x20000L * vol.interleaving;
}
STATUS sysTffsFormat (void)
{
STATUS status;
tffsDevFormatParams params =
{
#defineHALF_FORMAT/* lower 0.5MB for bootimage, upper 1.5MB for TFFS */
#ifdefHALF_FORMAT
{0x80000l, 99, 1, 0x0, NULL, {0,0,0,0}, NULL, 2, 0, NULL},
#else
{0x000000l, 99, 1, 0x0, NULL, {0,0,0,0}, NULL, 2, 0, NULL},
#endif/* HALF_FORMAT */
/*FTL_FORMAT*/
FTL_FORMAT
};
/* we assume that the drive number 0 is SIMM */
status = tffsDevFormat (0, (int)¶ms);
return (status);
}
#endif /*INCLUDE_TFFS */
}
应用层函数应该没问题,因为大部分驱动代码是公司以前留下的,请大家提供查找方向!非常感谢!
[解决办法]
建议先将MTD的那几个函数,读,写,擦除,单独来进行测试,确保没有问题
如果MTD没有问题了,那么就再把参数和配置再查一遍,socket部分一般不用动