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.
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart),单步执行没有问题,单步执行一遍后,reset后再跑也没问题。
重新下程序后,直接跑老是跑飞,这是为什么?程序是load到flash中:
void main(void)
{
InitDSP();
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
InitData();
OSInit();
if (OS_NO_ERR != OSTaskCreate(StateMachineTsk, (void *)0, (void *)&StateMachineTskStk[0], SM_TSK_PRIO))
{
return;
}
OSStart();
}
cmd文件:
ramfuncs : LOAD = FLASHD,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); 最后一个参数应该是copy的长度,你给了一个地址...
居然编译不报错?
KAIXIN,
memcopy没有问题。 memcopy跟memcpy是不一样的。
void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr)
{
while(SourceAddr < SourceEndAddr)
{
*DestAddr++ = *SourceAddr++;
}
return;
}
你好,,我想请教下,memcpy 的函数实现是怎么写的呢,,今天我也遇到这个问题,,是加的memcopy,这两个函数都在例程的那个位置啊,,没有找到呢,,都是自己实现的