RAM Capture
Introduction
The ADRV903x provides a RAM capture feature for capturing raw RX/ORX ADC samples at various points in the signal chain. This is useful for debugging, signal analysis, and calibration verification.
The adrv903x-ramc IIO device exposes this feature with standard IIO buffer
support, allowing data capture using IIO Oscilloscope or command-line tools
like iio_readdev.
Note
RAM capture is a single-shot snapshot mechanism. Each buffer enable
triggers one capture that fills the buffer, then stops. For continuous
RX data streaming, use the JESD interface (axi-adrv903x-rx-hpc).
Note
The capture hardware can only sample one RX/ORX channel at a time. Only one I/Q channel pair can be enabled simultaneously.
IIO Device
The RAM capture interface appears as a separate IIO device named
adrv903x-ramc. It provides 10 channel pairs (RX0-RX7 and ORX0-ORX1), each
with I and Q components.
Channel Mapping
IIO Channel |
Signal |
|---|---|
|
RX0 |
|
RX1 |
|
RX2 |
|
RX3 |
|
RX4 |
|
RX5 |
|
RX6 |
|
RX7 |
|
ORX0 |
|
ORX1 |
Device Attributes
Attribute |
Access |
Description |
|---|---|---|
|
Read/Write |
Number of samples to capture. Valid values: 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 12288, 16384, 32768. ORX channels are limited to 12288 maximum. |
|
Read only |
Sample rate in Hz (matches RX IQ rate). |
Using IIO Oscilloscope
Connect to the board using IIO Oscilloscope.
In the Plot Channels panel, expand
adrv903x-ramc.Enable one I/Q channel pair (e.g.,
voltage0_iandvoltage0_qfor RX0).Click Capture to trigger a single-shot capture and display the data.
To capture from a different channel, disable the current pair and enable another.
Note
Attempting to enable channels from different RX/ORX pairs simultaneously will result in an error due to hardware constraints.
Using iio_readdev
Capture 1024 samples from RX0:
iio_readdev -u <uri> -s 1024 adrv903x-ramc voltage0_i voltage0_q > capture.bin
Capture from RX2:
iio_readdev -u <uri> -s 1024 adrv903x-ramc voltage2_i voltage2_q > capture.bin
Replace <uri> with the appropriate connection URI (e.g., ip:192.168.1.1
or local:).
The output file contains interleaved 32-bit signed I and Q samples in little-endian format.
Setting Capture Parameters
The sample_count attribute controls how many samples are captured:
# Check current value
cat /sys/bus/iio/devices/iio:device3/sample_count
# Set to 4096 samples
echo 4096 > /sys/bus/iio/devices/iio:device3/sample_count
Note
The device number (iio:device3) may vary depending on the system
configuration. Use iio_info or check /sys/bus/iio/devices/*/name
to identify the adrv903x-ramc device.
debugfs Interface
A simplified debugfs interface is also available for quick single-shot
captures without IIO buffer setup under the adrv903x-phy device.
Usage:
# Trigger capture: channel 0 (RX0), 256 samples
echo "0 256" > /sys/kernel/debug/iio/iio:device1/rx_data_capture
# Read captured data
cat /sys/kernel/debug/iio/iio:device1/rx_data_capture
Channel numbers for debugfs:
0-7: RX0-RX78-9: ORX0-ORX1
The output is raw 32-bit values in hardware format (interleaved I/Q with bank layout). The IIO device interface is recommended for most use cases as it handles the data format conversion automatically.