behavior when first initializing a new flash part

98 views
Skip to first unread message

bowerymarc

unread,
Oct 16, 2013, 6:18:50 PM10/16/13
to uf...@googlegroups.com
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?


Ricky Zheng

unread,
Oct 17, 2013, 3:05:37 AM10/17/13
to uf...@googlegroups.com
It seems UFFS discovered a bad block while reading block 3 page 0 in _BuildTreeStepOne() line 524 calling uffs_IsPageErased(dev, bc, 0).

But the uffs_FlashIsBadBlock(dev, block) at line 529 did not detect the bad block ?

Does you flash driver provide 'IsBadBlock()' function ?

Cheers,
Ricky.





--
You received this message because you are subscribed to the Google Groups "UFFS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uffs+uns...@googlegroups.com.
To post to this group, send email to uf...@googlegroups.com.
Visit this group at http://groups.google.com/group/uffs.
For more options, visit https://groups.google.com/groups/opt_out.

bowerymarc

unread,
Oct 17, 2013, 8:10:56 AM10/17/13
to uf...@googlegroups.com
No, it's only implementing read/write page with layout and erase block.
It's a Freescale Kinetis ARM with a fancy NAND flash controller which does ECC, DMA to memory, etc. etc. and has a low-level driver written already (NFC_LDD).
Reply all
Reply to author
Forward
0 new messages