工具/软件:TI C/C++编译器
我需要将一个函数从 DSP 内核移植到 PRU0。
执行的步骤如下:
-使用函数创建了 test.c 文件
-使用 clpru test.c 编译 test.c、这会生成 test.obj 文件。
-使用 hexpru --array test.obj 创建了一个 c 数组文件
-在 DSP 代码 c 数组的 main()上由调用
PRU0_DisableAndReset();
PRU0_Load (PRUCode、(sizeof (PRUCode)/sizeof (int)));//PRUCode 为 c 数组
PRU0_Run();
PRU 代码为:
void PRU0_DisableAndReset (void){
HWREG (SOC_PRUCORE_0_regs)= PRU_CONTRAL_ALLDISABLE;
}
void PRU0_Load (const UINT32* pruCode、UINT32代码大小 InWords){
uint32 i;
uint32 * pruIram;
pruIram =(UINT32 *) PRU0_PROG_RAM_START;
for (i=0;<codeSizeInWords; i++)
{
pruIram[i]= pruCode[i];
}
}
void PRU0_Run (void){
HWREG (SOC_PRUCORE_0_regs)= PRU_CONTRAL_COUNTENABLE|
PRU_CONTRAL_ENABLE|
0x00000001;
}
移植的函数在 PRU0_Run()之后未执行,问题出在哪里?
注意使用 pasm pru_gpioToggle.p 创建一个 c 数组并将其与 PRU0函数结合使用实际上可行、运行 clpru 和 hexpru 工具时是否必须设置参数?