Quantcast
Channel: C6000™多核 - 最近的话题
Viewing all articles
Browse latest Browse all 5545

IPC中断,清除IPCAR的值清除不掉

$
0
0

我在Core0 进行音频采集,Core1进行音频运算。

Core0在开始采集时,向Core1发送IPC,信息填写0x10,此时Core1能够接收到中断并在中断服务程序中读取该核的IPCGR,为0x10,并在中断服务程序中向该核的IPCAR写0x10,试图清除IPCAR和IPCGR.

随后,Coreo在停止音频采集时,向Core1发送IPC中断,信息填写0x20,但此时,真实写入核1的IPCGR的值为0x30,Core1接收到核间中断,读取该核的IPCGR的值也为0x30,并试图在IPCAR写0x30清除IPCGR和IPCAR。

此后,Core0 无论在开始采集和停止采集,向Core1发送核间中断,无论写入信息为0x10,或0x20,读取Core1的IPCGR地址,始终为0x30。

感觉像是Core1没能成功清理IPCAR的值,导致下一次Core0再次发送IPC时,始终包含上一次的信息。

请问可能是什么原因呢?

附上代码

Core 0:

IPC中断初始化函数

UINT32 IPC_Inter_Init()
{
Hwi_Params params;
Hwi_Handle handle = NULL;

Hwi_Params_init(&params);
//params.arg = (UArg) ptr_net_device;
params.eventId = 91;
params.enableInt = TRUE;
params.priority = 5;

handle = Hwi_create(IPC_INTERRUPT_NUM, IPC_isr, &params, NULL);
if(NULL != handle)
{
platform_write("Succeed to create IPC ISR\r\n");
}
else
{
platform_write("Failed to create IPC ISR\r\n");
}

Hwi_enableInterrupt(IPC_INTERRUPT_NUM);
Hwi_enable();

}

IPC中断发送函数

void IPC_send(UINT8 coreID,UINT32 cmd)
{
/*Unlock Boot Config*/
KICK0 = KICK0_UNLOCK;
KICK1 = KICK1_UNLOCK;

*(volatile unsigned int *)(IPCGRInfo[coreID]) = cmd;
*(volatile unsigned int *)(IPCGRInfo[coreID]) |= 1;

KICK0 = KICK_LOCK;
KICK1 = KICK_LOCK;

//platform_write("IPC interrupt to Core %d with info :%d Time :%d\n",coreID,cmd,TSCL);
my_uart_write('U');

}

Core 1:

//Core1 中断初始化
UINT32 IPC_Inter_Init()
{
Hwi_Params params;
Hwi_Handle handle = NULL;

Hwi_Params_init(&params);
//params.arg = (UArg) ptr_net_device;
params.eventId = 91;
params.enableInt = TRUE;
params.priority = 5;

handle = Hwi_create(IPC_INTERRUPT_NUM, IPC_isr, &params, NULL);
if(NULL != handle)
{
platform_write("Succeed to create IPC ISR\r\n");
}
else
{
platform_write("Failed to create IPC ISR\r\n");
}

Hwi_enableInterrupt(IPC_INTERRUPT_NUM);

Hwi_enable();

}


//Core1 IPC中断服务程序
void IPC_isr()
{

UINT32 coreNum,read_ipcgr;
UINT32 preCoreNum,tmp;

tmp = Hwi_disableInterrupt(IPC_INTERRUPT_NUM); //Hwi_disable();

read_ipcgr = *(volatile UINT32 *)(IPCGRInfo[DNUM]);
platform_write("data :0x%x\r\n",read_ipcgr);
switch(read_ipcgr)
{
case IPC_CMD_QIANCANG_ENALBE:
my_uart_write('V');
//G_wSpeechWState = 1;
break;
case IPC_CMD_QIANCANG_DISALBE:
my_uart_write('W');
//G_wSpeechWState = 2;
break;
case IPC_CMD_QIANCANG_SOUNDFRAME_UPDATE:
my_uart_write('X');
//g_tmpLen = READ_UINT32(QC_CTRLWORD_SOUND_DATALEN_OFF);
//g_curFrameCounter = READ_UINT32(QC_CTRLWORD_FRAMENO_OFF); //current sound frame no
//SemPost(hSem_1939Colll_Inter);
break;
default:
break;
}

*(volatile UINT32 *)(IPCARInfo[DNUM]) = read_ipcgr; //clrea IPCGR and IPCAR
//*(volatile UINT32 *)(0x2620284) = read_ipcgr;

Hwi_restoreInterrupt(IPC_INTERRUPT_NUM, tmp);

//data = *(volatile unsigned int *)(IPCGRInfo[DNUM]);
//*(volatile unsigned int *)(IPCARInfo[DNUM]) = data;

}


Viewing all articles
Browse latest Browse all 5545

Trending Articles