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.
您好,我在调试的过程中遇到一个问题,在DEBUG模式下,一切正常,但是烧入FLASH掉电再上电后,共享内存进行通信的部分,CPU2能够正常接受到CPU1的信息,但是CPU1无法收到CPU2写入的信息,,二者交互部分代码如下:
//////////////////////////////////////////////////CPU1///////////////////////////////////////
#pragma DATA_SECTION(c1_r_array,"SHARERAMGS0");
#pragma DATA_SECTION(c1_r_w_array,"SHARERAMGS1");
while( !(MemCfgRegs.GSxMSEL.bit.MSEL_GS0 &
MemCfgRegs.GSxMSEL.bit.MSEL_GS14))
{
EALLOW;
MemCfgRegs.GSxMSEL.bit.MSEL_GS0 = 1;//0:CPU1 is master for this memory
//1:CPU2 is master for this memory
MemCfgRegs.GSxMSEL.bit.MSEL_GS14 = 1;
EDIS;
}
if(IPCLtoRFlagBusy(IPC_FLAG10) == 0)
{
// Write an array to a memory location owned by CPU01
Shared_Ram_dataWrite_c1();
// Set a flag to notify CPU02 that data is available
IPCLtoRFlagSet(IPC_FLAG10);
}
//////////////////////////////////////////////////CPU2///////////////////////////////////////
#pragma DATA_SECTION(c2_r_array,"SHARERAMGS1");
#pragma DATA_SECTION(c2_r_w_array,"SHARERAMGS0");
void main(void)
{
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;、
InitPieVectTable();
// Wait until Shared RAM is available.
while(!( MemCfgRegs.GSxMSEL.bit.MSEL_GS0 & MemCfgRegs.GSxMSEL.bit.MSEL_GS14 ) )
{
}
// Copy ISR routine to a specified RAM location to determine the size
while(1)
{
if(IPCRtoLFlagBusy(IPC_FLAG10) == 1)
{
//Read c2_r_array and modify c2_r_w_array
Shared_Ram_dataWrite_c2();
IPCRtoLFlagAcknowledge(IPC_FLAG10);
}
}
}
希望您能麻烦帮助解决,感激不尽!!