Kernel module, device tree overlay, and PRU firmware to interface to camera using the PRUs on the AM335x.
NOTE: This was tested on Debian with kernel 5.10. TI's PRU support libraries are constantly changing, so this likely does not work on older kernels anymore.
Programible Real-time Units. It a microcontroller that shares pins and other resource with the core processor allowing for custom interface to other hardware like cameras. See TI PRU-ICSS webpage for more details.
NOTE: The kernel module requires both the device tree overlay and pru firmware binaries to be installed to work, so build and insert it last.
$ sudo apt install device-tree-compiler
$ make -C src/device_tree_overlay
$ sudo make -C src/device_tree_overlay install
/boot/uEnv.txt
#dtb_overlay=<file8>.dtbo
line to dtb_overlay=/lib/firmware/prudev-00A0.dtbo
#enable_uboot_cap_universal=
line is commented out.$ sudo reboot
$ sudo apt install ti-pru-cgt-v2.3 ti-pru-software-v6.0
$ make
$ sudo make install
$ sudo apt-get install linux-headers-`uname -r`
$ make -C src/kernel_module clean all
$ sudo insmod src/kernel_module/prucam.ko
$ sudo rmmod prucam
$ cd testing/camera-test-c
$ make
$ sudo ./test_camera
capture_001.bmp
prucam-dkms
is the kernel module that provides the sysfs interfaces to the
pru and ar013x camera settings. This package will also install the compiled pru
firmware and the prucam dtbo. NOTE when install, it will auto load the module.
To build prucam-dkms
:
$ sudo apt install --no-install-recommends --no-install-suggestions debhelper fakeroot dkms linux-headers-`uname -r` device-tree-compiler ti-pru-cgt-v2.3 ti-pru-software-v6.0
--no-install-*
flags are due to dkms
installing linux-headers
package for the wrong kernel version$ ./makedeb.sh