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.

PRU-code not running

Genius 5820 points

Hi,

I'm doing some first experiments wiht PRU0 and TI's PRU-C-compiler but without success. PRU-initialisation seems to be OK but the code is not running. My example code does nothing more than blink with an LED that is connected to a GPO:

int main()
{
   for (;;)
   {
       HWREG(SOC_GPIO_1_REGS + GPIO_SETDATAOUT)=LED_STOP_BIT;
       __delay_cycles(100000000);
       HWREG(SOC_GPIO_1_REGS + GPIO_CLEARDATAOUT)=LED_STOP_BIT;
       __delay_cycles(100000000);
   }
}

Pin-mux and configuration of output LED_STOP_BIT was done in main-application before PRU-code was started. GPIO-addrsses accessed within this code are the normal ones of main address space.

Next PRU is enabled, powered and clocks are turned on so that PRU_CTRL-register shows 0x0001. Then data and text generated with PRU-C-compiler are loaded into appropriate memory areas:

   memcpy((void*)PRU0IRAM_PHYS_BASE,textbuf,textlen);
   memcpy((void*)DATARAM0_PHYS_BASE,databuf,datalen);

Finally PRU_CTRL-register is set to 0x00000002 and afterwards show 0x00008003 - means PRU should be enabled and running. Nevertheless my LED is not blinking.

Any ideas what could be missing?