本帖最后由 xiaoluoshan 于 2019-1-22 13:50 编辑
starterware boot 读取 nand page 与 sysbios 中 读取nand page 时间差异很大
你好: 遇到的问题为: starterware boot 读取 nand page 大小528字节 耗时为4-5ms; sysbios 中 读取nand page 大小528字节,耗时为1.5ms; 代码实现是一样的;时间差异很大的原因不知道是为什么? DSTATUS NAND_initialize (void) { DWORD i, j, w, /*d[2],*/ bb, bf, flag = SIZE_PAGE/4; BYTE ww; WORD stat; static DWORD *d;
nand_init(); flush_block(); d = BlockBuff[0]; /* Create physical block status table */ for (bb = 0, i = N_RES_BLKS; i < N_TOTAL_BLKS; i++) { read_page(d, i * N_SIZE_BLK, 1, N_GET_BLOCK_BUFF); /* Read two DWORDs of the spare area of 1st page */ bf = 0; ww = ~(d[flag] & 0xff); /* Check bad block mark */ if (ww & (ww - 1)) { /* Bad block (2 or more zeros) */ bb++; bf = 1; } else { w = d[flag+1]; /* Get block status */ if (w != 0xFFFFFFFF && (WORD)w != (WORD)(~w >> 16)) { /* Bit error in the status? */ read_page(d, i * N_SIZE_BLK + 1, 1, N_GET_BLOCK_BUFF); /* Read 2nd page */ w = d[flag+1]; /* Get block status */ if (w != 0xFFFFFFFF && (WORD)w != (WORD)(~w >> 16)) { bb++; bf = 1; } } } stat = bf ? 0xFFFE : (WORD)w; BlockStat = stat;
} } } 我是使用如下配置的: 是利用提供的 AIS工具将.out 转换为 .ais文件,然后烧写到 nand flash中,重新启动,两者读取nand flash 的时间,明显的 boot的时间长。
|