mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
SAMA5 NAND: Still debugging
This commit is contained in:
+2
-1
@@ -311,7 +311,8 @@ struct nxffs_blkstats_s
|
||||
off_t ngood; /* Number of good FLASH blocks found */
|
||||
off_t nbad; /* Number of well-formatted FLASH blocks marked as bad */
|
||||
off_t nunformat; /* Number of unformatted FLASH blocks */
|
||||
off_t ncorrupt; /* Number of blocks with correupted format info */
|
||||
off_t ncorrupt; /* Number of blocks with corrupted format info */
|
||||
off_t nbadread; /* Number of blocks that could not be read */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -107,8 +107,19 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume,
|
||||
ret = MTD_BREAD(volume->mtd, ioblock, volume->blkper, volume->pack);
|
||||
if (ret < volume->blkper)
|
||||
{
|
||||
fdbg("Failed to read erase block %d: %d\n", ioblock / volume->blkper, -ret);
|
||||
return ret;
|
||||
/* This should not happen at all on most FLASH. A bad read will
|
||||
* happen normally with a NAND device that has uncorrectable blocks.
|
||||
* So, just for NAND, we keep the count of unreadable blocks.
|
||||
*/
|
||||
|
||||
fdbg("Failed to read erase block %d: %d\n",
|
||||
ioblock / volume->blkper, ret);
|
||||
|
||||
/* Declare all blocks in the eraseblock as bad */
|
||||
|
||||
stats->nblocks += volume->blkper;
|
||||
stats->nbadread += volume->blkper;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Process each logical block */
|
||||
@@ -146,7 +157,6 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume,
|
||||
fdbg(" Bad blocks: %d\n", stats->nbad);
|
||||
fdbg(" Unformatted blocks: %d\n", stats->nunformat);
|
||||
fdbg(" Corrupt blocks: %d\n", stats->ncorrupt);
|
||||
fdbg(" Undreadable blocks: %d\n", stats->nbadread);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user