#3939 - ZhouChang - Thu Mar 13, 2003 9:01 am
Hello all:
I download flash image from rs232 ,then write into flash,but speed is very slow.
This is my code:
I download flash image from rs232 ,then write into flash,but speed is very slow.
This is my code:
Code: |
int write_data(u32 addr, u32 wlen, u32 data) { u32 len; u16 ready; len = 0; while( len < wlen) { do { read_sr(FLASH_ROM ,ready); } while ( (ready & 0x80)==0 ); write_flash (FLASH_ROM , INTEL28F_WRITE); write_flash (addr + len * 2, *(u16 *)(data + len * 2) ); len ++; } do { read_sr(FLASH_ROM ,ready); } while ((ready & 0x80)==0); write_flash(FLASH_ROM, INTEL28F_CLEARSR); write_flash(FLASH_ROM, INTEL28F_READARRAY); return 0; } |