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.

28377D程序放进RAM运行一直进入非法中断



28377d想将程序放进RAM中运行程序一直进入非法中断不知道哪里出问题了。

声明的放进RAM的函数

#pragma CODE_SECTION (NPCSPWMCtrl, "ramfuncs")
void NPCSPWMCtrl(void)
{

PLLALL.SYS_Alpha=(2*AdcInAll.ADCIN1-AdcInAll.ADCIN2-AdcInAll.ADCIN3)*0.3333333;
/* PLLALL.SYS_Beta=(AdcInAll.ADCIN2-AdcInAll.ADCIN3)*0.57735;
PLLALL.SYS_Game=(AdcInAll.ADCIN1+AdcInAll.ADCIN2+AdcInAll.ADCIN3)*0.3333333;
PLLALL.SYS_UD=PLLALL.SYS_Alpha*cos(PLLALL.Angle)+PLLALL.SYS_Beta*sin(PLLALL.Angle);
PLLALL.SYS_UQ=PLLALL.SYS_Beta*cos(PLLALL.Angle)-PLLALL.SYS_Alpha*sin(PLLALL.Angle);
PLLALL.SYS_UQ=PLLALL.SYS_Game;*/
}

在程序初始化的时候加了下面这一行代码

#ifdef _FLASH
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (Uint32) &RamfuncsLoadSize);
#endif