I'm trying to run (1.3.6) with a new flash part which I think its totally erased.... I'm thinking the logic of this isn't correct, unless I'm missing something?
Here's the debug output:
@86 - initializing UFFS
mtb : @174 - init device for mount point /data/ ...
mtb : @193 - mount partiton: 0,1023
os : @105 - system memory alloc 160 bytes
flsh: @216 - alloc spare buffers 160 bytes.
flsh: @292 - UFFS consume spare data size 14
init: @107 - init page buf
os : @105 - system memory alloc 6384 bytes
pbuf: @248 - alloc 6384 bytes.
init: @113 - init block info cache
os : @105 - system memory alloc 5240 bytes
bc : @95 - alloc info cache 5240 bytes.
os : @105 - system memory alloc 16384 bytes
tree: @95 - alloc tree nodes 16384 bytes.
tree: @501 - build tree step one
tree: @522 - found bad block 0
flsh: @441 - new bad block 3 found while reading page 0 tag
bbl : @331 - Add pending block 3 - Recover
bc : @274 - load block 3 page 0 spare fail.
flsh: @441 - new bad block 3 found while reading page 63 tag
bc : @274 - load block 3 page 63 spare fail.
tree: @472 - bad page found, block 3 page 63
flsh: @441 - new bad block 3 found while reading page 0 tag
bc : @274 - load block 3 page 0 spare fail.
tree: @261 - First page is clean in a non-erased block ?
tree: @575 - DIR 0, FILE 0, DATA 0
tree: @1064 - build tree step one fail!
init: @128 - fail to build tree
mtb : @196 - init device fail !
I think the problem is in uffs_tree.c: _BuildValidTreeNode:
if (!TAG_IS_DIRTY(tag)) {
// should never go here ... unless mark dirty page failed ?
uffs_Perror(UFFS_MSG_NORMAL,
"First page is clean in a non-erased block ?");
return U_FAIL;
}
I wonder, is this IF statement needed? It seems like this failure causes the whole thing to fail, but I don't get the logic... with a new part there isn't a 'mark dirty' happening anywhere.
I tried commenting out the above "return U_FAIL;" , and it all seems to work... unless I'm missing something?