同一片norflash上建立tffs的困惑问题,大侠请帮忙
开发环境,2410+am29lv160db
#define FLASH_BOOT_ADRS (0x00100000)
#define FLASH_BOOT_SIZE (0x00100000)
#define SETUP_ERASE 0x80
#define SETUP_WRITE 0xa0
#define READ_ID 0x90
#define SECTOR_ERASE 0x30
#define BLOCK_ERASE 0x50
#define READ_ARRAY 0xf0
#define UNLOCK_1 0xaa
#define UNLOCK_2 0x55
#define UNLOCK_ADDR1 0x555
#define UNLOCK_ADDR2 0x2aa
调用如下
-> tffsShow
shine**********lv160MTDIdentify routine
shine**********ret is 100000,call by lv160MTDMap0
shine**********the baseFlashPtr is 100000,call by lv160MTDIdentify
shine**********ret is 100000,call by lv160MTDMap0
shine**********fllv160Identify routine
shine**********thisVars->unlockAddr1 100aaa,thisVars->unlockAddr2 100554,call by fllv160Identify
shine**********ret is 100002,call by lv160MTDMap0
shine**********the flashPtr is 100002,call by fllv160Identify
shine**********ret is 100000,call by lv160MTDMap0
shine**********identify ok
0: socket=RFA: type=0x2249, unitSize=0x10000, mediaSize=0x100000
value = 50 = 0x32 = '2' 结果 成功辨识
-> sysTffsFormat
同蓝色部分
shine**********ret is 100000,call by lv160MTDMap0
shine**********ret is 110000,call by lv160MTDMap0
shine**********ret is 120000,call by lv160MTDMap0
shine**********ret is 130000,call by lv160MTDMap0
shine**********ret is 140000,call by lv160MTDMap0
shine**********ret is 150000,call by lv160MTDMap0
shine**********ret is 160000,call by lv160MTDMap0
shine**********ret is 170000,call by lv160MTDMap0
shine**********ret is 180000,call by lv160MTDMap0
shine**********ret is 190000,call by lv160MTDMap0
shine**********ret is 1a0000,call by lv160MTDMap0
shine**********ret is 1b0000,call by lv160MTDMap0
shine**********ret is 1c0000,call by lv160MTDMap0
shine**********ret is 1d0000,call by lv160MTDMap0
shine**********ret is 1e0000,call by lv160MTDMap0
shine**********ret is 1f0000,call by lv160MTDMap0
同蓝色部分
value = -1 = 0xffffffff 结果 不成功,好像是没有调用到擦写函数
-> tffsDevCreate
输出同上,只是value值改变如下
value = 0 = 0x0 结果 像是成功了,但是调用usrTffsConfig显示不到 tffs设备
-> tffsDevFormat
同sysTffsFormat
shine**********lv160MTDErase routine
shine**********ret is 100000,call by lv160MTDMap0
Exception number 12: Task: 0x33e18b98 (t17)
Instruction prefetch abort
Program Counter: 0x200000
Status Register: 0x20000097
value = 0 = 0x0 结果 进入到lv160MTDErase函数出现异常
异常的位置在lv160MTDErase 函数中*thisVars->unlockAddr1 = UNLOCK_1;停止了!
个人分析如下:
1.命令字序列不对,是否应该是0x8080,0xa0a0,.......
2.如网上说讲在擦写时候应该要屏蔽中断?用intLock函数,如果是应该怎么用?
3.调用—>i
NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY
---------- ------------ -------- --- ---------- -------- -------- ------- -----
tExcTask excTask 33ec26b4 0 PEND 300b8980 33ec25bc 0 0
tLogTask logTask 33ebfd38 0 PEND 300b8980 33ebfc50 0 0
tShell shell 33e33380 1 READY 300afc8c 33e33014 0 0
tWdbTask wdbTask 33e35580 3 PEND 3001e3ec 33e354b4 0 0
t5 300a580c 33e22ee8 4 SUSPEND 200000 300c45d0 0 0
tNetTask netTask 33e81050 50 PEND 3001e3ec 33e80fd0 0 0
tFtpdTask 30049fbc 33e395ec 55 PEND 3001e3ec 33e394c8 0 0
tTffsPTask flPollTask 33ebe478 100 DELAY 300aebbc 33ebe3f4 0 9
value = 0 = 0x0
注意t5 为什么pc值是200000
希望此贴能引起大侠们的关注,帮所有在一片flash上建立文件系统的人指条明路!