Hello!
I would like to ask for some help getting the PRUs working on my BeagleBone Black Rev C. I have a very simple C loader program using the PRU Linux Appication Loader API, which looks like this:
#include <stdio.h>
#include <prussdrv.h>
#include <pruss_intc_mapping.h>
#define PRU_NUM 0
int main()
{
int n;
int retval;
const tpruss_intc_initdata pruss_intc_initdata=PRUSS_INTC_INITDATA;
retval=prussdrv_init();
printf(“prussdrv_init() returned %d\n”, retval);
retval=prussdrv_open(PRU_EVTOUT_0);
printf(“prussdrv_open() returned %d\n”, retval);
retval=prussdrv_pruintc_init(&pruss_intc_initdata);
printf(“prussdrv_pruintc_init() returned %d\n”, retval);
retval=prussdrv_exec_program(PRU_NUM, “./asmtest2.bin”);
printf(“prussdrv_exec_program() returned %d\n”, retval);
n=prussdrv_pru_wait_event(PRU_EVTOUT_0);
printf(“PRU program completed, event number: %d\n”, n);
prussdrv_pru_disable(PRU_NUM);
prussdrv_exit();
return 0;
}
<<<
“asmtest2.bin” is the binary which should be loaded onto PRU0 and it consist of a single HALT instruction, for testing purposes.
Basically, my loader program fails at prussdrv_open(), which returns -1, i.e. it fails. The next function call, “prussdrv_pruintc_init()” causes a segmentation fault. Please note that the PRU program (asmtest2.bin) is not causing the problem since the loader program does not even get to the line which contains its name.
I beleive that I have enabled the PRU, because I uncommented the following line in /boot/uEnv.txt (and then rebooted):
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
I have also tried uncommenting or adding these lines in the same file:
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-9-TI-00A0.dtbo
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-PRUCAPE-00A0.dtbo
The DTBO files indicated above exist.
I have also tried running the loader application as an administrator. None of these had any effect.
Can you help me figure out what is causing the problem?
My Linux version is: Linux version 4.9.82-ti-r102 (root@b2-am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) )
Thanks and regards
Daniel