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.

C6670 多核Boot的问题



大家好,

环境:C6670, CCSv5.3, SYS/BIOSv6.33.6.50, XDCToolsv3.23.4.60

我在代码中添加如下代码,

void MulticoreBoot(UInt32 Core1_main_addr, UInt32 Core2_main_addr, UInt32 Core3_main_addr)
{

    int *pBootMagicAddCore0;
    int *IpcGr0;
    int i;
    int coreId = 0;
    int *bootMagicAddress;
    Uint32 c_int00_address = 0x0;

    coreId = DNUM;

    pBootMagicAddCore0 = (int *)0x108FFFFC;
    c_int00_address = (*pBootMagicAddCore0);

	if(coreId == 0)
	{
		bootMagicAddress = (int *)0x118FFFFC;
		*bootMagicAddress = Core1_main_addr;
        IpcGr0  = (int*)0x02620244;
        *(IpcGr0) = (*(IpcGr0)) | 0x00000001;
	}
	else if(coreId == 1)
	{
		bootMagicAddress = (int *)0x128FFFFC;
		*bootMagicAddress = Core2_main_addr;
        IpcGr0  = (int*)0x02620248;
        *(IpcGr0) = (*(IpcGr0)) | 0x00000001;
	}
	else if(coreId == 2)
	{
		bootMagicAddress = (int *)0x138FFFFC;
		*bootMagicAddress = Core3_main_addr;
        IpcGr0  = (int*)0x0262024C;
        *(IpcGr0) = (*(IpcGr0)) | 0x00000001;
	}
}

拟实现Core0写Core1的MagicAddress,再给Core1发IPC,从而启Core1;Core1启Core2;Core2启Core3。

遇到的问题是:

1. Core0从main函数开始执行,执行到这段代码后又跳到main函数开头从头执行;而不是向下执行,启动Core1。这是为什么呢?

2. 这段多核Boot代码在有的工程中正常,但是有个工程(Optimization Level改为3),添加这段代码后就出现了问题1。跟优化选项有关吗?优化level一般设为多少比较合适?还有这段Boot代码是放在一个Task中的,有影响吗?