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.

Compiler/TMS320C6748: Converting PRU c file to c array

Part Number: TMS320C6748

Tool/software: TI C/C++ Compiler

I need to port a function from the DSP core to the PRU0.

These are the steps performed:

- created a test.c file with the function

- compiled test.c using: clpru test.c, this generates a test.obj file.

 - created a c array file using  hexpru --array test.obj 

- on main() of the DSP code c array is called by 

PRU0_DisableAndReset();

PRU0_Load(PRUCode, (sizeof(PRUCode)/sizeof(int))); //PRUCode is the c array

PRU0_Run();

the PRU code is:

void PRU0_DisableAndReset(void){

HWREG(SOC_PRUCORE_0_REGS) = PRU_CONTROL_ALLDISABLE;
}

void PRU0_Load(const uint32* pruCode, uint32 codeSizeInWords){
uint32 i;
uint32 *pruIram;
pruIram = (uint32 *) PRU0_PROG_RAM_START;
for(i=0; i<codeSizeInWords; i++)
{
pruIram[i] = pruCode[i];
}

}

void PRU0_Run(void){

HWREG(SOC_PRUCORE_0_REGS) = PRU_CONTROL_COUNTENABLE|
PRU_CONTROL_ENABLE|
0x00000001;
}

The function ported is not executed after PRU0_Run(), what could be the problem?

Note creating a c array using pasm PRU_gpioToggle.p and using it with the PRU0 functions actually works, is there a parameter that must be set when running the clpru and hexpru tools?