应用程序的拷贝那块应该怎么写,求高手帮忙!!!
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "platform_internal.h"
#include "platform.h"
#define DEVICE_REG32_W(x,y) *(volatile uint32_t *)(x)=(y)
#define DEVICE_REG32_R(x) (*(volatile uint32_t *)(x))
#define CHIP_LEVEL_REG 0x02620000
#define KICK0 (CHIP_LEVEL_REG + 0x0038)
#define KICK1 (CHIP_LEVEL_REG + 0x003C)
/* Magic address RBL is polling */
#define MAGIC_ADDR 0x8ffffc
#define BOOT_MAGIC_ADDR(x) (MAGIC_ADDR + (1<<28) + (x<<24))
#define IPCGR(x) (0x02620240 + x*4)
#define NUMBER_OF_CORES 2
#define BOOT_MAGIC_NUMBER 0xBABEFACE
#define BOOT_NUMBER0 0xAAAA5555
#define BOOT_NUMBER1 0x11111111
#define BOOT_NUMBER2 0x22222222
#define BOOT_NUMBER3 0x33333333
#define DDR_ADDR0 0x81000000
#define DDR_ADDR1 0x82000000
#define DDR_ADDR2 0x83000000
#define DDR_ADDR3 0x84000000
#define BOOT_UART_BAUDRATE 115200
uint32_t platform_get_coreid(void)
{
return (CSL_chipReadDNUM());
}
Platform_STATUS platform_delay(uint32_t usecs)
{
int32_t delayCount = (int32_t) usecs * 850000000;
int32_t start_val = (int32_t) CSL_chipReadTSCL();
while (((int32_t)CSL_chipReadTSCL() – start_val) < delayCount);
return Platform_EOK;
}
/* boot_helloworld version */
char version[] = "01.00.00.01";
void write_boot_magic_number(void)
{
uint32_t coreNum;
coreNum = platform_get_coreid();
DEVICE_REG32_W(MAGIC_ADDR, BOOT_MAGIC_NUMBER);
while(1);
}
void main ()
{
char version_msg[] = "\r\n\r\nBoot Hello World Example Version ";
char boot_msg[80];
platform_info pform_info;
uint32_t coreNum, core;
/* Initialize UART */
coreNum = platform_get_coreid();
if (coreNum == 0)
{
printf("%s%s\n\n", version_msg, version);
/* Unlock the chip registers */
DEVICE_REG32_W(KICK0, 0x83e70b13);
DEVICE_REG32_W(KICK1, 0x95a4f1e0);
//核0将应用程序代码搬入所有核的内存
for (core = 0; core < NUMBER_OF_CORES; core++)
{
}
//核0将应用程序的入口写入从核的BOOT_MAGIC_ADDR
for (core = 1; core < NUMBER_OF_CORES; core++)
{
sprintf(boot_msg, "\r\n\r\nBooting Hello World image on Core %d from Core 0 …", core);
printf("%s\n",boot_msg);
DEVICE_REG32_W(BOOT_MAGIC_ADDR(core), (uint32_t)write_boot_magic_number);
/* Delay 1 sec */
platform_delay(1);
}
//核0对从核发送IPC中断使从核进入应用程序入口开始执行
for (core = 1; core < NUMBER_OF_CORES; core++)
{
/* IPC interrupt other cores */
DEVICE_REG32_W(IPCGR(core), 1);
platform_delay(1000);
}
}
else
{
write_boot_magic_number();
}
while(1);
}
Shine:
请问用的是哪款器件?
user5907651:
回复 Shine:
6678
Ryan BL:
回复 user5907651:
这个看你们怎么规划了,一般建议直接使用TI 的多核应用部署(MAD)那套,不过那个对共bin/混合bin的支持不是太好;我有完全重写过一套多核启动加载/固化部署和在线升级,整个bootloader和updater部署下去几十kB就能搞定,正在准备和zynq统一起来,I2c/spi/nor启动都能支持,这个也不是很难。把启动手册多看看,熟记与心,然后熟悉下elf/coff格式,或者直接使用hex格式即可。