PRU development w/ Supruglue

Hi all,

Following on my earlier post, Project report: Bazel build for am335x PRU, I thought I’d share an update.

While still under development, GitHub - jmacd/supruglue: PRU test kit, has become a functional development environment, containing:

  1. Bazel crosstools setup for running TI PRU tools
  2. Bazel BUILD definitions for the TI pru-software-support-package
  3. Lightweight system libraries (RPMsg, debug logs, GPIO, clock, …)
  4. Code generation for system events, pin definitions, etc.
  5. Test harness using Googletest
  6. Golang tools to inspect, invoke, and print debug logs on the device.

So far it includes just one example, it has two independent coroutines looking like

void toggle_blue(ThreadID tid, Args args) {
  gpio_pin pin = GPIO_PIN(P9_23);
  PRULOG_2U(INFO, "starting blue half-cycle %uns", BLUE_PERIOD, 0);
  while (1) {
    PRULOG_2U(INFO, "blue on", 0, 0);

    GPIO_SetPin(pin, 1);
    Sleep(BLUE_PERIOD);

    PRULOG_2U(INFO, "blue off", 0, 0);

    GPIO_SetPin(pin, 0);
    Sleep(BLUE_PERIOD);
  }
}

Thanks for reading,
Josh

1 Like