首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

flash的读写

src和dest应该都是16bit的地址,定义成byte类型肯定不能完整copy
如果使用codewarrior编写的话,可以直接引用C语言库中的函数, memcpy2,原型在string.h头文件中

这里还有一个写好的函数,供你参考
void CopyToRam(unsigned int *dest, unsigned int *source, unsigned int count)
{
do
{

*dest++ = *source++;

} while(--count);

}
假定你把0x2000开始的flash的内容copy到0x100地址的ram就这样写
CopyToRam((unsigned int *)0x100,(unsigned int *)0x2000,20);
返回列表