-
大小: 30KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-06-26
- 语言: 其他
- 标签: nandflash 磨损 均衡算法 translation
资源简介
1.扇区读写到NAND FLASH的转换 2.坏块管理 3.磨损平横 nand flash 磨损均衡算法 Nand Flash Translation Layer (源码包)
代码片段和文件信息
#include “OSModule_MemoryManagement.h“
#include “HardwareAdaptationlayer.h“
#include “LLD.h“
#include “BadBlockManagement.h“
#include “FalUserDirective.h“
/*number of bad block present on device*/
static UINT8 BadBlocksNumber = 0;
/*physical block number of block containing the BBT*/
static INT16 BootBlockNumber = -1;
/*head of bad blocks list*/
static BadBlockElem *BadBlockList = NULL;
/*pointer to the last elem of bad block list in ram*/
static BadBlockElem *last = NULL;
//static UINT8 BadBlockBuff[528];
//static UINT8 pageBuffer[528];
/*************************GetBadBlockTable ****************************
* Retrieve the BBT from flash (if exists). Return a concatenate list *
* of BadBlockElem *
*---------------------------------------------------------------------*
* startBlock : physical block number where start the searching *
* *
* bbt : the head of bad block list retrieved *
* *
***********************************************************************/
NFTL_Return GetBadBlockTable(BadBlockElem *bbt UINT16 startBlock)
{
UINT16 i;
UINT32 k;
UINT8 searchRange;
UINT8 founded = 0;
BootStruct bootStruct;
UINT16 *bbtArray = NULL;
UINT8 *buffer = NULL;
UINT16 lenght;
//lenght = GetDeviceArchitecture().pageSize;
lenght = CHUNK_SIZE;
searchRange = 10;
last = NULL;
BadBlocksNumber = 0;
//buffer = OS_DRIVER_Malloc(GetDeviceArchitecture().pageSize);
buffer = (UINT8 *)OS_DRIVER_Malloc(CHUNK_SIZE);
if (buffer == NULL)
{
return FAILURE;
}
for (i = startBlock; i <= (startBlock + searchRange); i++)
{
if (!founded)
{
UINT32 targetAddress;
CalculateAddress(i0&targetAddress);
//if ((NAND_PageRead(targetAddress(UINT8 *)(&BadBlockBuff[0])lenght) != NAND_PASS))
if ((NAND_PageRead(targetAddressbufferlenght) != NAND_PASS))
{
OS_DRIVER_Free(buffer);
return FAILURE;
}
OS_MemCopy(&bootStructbuffersizeof(BootStruct));
//founded bootStruct
if (OS_SearchString((char *) bootStruct.bootStructId“NANDBOOT“) != NULL)
{
UINT8 *pageBuffer = NULL;
int c = 0;
UINT8 noOfPage = 0;
INT32 lastPageDim = 0;
UINT8 totalPage = 0;
founded = 1;
//set the physical block number of the block containing the bootstruct
SetBBMBootBlockNumber(i);
//allocate the list of Bad Blocks
if (bootStruct.noOfBadBlocks == 0)
{
bbt = NULL;
bbtArray = NULL;
OS_DRIVER_Free(buffer);
return SUCCESS;
}
bbtArray = (UINT16 *)
OS_DRIVER_Malloc(sizeof(UINT16) * bootStruct.noOfBadBlocks);
if (bbtArray == NULL)
{
SetBBMBootBlockNumber(-1);
OS_DRIVER_Free(buffer);
return FAILURE;
}
#if 0
noOfPage = ((bootStruct.noOfBadBlocks) * sizeof(UINT16)) /
GetDeviceArchitecture().mainSize;
lastPageDim = (bootStruct.noOfBadBlocks * sizeof(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14738 2006-08-10 10:23 NFTL\BadBlockManagement.c
文件 1409 2006-08-10 10:23 NFTL\BadBlockManagement.h
文件 5034 2006-08-10 10:23 NFTL\Common.h
文件 1274 2006-08-10 10:23 NFTL\FalUserDirective.h
文件 6823 2006-08-10 10:23 NFTL\GarbageCollector.c
文件 333 2006-08-10 10:23 NFTL\GarbageCollector.h
文件 1222 2006-08-10 10:23 NFTL\OSModule_MemoryManagement.c
文件 348 2006-08-10 10:23 NFTL\OSModule_MemoryManagement.h
文件 51374 2006-08-10 10:23 NFTL\StructureManager.c
文件 3115 2006-08-10 10:23 NFTL\StructureManager.h
文件 41023 2006-08-10 10:23 NFTL\TranslationModule.c
文件 825 2006-08-10 10:23 NFTL\TranslationModule.h
文件 21105 2006-08-10 10:23 NFTL\WearLeveling.c
文件 1527 2006-08-10 10:23 NFTL\WearLeveling.h
目录 0 2006-08-10 10:23 NFTL
----------- --------- ---------- ----- ----
150150 15
- 上一篇:Labview 图片显示
- 下一篇:STM32 智能充电器原理图
相关资源
- GD5F4G.zip
- TQ2440从norflash nandflash sdram启动总结
- abaqus子程序 umeshmotion
- 嵌入式-nandflash-ftl层代码
-
Jli
nk烧写Nand Flash方法.rar - NANDflash测试方法初稿.docx
- SC_FDE系统信道估计与频域均衡算法研
- mcrion_NFTL.zip
- FPGA读取NANDFLASH的ID
- 码间干扰信道 均衡算法 ISI equalizati
- FPGA实现的NandFlash控制器(带ECC)文档
- 煤矿顺槽胶带加湿器的研究与应用
- 掺Cu/Ti中间相碳合金的制备及其高温摩
- 煤直接液化减压进料阀组数值模拟与
- 论文研究 - 国际阿比让听力矫正中心
- XJM-S型浮选机叶轮磨损分析与研究
- Cheap_Flash_FS--嵌入式NandFlash文件系统源
- MCMA盲均衡算法仿真
- MIMO系统中ZF均衡算法
评论
共有 条评论