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.

TMS320C6678: 6678

Part Number: TMS320C6678


目前编写了一个代码,通过核0对其他核发起局部复位,网络接收BIN并存放到指定的位置,再通过IPC信号唤醒其他核。

bin放在L2SRAM时可以正常运行,但是放在DDR3时产生异常第一次唤醒其他核后跑飞,第二次后又能正常。

memset(pBuf, 0, 13);
bytes = (int)recv(connfd, (void *)pBuf, 9, 0);  //接收bin程序入口_c_int00地址
if(bytes != 8) {
	uart_printf("File Head Error 1!bytes: %d!\n", bytes);
	goto leave;
}
Entry_Address = strtohex(pBuf, 8);
memset(pBuf, 0, 13);
bytes = (int)recv(connfd, (void *)pBuf, 9, 0); //接收存放bin文件起始地址
if(bytes != 8) {
    uart_printf("File Head Error 2!bytes: %d!\n", bytes);
    goto leave;
}
WriteAddr = (unsigned int*)strtohex(pBuf, 8);
memset(pBuf, 0, 13);
bytes = (int)recv(connfd, (void *)pBuf, 2, 0); //ignore standard header
if(bytes != 1) {
	uart_printf("File Head Error 3!bytes: %d!  %s\n", bytes, pBuf);
	goto leave;
}
corenum = pBuf[0] - 0x30;  //接收需要替换代码的核号
uart_printf("%x %x %d\n", Entry_Address, (unsigned int)WriteAddr, corenum);

while (1) {
	memset(pBuf, 0, 13);
	bytes = recv(connfd, pBuf, 4, 0);
	if (bytes <= 0) {
	    break;
	}

	*WriteAddr = littleToBig(pBuf);
	WriteAddr++;
}

Load_Core_app_Start(Entry_Address, corenum);

....
....
....
void Load_Core_app_Start(unsigned int EntryAddr, int corenum)
{
	unsigned int MAGIC_ADDR = 0X1087FFFC + corenum * 0x1000000;

	CSL_BootCfgUnlockKicker();
	CSL_PSC_setModuleLocalReset(corenum + 15, PSC_MDLRST_ASSERTED);
	CSL_PSC_setModuleLocalReset(corenum + 15, PSC_MDLRST_DEASSERTED);
	cpu_delaycycles(100000);
	*((volatile unsigned int *)MAGIC_ADDR) = EntryAddr;
	cpu_delaycycles(100000);
	CSL_IPC_genGEMInterrupt (corenum, 0);
	CSL_BootCfgLockKicker();
}