This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

starterware boot 读取 nand page 与 sysbios 中 读取nand page 时间差异很大

Other Parts Discussed in Thread: SYSBIOS

你好:

遇到的问题为:

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[i] = stat;

           }

      }

}