PRU and RPROC

Hello. I am trying to run a program using PRU on beaglebone black (RPROC, programming language C). Using Debian 11, kernel 5.10.168-ti-r71.
The goal is to make the led blink through PRU (header 9, pin 31).
I am following this tutorial: Programming the BeagleBone PRU-ICSS

I have compiled the program and got an output file and a compiled file as it should. But I get this error:
warning: no suitable entry-point found; setting to 0

The c program is the same as in tutorial. I made few changes in the Makefile because the tutorial Makefile gave me errors. Here is my Makefile:

PRU_SWPKG = /usr/lib/ti/pru-software-support-package
PRU_LIBCA = /usr/share/ti/cgt-pru

CC = clpru

LD = lnkpru
CFLAGS = --include_path=$(PRU_SWPKG)/include \
         --include_path=$(PRU_SWPKG)/include/am335x
         --include_path=$(PRU_LIBCA)/lib \
LDFLAGS = $(PRU_SWPKG)/include/am335x/AM335x_PRU.cmd

all:	am335x-pru0-fw

hello-pru0.o: hello-pru0.c
	$(CC) $(CFLAGS) $^ --output_file $@

am335x-pru0-fw: hello-pru0.o
	$(LD) $(LDFLAGS) $^ -o $@

Once I make:

clpru --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x hello-pru0.c --output_file hello-pru0.o

lnkpru hello-pru0.o -o am335x-pru0-fw

warning: no suitable entry-point found; setting to 0

I do not understand the problem with this. Any solutions?

Can you try linking with clpru instead of lnkpru? Also, you might need to link libc and crt0 , in addition to your firmware.

Check how the TI software examples do it here.

If you decide to copy that example, keep in mind that you must use PRU SW Package version v6.1.0 when working with kernel v5.10.

Regards,
Dimitar

1 Like

You’re not linking in the linker command file AM335x_PRU.cmd.
to compile and link add -z and the command file to the compiler command line.
e.g.
clpru -z --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x hello-pru0.c --output_file hello-pru0.o (path_to_file)AM335x_PRU.cmd

If you choose to use the linker (lnkpru) standalone you will need to list the libraries (libc.a etc) on the command line as well as the linker command file.