We started from
pdk_am57xx_1_0_12/packages/ti/drv/pruss/test/am572x/c66/bios
to build a joint DSP - PRU program, which reads PRU GPI inputs with the PRU and pass the data,
after preprocessing if need be, to the DSP. The program works as expected if the frequency of
PRU0_ARM_EVENT is rather low (e.g. __delay_cycles(1000) in the PRU source code) but not
any more for higher frequency of PRU0_ARM_EVENT (e.g. __delay_cycles(1000) in the PRU
source code). This was observed with the release build. We wonder if the minimal time period
can be decreased, e.g. in changing the bios configuration.
The C code for the PRU inspired from
pdk_am57xx_1_0_12/packages/ti/drv/pruss/test/src/pru_firmware/pruss_test_pru0.txt
is
#include <stdint.h>
#include <pru_cfg.h>
#include <pru_intc.h>
#define AM33XX
#ifdef AM33XX
#define PRU0_ARM_EVENT (17)
#else
#define PRU0_ARM_EVENT (33)
#endif
volatile register uint32_t __R31;
#pragma DATA_SECTION(gpi, ".gpiData")
volatile uint32_t gpi;
/**
* main.c
*/
int main(void)
{
while (1) {
/* Read input */
gpi = __R31;
/* Send notification to host */
#ifdef AM33XX
__R31 = PRU0_ARM_EVENT+16;
#else
__R31 = PRU0_ARM_EVENT;
#endif
/* Wait */
__delay_cycles(1000);
}
/* Should never return */
return 0;
}
The resulting content of
pdk_am57xx_1_0_12/packages/ti/drv/pruss/test/src/pru_firmware/pruss_test_pru0_bin.h
is
const unsigned int XYZ[] = {
0x240000c0,
0x24010080,
0x0504e0e2,
0x2eff818e,
0x230007c3,
0x240001ee,
0x230010c3,
0x240100e1,
0xe100219f,
0x240021ff,
0x240000c0,
0x2401f380,
0x0501e0e0,
0x6f00e0ff,
0x10000000,
0x21000700,
0x230012c3,
0x21001100,
0x10000000,
0x20c30000};