Hi all,
My situation: C6670, CCSv5.3, SYS/BIOSv6.33.6.50, XDCToolsv3.23.4.60
In my project, I add these codes below to Boot the other cores.
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;
}
}
In these codes, the Core0 writes the Core1's MagicAddress and sends a IPC to Core1 to start Core1; Core1 starts Core2; Core2 starts Core3.
But I meet a problem.
When the C6670 is booted, I find that the Core0 runs from the 'main' function. But when Core0 runs the MulticoreBoot, Core0 jumps to the start address of 'main' function and runs again. But why?
The project's Optimization Level is 3 and this MulticoreBoot function is in one Task Thread. Do these settings yield this problem?
And in another project(very different project) with Optimization Level as OFF , this problem does not exit.
Hope for repiles!
Feng
