Google Summer of Code: Bidirectional I/O and PRU Programming on BeagleBone
Overview
Google Summer of Code 2019 · BeagleBoard.org
My first sustained open-source contribution, and the work that pulled me toward low-level systems.
The problem
The PocketBeagle is small, capable, and short on GPIO. Many embedded projects need more digital I/O than the header exposes, and the standard answer — shift registers — is well understood in principle but poorly documented in practice for this board, particularly for bidirectional operation.
Bidirectional I/O
I built and documented a set of interfacing configurations against the BeagleBone and PocketBeagle:
- 74HC595 serial-in / parallel-out, for output expansion
- 74HC299 universal shift register in general I/O configuration — the bidirectional case
- Two cascaded 74HC595s driving 16 LEDs
- 74HC299 driving a 16×2 character LCD
- 74HC299 driving four seven-segment displays
Each configuration ships with a Fritzing circuit diagram, a rendered image, a bill of materials, and working code — because the gap for someone attempting this is rarely the concept, it is the wiring and the timing.
The work is documented on the eLinux GSoC 2019 progress wiki.
PRU programming
The AM335x on the BeagleBone carries two Programmable Real-Time Units — 200 MHz cores independent of the ARM, intended for deterministic I/O the Linux scheduler cannot guarantee.
Getting code onto them was, at the time, badly under-documented. I wrote a guide covering the prussdrv path end to end, published as pru_prussdrv and linked from the eLinux wiki.
This is where the systems interest started. The PRU sits exactly at the hardware/software boundary — no operating system, cycle-deterministic execution, memory shared with a Linux host that may preempt at any moment. Reasoning about that is the same reasoning I now apply to binary instrumentation and RTL design, a few layers apart.
Repositories
pocket_beagle-work— shift register interfacing (see thewipbranch for the final state)pru_prussdrv— PRU programming guide
Both are archived. They are referenced from the eLinux wiki and are kept as they were at the end of the programme.
Related
An earlier write-up covers the application and the summer itself.