SYSFS interface
The shepherd kernel module provides a user interface that exposes relevant parameters and allows control of the state of the underlying shepherd engine consisting of the kernel module and the firmware running on the two PRU cores. When the module is loaded, the interface is available under /sys/shepherd
Basic Functionality
state
: current state of the pru state-machine, mostlyidle
orrunning
, plus some transitional states. Also used to control the PRU by settingstart
orstop
.mode
: can be eitheremulator
orharvester
and some debug-modesn_buffers
: The maximum number of buffers used in the data exchange protocolsamples_per_buffer
: The number of samples contained in one buffer. Each sample consists of a current and a voltage value.buffer_period_ns
: Time period of one ‘buffer’. Defines the sampling rate together withsamples_per_buffer
memory/address
: Physical address of the shared memory area that contains alln_buffers
data buffers used to exchange datamemory/size
: Size of the shared memory area in bytespru_msg_box
: in and out message box to communicate with the PRUspru0_firmware
&pru1_firmware
: allows to load a custom firmware, likeam335x-pru0-programmer-SWD-fw
Virtual Source
dac_auxiliary_voltage_raw
: secondary voltage channel of emulator and harvester. Set before starting the experiment if needed.calibration_settings
: Load calibration settings. They are used in the virtual source algorithm.virtual_converter_settings
: Settings which configure the emulator algorithm.virtual_harvester_settings
: Settings for both the emulator and harvester modesync/error_sum
: Integral of PID control errorsync/error
: Instantaneous PID control errorsync/correction
: PRU Clock correction (in ticks, ~5ns) as calculated by the PID controller
PRU Programmer
programmer/state
: state machine of the programmer firmware for the PRU, similar to the first stateprogrammer/protocol
: programming protocol (SBW or SWD)programmer/datasize
: after writing the firmware to the shared ram, the actual size has to be written hereprogrammer/datarate
: in bits/secondprogrammer/pin_tck
: gpio pin of the PRUprogrammer/pin_tdio
: see comment aboveprogrammer/pin_tdo
: see comment aboveprogrammer/pin_tms
: see comment above
Note
PRU0 must be loaded with a special firmware. The sheep-program does that automatically.