Hi all,
I'm trying to create a simple project in which core0 loads a program
into the other cores. The program loaded is the same executed by
Core0 (_c_int00). I found several example on the forum which was
almost the same so i wrote my code:
Core0:
1. Writing of _c_int00 on every core magic address
2. KICK0 and KICK1 unlock
3. Writing of IPCGR register on every core
The program, once loaded on slave core 3 should blink a led on
GPIO 10.
It seems that the IPC interrupt is not triggered. I attach my code to the topic.
//#include <boot_bench.h>
#include "ti/csl/csl_gpioAux.h"
#include <ti/platform/evmc6678l/platform_lib/include/evmc66x_gpio.h>
//KICK registers
#define KICK0 (0x2620038)
#define KICK1 (0x262003C)
//Magic address of each core
#define MAGIC_ADDR 0x0087FFFC
#define BOOT_MAGIC_ADDR(x) (MAGIC_ADDR+(1<<28)+(x<<24))
//Write to address function
#define DEVICE_REG32_W(x,y) *(volatile uint32_t *)(x)=(y)
//Read from address function
#define DEVICE_REG32_R(x) (*(volatile uint32_t *)(x))
//Trigger IPC interrupt
#define IPCGR(x) (0x02620240 + x*4)
#define NUM_OF_CORES (8)
//Core number
extern cregister volatile unsigned int DNUM;
extern far uint32_t _c_int00;
CSL_GpioHandle GPIO_handle = NULL;
/******************************************************************************
* Function: main
******************************************************************************/
void main ()
{
GPIO_handle = CSL_GPIO_open(0);
CSL_GPIO_setPinDirOutput(GPIO_handle, 10);
//Executed only by master core
if (DNUM==0)
{
uint32_t loop;
uint32_t core;
for (core = 1; core < 8; core++)
{
DEVICE_REG32_W(BOOT_MAGIC_ADDR(core), (uint32_t)&_c_int00);
for (loop = 0; loop < 1000; ++loop) {}//delay
}
DEVICE_REG32_W(KICK0, 0x83e70b13);
DEVICE_REG32_W(KICK1, 0x95a4f1e0 );
for (core = 1; core < 8; core++)
{
DEVICE_REG32_W(IPCGR(core), 1);
for (loop = 0; loop < 1000; ++loop) {}//delay
}
}
int i;
while(1)
{
if (DNUM==3) //Core 3 toggles a led every 0.5 sec @ 1 GHz
{
CSL_GPIO_setOutputData(GPIO_handle, 10);
for (i=0; i<10000000; i++)
{
}
CSL_GPIO_clearOutputData(GPIO_handle, 10);
for (i=0; i<10000000; i++)
{
}
}
}
}
Can someone please help me?
Thanks