|
引用 1 楼 wxdcxp 的回复:
C/C++ codeint CopyCode2Ram(unsignedlong start_addr, unsignedchar*buf,int size)
{
unsignedint*pdwDest;
unsignedint*pdwSrc;int i;if (bBootFrmNORFlash())
{
pdwDest= (unsignedint*)buf;
pdwSrc= (unsignedint*)start_addr;/* 浠?NOR Flash鍚?姩*/for (i=0; i< size/4; i++)
{
pdwDest= pdwSrc;
}return0;
}else
{/* 鍒濆?鍖朜AND Flash*/
nand_init_ll();/* 浠?NAND Flash鍚?姩*/if (NF_ReadID()==0x76 )
nand_read_ll(buf, start_addr, (size+ NAND_BLOCK_MASK)&~(NAND_BLOCK_MASK));else
nand_read_ll_lp(buf, start_addr, (size+ NAND_BLOCK_MASK_LP)&~(NAND_BLOCK_MASK_LP));return0;
}
}
这是copy 过程,供参考
谢谢ls,不过我想问的不是代码,而是我的思路是否对。。。 |
|