Note: this page contains old ACME related information. We keep it here for reference only. For latest ACME updates, please visit this page:
BayLibre ACME (Another Cute Measurement Equipment)


ACME by BayLibre

This page contains basic documentation for the BayLibre Another-Cute-Measurement-Equipment (ACME) software suite.

Please note, that the project itself is still work-in-progress and the software suite should be treated as a Proof-of-Concept.

What is it?

Part of the Baylibre Team has been dealing with power measurements and optimizations for many years, accumulating frustrations by all the limited and/or adhoc solutions that were available:

  • Windows-only / not Linux-friendly,
  • Proprietary drivers,
  • Limited/ not flexible proprietary application suite,
  • Limited automation capabilities,
  • Too expensive,
  • Too complicated to use,
  • Not accurate enough,
  • Lack of standard power measurement connector (adhoc solutions only),
    • HW tweaks required on development boards to get access to power rails

Hence the ACME initiative was launched, with the objective of getting rid of all these limitations and providing the community with the most flexible low-cost but high-perf solution!

The proposed solution comes as an extension for the BeagleBone Black (the ACME Cape), designed to provide multi-channel power and temperature measurements capabilities to the BeagleBone Black (BBB). It comes with power and temperature probes integrating a power switch (the ACME Probes), turning it into an advanced all-in-one power/temperature measurement solution.

The ACME initiative also proposes a new standard (free of charge) for power measurement connector (the ACME Power Connector), to solution the issue of development boards not being ready for power measurements.

The ACME initiative is completely open source, from HW to SW drivers and applications.

Key Features

  • Leverage BeagleBone Black for data processing (1GHz CPU)
  • Leverage TI INA226 to do voltage, current & power acquisition
    • 16-bit ADC, 7KHz max sampling rate, 10μV max offset
    • Upstream Linux device driver
  • Leverage TI TMP435 to do temperature measurement
    • Upstream Linux device driver (TMP401-compatible)
  • Multi-channel
    • 8, up to 16 with Cape stacking
  • All-in-one solution for power measurement, power control, and temperature measurement
  • Flexible / Evolutive
    • Extension connector for use with other HW than BBB
    • New probes can be designed, w/o HW change required on ACME cape
  • Complete Open Source SW Suite
  • Standard ACME Probe Connector (free of charge)
  • Automatic probe insertion/removal detection
  • Scalable HW design to reduce cost

HW Schematics

ACME Cape and Probes HW schematics may be downloaded from this link.

Pre-Built SDCard Images

Simply download an image according to your application, untar and flash (using dd) onto an SDCard. The first time, log into the BeagleBone-Black using minicom (115200 bauds) to setup your credentials and hostname if needed.

Image with Sigrok/HWMON

Download link for a standalone device with an Oscilloscope-like GUI and also on-board sigrok command line tools.

Image with IIO capture deamon

Download link for a remotely operated device for automation in a test infra using host-side client tools.

Building the Software with IIO

If you are looking for a fairly automated build environment retrieve the 'repo' style repository like following:

The board will be reachable with AVAHI, by default its name is baylibre-acme.local, however, you may have to first log into it through minicom to set your credentials if not already done.

Please refer to the README as it may be more up to date.

Building the Software with Sigrok / HWMON

Sigrok is a portable, cross-platform, Free/Libre/Open-Source signal analysis software suite that supports various device types (e.g. logic analyzers, oscilloscopes, power monitors, and many more). Sigrok is actively developed and maintained. We have chosen sigrok as the default front-end for ACME. For more information refer to sigrok.org.

Buildroot generated rootfs

Sigrok packages have several external dependencies and are somewhat difficult to cross-compile. In order to make it easier for users to enjoy sigrok on their ACME enabled BeagleBone Black we have prepared sigrok packages for buildroot. They are now available in upstream thanks to BayLibre's contributions.

In order to generate the root file system containing all sigrok packages and dependencies:

  • checkout current git HEAD from http://git.buildroot.net/buildroot/,
  • download our custom buildroot config, copy it into buildroot main directory and rename it to .config,
  • run make -j <number of CPUs available> and… wait - the process can take quite some time due to several big packages, like Qt5, being compiled,
  • the build will result in rootfs.tar file being present in output/images directory - this is the rootfs you're going to extract to your SD card or eMMC of the BBB.

The above config file will make buildroot generate an image containing the command-line utility sigrok-cli and the graphical user interface pulseview (based on Qt5), which can be run through a minimal window manager - fluxbox - which is configured as well.

Additional configuration

Such buildroot-generated root file system is mostly ready to work, but in order to automate the initialization of ACME probes you can put the following script into /etc/init.d. This will initialize the probes, reload the drivers and start the X-server and fluxbox window manager for both the HDMI port and in a virtual console accessible via vncviewer.

You can use this script as is or use it as an example.

Linux kernel and u-boot image

Linux

ACME uses mainline Linux version >= 4.0 plus a simple device tree patch available here.

The kernel can be compiled by standard debian toolchain using this config file.

After patching and configuring linux execute:

ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make zImage modules dtbs

After the build finishes copy zImage and am335x-boneblack.dtb onto the boot partition of the SD card and install modules on the rootfs partition by: ARCH=arm make modules_install INSTALL_MOD_PATH=<SD card mount point>.

u-boot

The defconfig for BeagleBone is am335x_evm.

To rebuild (using the same toolchain as the kernel):

  git clone git://git.denx.de/u-boot.git && cd u-boot
  ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make am335x_evm_config
  ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make

Typical boot process for BeagleBone Black using u-boot includes two u-boot phases:

The BeagleBoard ROM bootloader first loads a file called “MLO” from the SD card. This requires special formatting of the SD card and copying of the “MLO” file to the SD card. The “MLO” file is provided by u-boot's Secondary Program Loader (SPL) functionality. It is placed into the u-boot folder upon build.

The U-Boot SPL configures the off-chip memory and then loads the full u-boot. The file is typically called “u-boot.img” and SPL will typically look for it in the root folder of a FAT partition, but other options are possible.

Example uEnv.txt for ACME:

  bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p2 rootwait
  bootcmd=load mmc 0 0x80F80000 am335x-boneblack.dtb; load mmc 0 0x80200000 zImage; bootz 0x80200000 - 0x80F80000
  uenvcmd=boot

Basic sigrok tutorial

For detailed sigrok-cli and pulseview manual please refer to:

We are only presenting ACME-specific configuration options here.

Executing sigrok-cli –show –driver=baylibre-acme displays various info about detected probes and supported options:

  # sigrok-cli --show --driver=baylibre-acme
  Driver functions:
      Continuous sampling
      Sample limit
      Time limit
      Sample rate
  baylibre-acme - BayLibre ACME with 10 channels: P1_ENRG_PWR
  P1_ENRG_CURR P1_ENRG_VOL P2_ENRG_PWR P2_ENRG_CURR P2_ENRG_VOL
  P7_TEMP_IN P7_TEMP_OUT P8_TEMP_IN P8_TEMP_OUT
  Channel groups:
      Probe_1: channels P1_ENRG_PWR P1_ENRG_CURR P1_ENRG_VOL
      Probe_2: channels P2_ENRG_PWR P2_ENRG_CURR P2_ENRG_VOL
      Probe_7: channels P7_TEMP_IN P7_TEMP_OUT
      Probe_8: channels P8_TEMP_IN P8_TEMP_OUT
  Supported configuration options across all channel groups:
      continuous: 
      limit_samples: 0 (current)
      limit_time: 0 (current)
      samplerate (1 Hz - 500 Hz in steps of 1 Hz)

Sigrok expects ACME to be initialized i.e. probes enabled by setting proper GPIOs & ina2xx/tmp401 drivers loaded. Script available in Additional configuration section handles such initialization.

Each probe is seen by libsigrok as a channel-group composed of three (power-probe) or two (temperature-probe) channels. Configuration settings in libsigrok are split into general options and channel-group specific options. You can display channel-group specific options by appending the –channel-group=<channel group name> to the above command:

  # sigrok-cli --show --driver=baylibre-acme --channel-group=Probe_1
  Driver functions:
      Continuous sampling
      Sample limit
      Time limit
      Sample rate
  baylibre-acme - BayLibre ACME with 10 channels: P1_ENRG_PWR
  P1_ENRG_CURR P1_ENRG_VOL P2_ENRG_PWR P2_ENRG_CURR P2_ENRG_VOL
  P7_TEMP_IN P7_TEMP_OUT P8_TEMP_IN P8_TEMP_OUT
  Channel groups:
      Probe_1: channels P1_ENRG_PWR P1_ENRG_CURR P1_ENRG_VOL
      Probe_2: channels P2_ENRG_PWR P2_ENRG_CURR P2_ENRG_VOL
      Probe_7: channels P7_TEMP_IN P7_TEMP_OUT
      Probe_8: channels P8_TEMP_IN P8_TEMP_OUT
  Supported configuration options on channel group Probe_1:
      probe_factor: 10 (current)
      power_off: on (current), off

The following image represents which probe number is attributed to which ACME cape connector.

ACME supports the following global configuration options:

  • continuous
  • limit_samples
  • limit_time
  • samplerate

The first three allow to affect data acquisition by specifying a samples limit, limiting the time of sampling or acquiring data until interrupted by user.

The samplerate option allows to specify the update interval for measurements. Setting this also affects the internal update interval of the ina226/tmp435 chips. The samplerate argument is given in Hz and the accepted range for ACME is 1-500 Hz:

  # sigrok-cli --driver=baylibre-acme --samples=3
  --channels=P8_TEMP_IN,P8_TEMP_OUT --config samplerate=10
  FRAME-BEGIN
  P8_TEMP_IN: 24.500000 °C
  P8_TEMP_OUT: 25.813000 °C
  FRAME-END
  FRAME-BEGIN
  P8_TEMP_IN: 24.500000 °C
  P8_TEMP_OUT: 25.813000 °C
  FRAME-END
  FRAME-BEGIN
  P8_TEMP_IN: 24.500000 °C
  P8_TEMP_OUT: 25.813000 °C
  FRAME-END
  # sigrok-cli --driver=baylibre-acme --samples=3
  --channels=P8_TEMP_IN,P8_TEMP_OUT --config samplerate=503
  sr: baylibre-acme: Maximum sample rate is 500
  Failed to set device option 'samplerate': invalid samplerate.

Naturally all standard sigrok-cli parameters work for ACME as well - e.g. –output-format:

  # sigrok-cli --driver=baylibre-acme --samples=3 --output-format=csv
  --channels=P8_TEMP_IN,P8_TEMP_OUT,P7_TEMP_IN,P7_TEMP_OUT
  ; CSV, generated by libsigrok 0.3.0 on Thu Jan  1 00:37:48 1970
  ; Channels (4/10): P7_TEMP_IN, P7_TEMP_OUT, P8_TEMP_IN, P8_TEMP_OUT
  ; Samplerate: 10 Hz
  26.000000,27.625000,24.563000,25.688000
  26.000000,27.625000,24.563000,25.688000
  26.000000,27.625000,24.563000,25.688000

Power-probes use the probe_factor option to allow to change the shunt resistor calibration value. The arguments is the desired resistance in mOhms:

  # sigrok-cli --driver=baylibre-acme --channel-group=Probe_1 --config
  probe_factor=80 --set
  # sigrok-cli --driver=baylibre-acme --channel-group=Probe_1 --get probe_factor
  80

As the shunt resistor value depends on the expected current range to be measured, ACME power probes have been populated with different shunt resistor values:

  • USB power probes come with a 80mΩ shunt resistor
  • JACK power probes come with a 10mΩ shunt resistor
  • HE10 power probes come with either:
    • 5mΩ shunt resistor (5L0 label on the shunt)
    • 50mΩ shunt resistor (R05F label on the shunt)
    • 500mΩ shunt resistor (R50F label on the shunt)

Unfortunately there is no automatic detection mechanism available in revision 1. It is easily scriptable though using sigrok-cli.

Additionally USB- and jack-probes are equipped with a power-switch allowing to remotely cut/restore the power to the measured device. This can be triggered by the power_off config option:

  # sigrok-cli --driver=baylibre-acme --channel-group=Probe_1 --config
  power_off=true --set
  # sigrok-cli --driver=baylibre-acme --channel-group=Probe_1 --get power_off
  true
  # sigrok-cli --driver=baylibre-acme --channel-group=Probe_1 --config
  power_off=false --set
  # sigrok-cli --driver=baylibre-acme --channel-group=Probe_1 --get power_off
  false

All the above options are advertised by libsigrok to all types of front-ends. PulseView for instance interprets them and displays proper widgets in the device configuration pop-up, so they're available in the GUI as well.

Known limitations and planned features

The main limitation is that currently there is no way for libsigrok to send its data over the network, so both pulseview and sigrok-cli must be used locally on the BeagleBone Black. In case of sigrok-cli it isn't such a problem - it suffices to just use ssh/telnet/serial port to access the console, but in order to use pulseview you need either a monitor connected to the BeagleBone Black HDMI port or vncviewer and an X-server using a virtual frame buffer. And of course a minimal window manager.

Planned features/work-in-progress

The following features are currently being worked on and should be available in upstream sigrok soon:

  • add a transform module for averaging of analog samples,
  • make pulseview display values and units of analog channels at selected points in time,
  • add vertical scaling of analog channels to pulseview (currently measurement changes for small values are not very well visible).

Sigrok IIO

The integration of the IIO driver into sigrok is Work In Progress. This is done in the form of a “generic-iio” driver that maps the IIO ontology for industrial devices/scan_elements into the Sigrok ontology for hardware monitoring channel-groups/channels.

This integration of IIO also makes possible to remotely connect to the ACME using its IP address with the traditional “conn” driver option.

Example:

$> sigrok-cli --driver generic-iio:conn=$ACME_IP --samples 3

For more information pertaining to IIO with acme, see this section

Simple Command Line Applets

IIO Capture Applet

A sample applet is available to record the power-data and generate basic statistics. Please refer to https://github.com/BayLibre/iio-capture

IIO Monitor

in the example folder of libiio, you will find a small application called iio-monitor, that can come in handy to display real-time values install libcdk5-dev, and build it!

Bugs & feature requests

Please send all bug reports and feature requests to acme@baylibre.com or directly to sigrok or buildroot mailing lists for sigrok and buildroot related problems with ACME.

ACME legacy software-suite

Legacy software for ACME is deprecated and no longer supported. If you really need some features, which are not yet available in sigrok, please refer to the legacy manual.

acme/oldstart.txt · Last modified: 2017/09/20 10:52 by sjan
Recent changes RSS feed Creative Commons License Donate Minima Template by Wikidesign Driven by DokuWiki