Hardware Reference
In-Depth Information
Solution
The AM335x processor on the Bone has an ARM processor that is running Linux, but it
also has two 32-bit PRUs that are available for processing I/O. It takes a fair amount of un-
derstanding to program the PRU. Fortunately, a 2014 Google Summer of Code project pro-
duced PRU Speak , an adaptation of the BotSpeak language for the PRU. This solution
shows how to use it.
Background
PRU Speak comprises three main parts:
Kernel
The pru_speak.ko Linux kernel driver module loads PRU code and provides
communication between the kernel and the firmware running on the PRU. An associ-
ated device tree overlay called BB_PRUSPEAK-00A0.dtbo configures the pin ac-
cess and firmware loaded on to the PRUs.
Firmware
pru0_firmware and pru1_firmware are the firmware files for each of the two
PRUs.
Userspace
A Python user space component includes bs_tcp_server.py ; a TCP socket
listener that provides an interface to the PRU Speak interpreter; and
pru_speak.py , a library for invoking PRU Speak commands from within a
Python script.
Prerequisites
Many of the pins easily accessible by the PRU are taken up by the HDMI interface dis-
cussed in Recipe 5.1 . If you haven't already edited uEnv.txt , you can run these commands
to disable the HDMI interface and reboot:
bone# sed -i \
'/cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN$/
\
Search WWH ::




Custom Search