在进行 USRP 开发时遇到了一些报错,这里做个记录解决问题的方法。
报错1:
Checking radio connections…
---------- begin libuhd error output ----------
Exception caught in safe-call.
in __cdecl ctrl_iface_impl<0>::~ctrl_iface_impl(void)
at B:\3p\sources\UHD\lib\rfnoc\ctrl_iface.cpp:52
this->send_cmd_pkt(0, 0, true); -> EnvironmentError: IOError: Block ctrl (CE_01_Port_40) packet parse error - EnvironmentError: IOError: Expected packet index: 425 Received index: 426
---------- end libuhd error output ----------
discover radio!
警告: SerialNum 属性与 System object 的此配置无关。位置:matlab.system.SystemProp/setProperties
位置: comm.internal/SDRuBase
位置: comm/SDRuTransmitter
位置: test (第 24 行)
报错2:
Checking radio connections…
---------- begin libuhd error output ----------
Exception caught in safe-call.
in __cdecl lmx2592_impl::~lmx2592_impl(void)
at B:\3p\sources\UHD\lib\usrp\common\lmx2592.cpp:155
_regs.powerdown = 1; commit(); -> EnvironmentError: IOError: Block ctrl (CE_01_Port_40) packet parse error - EnvironmentError: IOError: Expected packet index: 376 Received index: 375
---------- end libuhd error output ----------
警告: An error occurred: Could not execute UHD driver command in ‘createDriver_c’: Could not create a UHD driver using IP addr ‘192.168.10.2’. Attach a device at the
specified address, correct the specified address to match an already attached device, or continue to work in off-line mode.
Error from UHD: EnvironmentError: IOError: Block ctrl (CE_01_Port_40) packet parse error - EnvironmentError: IOError: Expected packet index: 375 Received index: 376.位置:coder.internal.warning (第 8 行)
位置: reportSDRuStatus (第 104 行)
位置: findsdru (第 205 行)
位置: mytransmitter (第 127 行)
错误使用 mytransmitter (第 146 行)
no discover radio!
报错3:
错误使用 comm.SDRuTransmitter/stepImpl
Transmit unsuccessfully: Could not execute UHD driver command in ‘sendData_c’: EnvironmentError: IOError: Block ctrl (CE_01_Port_40) packet parse error -
EnvironmentError: IOError: Expected packet index: 451 Received index: 452出错 test (第 35 行)
tx(modSignal);
错误 3 可以尝试释放资源,再次运行。
实验室一台 Win10 台式电脑可以正常驱动 USRP 工作且不报错,我的电脑操作系统是 win11,因此怀疑是操作系统的原因,因此安装了个 win10 的虚拟机进行开发 USRP,果不其然,问题游刃而解。
可以尝试一下将 MATLAB 升级到 2023b,然后也将 USRP 的固件烧录成和 MATLAB 对应的版本 UHD_4.2.0.0-vendor
我的qq:2442391036,欢迎交流!