How Can I Monitor and Store Captured SPI Data Over Long Evaluation Periods and Test Runs?

Question from the Customer:

I am looking for tools to use with an upcoming project. The tasks include extended evaluation periods that can last up to five days.  There are multiple SPI buses to monitor with speeds that vary from 1-2 Mbps. Although the periods can be lengthy, the data transactions will not be continuous; I estimate the data log per session will be 50 GB or less. My questions:

  • Which Total Phase tools would work best for this application?
  • I assume I will need one tool for each bus – can they log together on the same lab computer?
  • What are the constraints I need to know about logging this data? Available memory? Bus speed?

Response from Technical Support:

Thanks for your questions! For your project, we recommend the Beagle I2C/SPI Protocol Analyzer, which monitors SPI data non-intrusively. We also have two recommendations for storing the captured data, which are described below.

Monitoring the SPI Bus and Storing Data

Depending on the amount of data and the available memory on your machine, captured data can be stored via RAM or disk drive.  In addition to storing data, using the Data Center Software you will be to observe real-time data capture and display – seeing packets as they occur on the bus. Bit-level timing is available down to 20 ns of resolution. To quickly become familiar with the Beagle I2C/SPI analyzer, we recommend starting with the Beagle I2C/SPI Protocol Analyzer Quick Start Guide. Afterwards, you can use the Data Center Software or Beagle Software API to start monitoring your SPI devices.

You will need a separate Beagle I2C/SPI analyzer for each bus.  Each analyzer can be run from the same computer. The maximum number of analyzers depends on how many devices the computer can support on its USB bus.

Storing SPI Data using Data Center Software

Here is an overview of using the Data Center Software.

The Data Center Software streams the capture to the RAM on your PC. In this case, the capture limit is not determined by the disk space. Instead, it is determined from the available RAM space. The Capture Control dialog displays the Software Capture Buffer, which indicates the total amount of memory available in the Analysis PC. This Capture Data Limit can be adjusted in the Capture Settings menu.

By default, the capture limit is set to 50% of the available memory. The upper limit for capture is 80% of the available memory. On an extremely busy computer, the capture limit should be set lower. For example, if the application starts swapping memory, incoming capture data may be lost. We suggest targeting the maximum possible RAM to be able to achieve the best results.

Controlling the Data Center Software via Remote Terminal

With CLI (command line interface) commands and a remote console, you can control the Data Center Software from an external process, a script that controls Data Center Software. This enables a telnet terminal for other applications (or computers) to connect to and control the actions. For more information, see section 5.1.5 Command Line Options of the Data Center User Manual.

You can also create a script to automate tasks that can be run from a remote computer. An example is described in Controlling Data Center Software with a Remote Terminal and a Python Script. In this article, a Python script is used to capture and save data over a specific period: 3 seconds. A similar script could be used to export data as well. An example is described in the following subsection.

Capturing Data from a Remote Computer

Capturing data with a Python script:

Here is an example of capturing data with a remote computer. The computer that connects to the Beagle I2C/SPI analyzer is PC-1. The computer that runs the script is PC-2.

  1. Connect PC-1 with the Beagle I2C/SPI analyzer, and configure it with Telnet.
  2. Configure a remote PC-2 with Telnet, and open Telnet terminal to access PC-1.
  3. In PC-1, go do ...\data-center-windows-x86_64-v6.73\bin and run the datacenter.cmd as follows in command line: > datacenter.cmd -r 6000. From the above step, users can control the Data Center application when they cannot physically be in front of the machine running the application.
  4. In PC-2, run the script.

We have a Python script that you can easily modify for this use. This script is programmed to start capture at 8 pm and stop capture at 5 pm. You can alter the programmed timing as needed.

To do so:

  1. Replace localhost with the IP address of PC-1: line no.64 (tn = telnetlib.Telnet('localhost', 6000))
  2. Replace save path to the desired path in PC-1: line no.73 (SAVE = "save(u'/tmp/foo_%s.tdc', {'no_timing': False, 'filtered_only': False}, True)")

You will also need to modify this script to work with the Beagle I2C/SPI analyzer, as this example was originally created for the Beagle USB 12 Protocol Analyzer.

Looping the script:

You can loop the script to continuously capture and save data.

  1. Start capture.
  2. Run capture for a specified time.
  3. Stop capture.
  4. Save data to a file.
  5. Loop back to step 1.

Please note: saving data takes time; the longer the capture period, the more data is collected, and the more time is required to save data. A loss of data may occur in step 4. One possible workaround is extending the capture period and creating a “time buffer” for saving data.

A more detailed script can be created with API.

Storing Data via API Scripts

The Beagle Software API provides the means to create you own application.  The API supports multiple operating systems and programming languages.  Functional scripts are provided with the API that can be used as-is or modified as needed. The script entitled capture_usb480.c, which uses the Beagle USB 480 Protocol Analyzer to capture and store data to a hard drive, may be useful for your application and can be modified per the requirements of your setup and tools.

We hope this answers your questions. Additional resources that you may find helpful include the following:

If you need more information, feel free to contact us with your questions, or request a demo that applies to your application.

Request a Demo