Pure go implementation of pru app loader for beaglebone black. It is a port of this code:

go get



Pure go implementation of pru app loader for beaglebone black. C source of Pruss app loader (the inspiration for this)

The quality of this code is hacked at best (at the moment). See prussdrv_test.go for usage.

gopru is licensed under the two-clause BSD license. See LICENSE.txt.

example usage

package main

import (

func main() {

    drv, err := pruss.InitDrv()
    if err != nil {
        log.Panicln("Error initializing:", err)

    defer func() {
        err := drv.Close()
        if err != nil {
            log.Panicln("Error closing:", err)

    // Open the interrupt.  One needs the listener to wait on them later
    listener, err := drv.OpenInterrupt(pruss.PRU_EVTOUT_0); 
    if err != nil {
        log.Panicln("Error opening interrupt:", err)

    if err = drv.InitInterrupts(); err != nil {
        log.Panicln("Error initializing interrupts:", err)

    pru := drv.Pru(0)
    if err = pru.ExecProgram("my_program.bin"); err != nil {
        log.Panicln("Error executing image:", err)
    defer pru.Disable()

    // Wait for the program to send an interrupt

pasm wrapper

the pasm directory contains a port of the pasm assembler (from It is modified to be callable via cgo. This allows for testing to be much easier for gopru. (see prussdrv_test.go for example)

pasm's license can be found in pasm/LICENSE.txt