comm.SDRuTransmitter can not work with my USRP X310

46 vues (au cours des 30 derniers jours)
Alfred
Alfred le 19 Nov 2025 à 13:50
Commenté : Gavin Grant il y a environ 22 heures
I use matlab 2025a and I can connect to my USRP X310 in the radioSetupWizard. Actually, I can use basebandtransmitter to control my X310. However, when I use comm.SDRuTransmitter or comm.SDRuReceiver, it reports error as blow.
How can I solve this problem?
Thanks
Configure SDRu Transmitter and Transmit Data
Create an SDRu transmitter System object for your USRP radio at the default IP address, 192.168.10.2. Configure a sample rate of 1 MHz.
mcr = 200e6;
sampleRate = 1e6;
tx = comm.SDRuTransmitter(Platform="X310", ...
IPAddress="192.168.40.2",...
MasterClockRate=mcr, ...
InterpolationFactor=mcr/sampleRate)
tx =
comm.SDRuTransmitter - :
Platform: 'X310'
IPAddress: '192.168.40.2'
ChannelMapping: 1
CenterFrequency: 2.4500e+09
LocalOscillatorOffset: 0
Gain: 8
PPSSource: 'Internal'
EnableTimeTrigger: false
ClockSource: 'Internal'
MasterClockRate: 200000000
InterpolationFactor: 200
TransportDataType: 'int16'
EnableBurstMode: false
Create a 40 kHz sine wave for transmission.
freq = 40e3;
samplesPerFrame = 50e3;
sinewave = dsp.SineWave( ...
Amplitude=2,Frequency=freq, ...
SampleRate=sampleRate, ...
SamplesPerFrame=samplesPerFrame, ...
OutputDataType="double", ...
ComplexOutput=true);
data = sinewave();
Since the input to the SDRu transmitter System object must be in the range [-1,1], normalize the data before transmission.
amp = max(abs(data));
NormalizedData = data/amp;
Create a spectrum analyzer and time scope object to visualize the signal.
spectrumScope = spectrumAnalyzer("SampleRate",sampleRate);
frameDuration = samplesPerFrame/sampleRate;
timeScope = timescope("TimeSpan",4/freq,"SampleRate",sampleRate);
disp("Transmission started");
Transmission started
spectrumScope(NormalizedData);
timeScope(NormalizedData);
Transmit the normalized data for 10 seconds using the SDRu transmitter System object tx.
stopTime = 10;
time = 0;
while time < stopTime
tx(NormalizedData);
time = time+frameDuration;
end
Win32; Microsoft Visual C++ version 1936; Boost_108100; UHD_4.6.0.0-vendor
---------- see libuhd version information above this line ----------
错误使用 reportSDRuStatus (第 106 行)
An error occurred: Could not execute UHD driver command in 'openDataConnection_c':
Non-default FPGA image detected on X310 device 0. Use sdruload to load the default FPGA image.
出错 comm.internal.SDRuBase/setupImpl
Release the hardware resources.
release(tx)

Réponse acceptée

Gavin Grant
Gavin Grant le 21 Nov 2025 à 11:08
Alfred,
Many thanks for reaching out about the issue you encountered while attempting to use the comm.SDRuTransmitter and comm.SDRuReceiver system objects.
As indicated by the error message, the X310 had a non-default FPGA image loaded (likely the basebandTransmitter image, assuming you used that application beforehand). The comm.SDRuTransmitter and comm.SDRuReceiver objects require the default Ettus FPGA image to work.
Please run:
sdruload('Device','x310','IPAddress','192.168.40.2')
to load the default Ettus FPGA image. Then you can proceed to run the code you shared.
Note that basebandTransmitter (and other application objects) automatically load the required FPGA image. comm.SDRuTransmitter/comm.SDRuReceiver currently do not.
Best regards,
Gavin
  4 commentaires
Alfred
Alfred il y a environ 5 heures
Gavin
Thank you. I solved my problem with your help.
By the way, I think the comm.SDRuTransmitter sends data to the X310, but the X310 will not actually generate RF signal until it has received enough data. Is this correct?
Can I transmit just several bits every time?
Thanks,
Alfred
Gavin Grant
Gavin Grant il y a environ 7 heures
Alfred,
That's great - glad that resolved the issue.
Regarding the RF transmission, the USRP will initiate a transmission each time the system object is stepped, i.e. each time you call tx(data). It will not buffer-up data unless you use burst mode transmission, documented here.
The basebandTransmitter application likewise does not enforce a minimum frame size, i.e. you can transmit several bits each time.
Best regards,
Gavin

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Communications Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by