comm.SDRuTransmitter can not work with my USRP X310
46 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alfred
el 19 de Nov. de 2025 a las 13:50
Comentada: Gavin Grant
hace alrededor de 22 horas
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)
0 comentarios
Respuesta aceptada
Gavin Grant
el 21 de Nov. de 2025 a las 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 comentarios
Gavin Grant
hace alrededor de 7 horas
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Communications Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!