First of all: this is obviously NOT a Starterware question since it does not support PRU. Here no Starterware is involved, code mentioned below is PRU-C-Code or plain, bare-metal C-code!
I'm doing some first experiments with PRU0 and TI's PRU-C-compiler but without success. PRU-initialisation seems to be OK but the code is not running. My PRU example code does nothing more than blink with an LED that is connected to a GPO:
1
2
3
4
5
6
7
8
9
10
|
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:
1
2
|
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?