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.

CCS动态加载

Other Parts Discussed in Thread: SYSBIOS

用CCS写了一个动态加载模块,想通过启动核0来自动加载从核1-7,但是核0发布IPC中断后,从核并没有启动,有大神知道哪里有问题吗?

这是我的代码:

#include <xdc/std.h>
#include <stdio.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>

#define DEF_INIT_CONFIG_PLL1_PLLM 0
#define DEF_INT_MEM_TEST_CORE_ID 1
#define MAGIC_ADDR 0x8ffffc
#define DEVICE_REG32_W(x,y) *(volatile uint32_t *)(x)=(y)
#define DEVICE_REG32_R(x) (*(volatile uint32_t *)(x))
#define BOOT_MAGIC_ADDR(x) (MAGIC_ADDR + (1<<28) + (x<<24))
#define STATUS_ADDR (MAGIC_ADDR - 0x4)


#define CHIP_LEVEL_REG 0x02620000
#define KICK0 (CHIP_LEVEL_REG + 0x0038)
#define KICK1 (CHIP_LEVEL_REG + 0x003C)
#define IPCGR(x) (0x02620240 + x*4)

#define BOOT_MAGIC_NUMBER 0xBABEFACE
extern __cregister volatile unsigned int DNUM;

void write_boot_magic_number(void)
{
    printf("core %d\n",DNUM);
    DEVICE_REG32_W(MAGIC_ADDR, BOOT_MAGIC_NUMBER);

    while(1);
}

/******************************************************************************
* Function: main
******************************************************************************/
int main ()
{
    int coreNum;
    int core=0;


    /* Unlock the chip registers */
    DEVICE_REG32_W(KICK0, 0x83e70b13);
    DEVICE_REG32_W(KICK1, 0x95a4f1e0);

    //coreNum = platform_get_coreid();
    coreNum=DNUM;
    if (coreNum == 0)
    {
        /* Writing the entry address to other cores */
        printf("core0\n");
        for (core = 1; core < 8; core++)
        {
            DEVICE_REG32_W(BOOT_MAGIC_ADDR(core), (uint32_t)write_boot_magic_number);
        }
        for (core = 1; core < 8; core++)
        {
            DEVICE_REG32_W(IPCGR(core), 1);
       }
    }
    else
    {
        write_boot_magic_number();
    }

    return 0;
}