TI中文支持网
TI专业的中文技术问题搜集分享网站

有关DSP多核串口打印乱码问题

在C6657多核运行,串口打印乱码,程序通过PCIE加载到DDR3,多核启动思路参考pcieboot_helloc.c:代码和现象如下

代码如下:

Int main()
{
// DEVICE_REG32_W(BOOT_MAGIC_ADDR(0), BOOT_MAGIC_NUMBER);
#if 1
int nthreads, tid;
#pragma omp parallel
{
platform_write("[C66xx_%d] Hello World from thread = %d\n",DNUM,omp_get_thread_num());
}
/* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(nthreads, tid)
{

/* Obtain thread number */
tid = omp_get_thread_num();
platform_write("[C66xx_%d] Hello World from thread = %d\n",DNUM, tid);

/* Only master thread does this */
if (tid == 0)
{
nthreads = omp_get_num_threads();
platform_write("[C66xx_%d] Number of threads = %d\n", DNUM,nthreads);
}

} /* All threads join master thread and disband */
#endif

platform_write("[C66xx_%d] BIOS_start\n",DNUM);

BIOS_start(); /* does not return */
return(0);
}

现象如下:

o[CC666xx6_x0x]_ Hello1 ]W orld froHm threaedl l=o 0W
rld from thread = 1
[CC666xx_06]x Hello Worxld f_r1o]m Htehlrleoa dW o=r l0d
tf[C66xxr_o0m] tNhurmebaedr =o f1 hreads = 2
[C66xx_0] BIOS_start

    这并行指令core0和core1通过串口打印出来都重叠在一起,根本看不清,麻烦分析下是什么原因

Shine:

请问仿真器模式下多核能通过串口打印么?请看下面的e2e帖子是否有帮助。https://e2e.ti.com/support/embedded/tirtos/f/355/t/222286

lixiaosheng lixiaosheng:

回复 Shine:

您好,仿真器模式下打印正常

lixiaosheng lixiaosheng:

回复 lixiaosheng lixiaosheng:

你好,根据提供网址参考加锁反而什么都打印不出来,有可能是卡死在#pragma omp parallel指令里边,代码如下:

Int main(){ IArg key;

GateMP_Handle handle;

GateMP_open("core",&handle);#if 1 int nthreads, tid;#pragma omp parallel { key = GateMP_enter(handle); platform_write("[C66xx_%d] Hello World from thread = %d\n",DNUM,omp_get_thread_num()); GateMP_leave(handle,key); } /* Fork a team of threads giving them their own copies of variables */#pragma omp parallel private(nthreads, tid) {

/* Obtain thread number */ tid = omp_get_thread_num(); // if(DNUM == 1) platform_write("[C66xx_%d] Hello World from thread = %d\n",DNUM, tid);

/* Only master thread does this */ if (tid == 0) { nthreads = omp_get_num_threads(); // if(DNUM == 1) platform_write("[C66xx_%d] Number of threads = %d\n", DNUM,nthreads); }

} /* All threads join master thread and disband */#endif

platform_write("[C66xx_%d] BIOS_start\n",DNUM);

BIOS_start(); /* does not return */ return(0);}

lixiaosheng lixiaosheng:

回复 lixiaosheng lixiaosheng:

能不能提供一个C6657多核下正常打印的示例代码?

lixiaosheng lixiaosheng:

回复 lixiaosheng lixiaosheng:

恳请TI的工程师出来帮我分析下这问题,我现在二星期没弄出个头绪,如果有可能的话给联系方式

这论坛到底有几个问题解决了,真是怀疑TI根本就没当回事!!!!!!!!!!!!

赞(0)
未经允许不得转载:TI中文支持网 » 有关DSP多核串口打印乱码问题
分享到: 更多 (0)