On x86 computer, the official document is quite straightforward.
I installed usdr-lib, which contains a SoapySDR plugin, to /usr/local
. Then, the SoapySDR installed from ArchLinux package manager can detect the plugin and then the device, by: LD_LIBRARY_PATH=/usr/local/lib SoapySDRUtil --find
I'm using this hat https://www.waveshare.com/pcie-to-m.2-board-c.htm
Detected usdr at 01:00.0 (no drivers installed at this stage):
pi@raspberrypi:~/usdr-lib/src/lib/lowlevel/pcie_uram/driver $ lspci -nnk
0000:00:00.0 PCI bridge [0604]: Broadcom Inc. and subsidiaries Device [14e4:2712] (rev 21)
Kernel driver in use: pcieport
0000:01:00.0 Memory controller [0580]: Xilinx Corporation Device [10ee:7044]
Subsystem: Xilinx Corporation Device [10ee:0007]
0001:00:00.0 PCI bridge [0604]: Broadcom Inc. and subsidiaries Device [14e4:2712] (rev 21)
Kernel driver in use: pcieport
0001:01:00.0 Ethernet controller [0200]: Device [1de4:0001]
Kernel driver in use: rp1
Using github master branch latest (2024.8.27), following https://docs.wsdr.io/software/compile.html
mkdir build
cd build
cmake-DCMAKE_INSTALL_PREFIX:PATH=/usr ../src
make
sudo make install
Compiling the module also works
pi@raspberrypi:~/usdr-lib/src/lib/lowlevel/pcie_uram/driver $ make
make -C /lib/modules/6.6.31+rpt-rpi-2712/build M=/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.31+rpt-rpi-2712'
CC [M] /home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.o
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c: In function ‘usdr_device_initialie’:
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c:630:22: warning: unused variable ‘directirqs’ [-Wunused-variable]
630 | unsigned i, irq, directirqs, mxsps;
| ^~~~~~~~~~
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c: In function ‘usdrfd_mmap’:
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c:1440:18: warning: unused variable ‘i’ [-Wunused-variable]
1440 | unsigned i;
| ^
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c:1439:23: warning: unused variable ‘off’ [-Wunused-variable]
1439 | unsigned long off;
| ^~~
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c: At top level:
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c:277:14: warning: ‘usdr_reg_rd64’ defined but not used [-Wunused-function]
277 | static __u64 usdr_reg_rd64(struct usdr_dev *dev, unsigned int vaddr)
| ^~~~~~~~~~~~~
/home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.c:264:21: warning: ‘usdr_reg_rd32’ defined but not used [-Wunused-function]
264 | static unsigned int usdr_reg_rd32(struct usdr_dev *dev, unsigned int vaddr)
| ^~~~~~~~~~~~~
MODPOST /home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/Module.symvers
CC [M] /home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.mod.o
LD [M] /home/pi/usdr-lib/src/lib/lowlevel/pcie_uram/driver/usdr_pcie_uram.ko
make[1]: Leaving directory '/usr/src/linux-headers-6.6.31+rpt-rpi-2712'
pi@raspberrypi:~/usdr-lib/src/lib/lowlevel/pcie_uram/driver $ uname -a
Linux raspberrypi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
Following https://docs.wsdr.io/software/install.html
/boot/firmware/config.txt update
dtoverlay=pcie-32bit-dma
dmesg after insmod usdr_pcie_uram.ko, if config.txt doesn't include the previous line:
[ 361.022958] usdr_pcie_uram: loading out-of-tree module taints kernel.
[ 361.023399] usdr: Initializing 0000:01:00.0
[ 361.023410] usdr 0000:01:00.0: enabling device (0000 -> 0002)
[ 361.023747] usdr 0000:01:00.0: Failed to allocate consistent memory (16384 bytes), dma_alloc_coherent() returns NULL!
[ 361.023753] usdr: Error -12 initializing bucket
[ 361.023818] usdr: probe of 0000:01:00.0 failed with error -12
Good (after config.txt update)
[ 44.160233] usdr: Initializing 0000:01:00.0
[ 44.160242] usdr 0000:01:00.0: enabling device (0000 -> 0002)
[ 44.160377] usdr 0000:01:00.0: Bucket 0: DMA at ffffc00081118000 to 16000000
LD_LIBRARY_PATH needed if installed to /usr/local. It's better to install to /usr directly.
pi@raspberrypi:~/usdr-lib/build $ sudo LD_LIBRARY_PATH=/usr/local/lib usdr_dm_sensors
Sensor 0 [ /dm/sensor/temp]
Sensor 0: Raw value 000039d6/00014806
pi@raspberrypi:~/usdr-lib/build $ sudo LD_LIBRARY_PATH=/usr/local/lib usdr_dm_create
23:17:19.120125 WARN: [DSTR] Running with ARM_NEON CPU features
23:17:19.126991 WARN: [XDEV] HWID 802f0300 USDR Board rev.3 Device `/dev/usdr0` FirmwareID d2b15b59 (20240526214525)
23:17:19.166792 INFO: [5332] Si5332 DEV=001100 OPN=000020 DID=000119 VDD=bf DIV=1
23:17:19.229610 INFO: [UDEV] M2_LM6_1: RFIC 0022
23:17:19.231303 INFO: [UDEV] RXSW:0 EXT_MIXER_EN:0
23:17:19.231308 INFO: [UDEV] TXSW:1
23:17:19.231312 INFO: [6002] Set PATH 1: a501 f5d0
23:17:19.232609 INFO: [PCIF] Unable to initialize expander 0
23:17:19.283855 INFO: [5C33] LMK5C33216 DEVID[0/1/2/3] = ba ad be ef
23:17:19.335722 INFO: [5318] LMK05318 DEVID[0/1/2/3] = 07 00 00 00
23:17:19.347324 WARN: [D501] DACx0501 unknown DAC ID=300
23:17:19.347329 WARN: [M2PE] External DAC not recognized error=-5
23:17:19.347335 INFO: [M2PE] EXM2PE initialized no DAC
23:17:19.347339 WARN: [DEFE] Detected external FE: exm2pe
23:17:19.347364 INFO: [UDEV] M2_LM6_1: power en:1
23:17:19.347460 INFO: [UDEV] RX POWER 1
23:17:19.372560 INFO: [5332] VCO=2400000000 IDPA_INTG=11815 IDPA_RES=12602 HSDIV=24 ODIV=1 JDIV=0 MXLO=300000000
23:17:19.398936 INFO: [6002] LPF 50000 => BAND=0 RC=0 BYPASS=1 CAL=3
23:17:19.399057 INFO: [6002] LPF 50000 => BAND=0 RC=0 BYPASS=1 CAL=3
23:17:19.399179 INFO: [UDEV] RX_RATE 50.000 TX_RATE 50.000 MXLO 300.000
23:17:19.405790 INFO: [DMCR] Temp = 58.1 C
23:17:19.405814 INFO: [DSTR] No transformation!
23:17:19.405818 INFO: [STRM] SFERX4: Stream configured in 2048 words (4096 samples) X 1 bursts (32 bits per sym); fifo capacity 4 (FMT:1)
23:17:19.406040 INFO: [PCIE] Configured stream0: 16384 X 32 (vma_off=10000000 vma_len=00080000)
23:17:19.406048 INFO: [DMCR] Configured RX 4096 (16384 bytes) x 1 buffs TX 0 x 0 buffs === CH_MASK 1 FMT ci16
23:17:19.417234 INFO: [6002] LPF 50000 => BAND=0 RC=0 BYPASS=1 CAL=3
23:17:19.417358 INFO: [DSTR] Set `/dm/sdr/0/rx/bandwidth` to 50000000
23:17:19.417369 INFO: [DSTR] Set `/dm/sdr/0/tx/path` to 93826516274064
23:17:19.417379 INFO: [UDEV] RX_PATH set to AUTO from `rx_auto`
23:17:19.417382 INFO: [UDEV] /dev/usdr0: Auto RX band selection: LNAL
23:17:19.417385 INFO: [UDEV] /dev/usdr0: Set RX band to 3 (LNAL/EXT) [TXLB:0 => ATEEN=0,0]
23:17:19.417389 INFO: [6002] Set PATH 3: a503 f5f0
23:17:19.417466 INFO: [UDEV] RXSW:1 EXT_MIXER_EN:1
23:17:19.423809 INFO: [5332] MXLO_EN=1 TXCLK_EN=0
23:17:19.423825 INFO: [DSTR] Set `/dm/sdr/0/rx/path` to 93826516274080
23:17:19.442655 INFO: [UDMS] Stream[0] STOP; STATS bytes = 2097152, samples = 524288, dropped/rcvd = 0/128
23:17:19.444229 INFO: [DMCR] Temp = 58.1 C
23:17:19.542924 INFO: [UDEV] turnoff
23:17:19.542932 INFO: [UDEV] M2_LM6: turnoff
23:17:19.542958 INFO: [PCIE] Device /dev/usdr0 destroyed!
SoapySDR
pi@raspberrypi:~/usdr-lib/build $ LD_LIBRARY_PATH=/usr/local/lib ~/SoapySDR/build/apps/SoapySDRUtil --find
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Found device 0
addr = bus=pci,device=usdr0
dev = bus=pci,device=usdr0
driver = usdr
label = USDR: bus=pci,device=usdr0
media = usdr
module = usdr_soapy
name = usdr
serial = 012345678
type = usdr
pi@raspberrypi:~/usdr-lib/build $ LD_LIBRARY_PATH=/usr/local/lib SoapySDRUtil --probe="driver=usdr"
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Probe device driver=usdr
[INFO] Make connection: 'bus=pci,device=usdr0'
[INFO] Param addr => bus=pci,device=usdr0
[INFO] Param dev => bus=pci,device=usdr0
[INFO] Param driver => usdr
[INFO] Param label => USDR: bus=pci,device=usdr0
[INFO] Param media => usdr
[INFO] Param module => usdr_soapy
[INFO] Param name => usdr
[INFO] Param serial => 012345678
[INFO] Param type => usdr
23:27:45.806284 WARN: [DSTR] Running with ARM_NEON CPU features
23:27:45.806561 WARN: [XDEV] HWID 802f0300 USDR Board rev.3 Device `/dev/usdr0` FirmwareID d2b15b59 (20240526214525)
23:27:45.846436 INFO: [5332] Si5332 DEV=001100 OPN=000020 DID=000119 VDD=bf DIV=1
23:27:45.909504 INFO: [UDEV] M2_LM6_1: RFIC 0022
23:27:45.911229 INFO: [UDEV] RXSW:0 EXT_MIXER_EN:0
23:27:45.911235 INFO: [UDEV] TXSW:1
23:27:45.911239 INFO: [6002] Set PATH 1: a501 f5d0
23:27:45.912547 INFO: [PCIF] Unable to initialize expander 0
23:27:45.963827 INFO: [5C33] LMK5C33216 DEVID[0/1/2/3] = ba ad be ef
23:27:46.015754 INFO: [5318] LMK05318 DEVID[0/1/2/3] = 1f 03 03 03
23:27:46.027393 WARN: [D501] DACx0501 unknown DAC ID=f03
23:27:46.027409 WARN: [M2PE] External DAC not recognized error=-5
23:27:46.027419 INFO: [M2PE] EXM2PE initialized no DAC
23:27:46.027428 WARN: [DEFE] Detected external FE: exm2pe
[INFO] Created: `bus=pci,device=usdr0`
[INFO] SoapyUSDR::getNumChannels(1) => 1
[INFO] SoapyUSDR::getNumChannels(0) => 1
----------------------------------------------------
-- Device identification
----------------------------------------------------
driver=usdrsoapy
hardware=usdrdev
----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
Channels: 1 Rx, 1 Tx
Timestamps: YES
Clock sources: internal, external
Sensors: clock_locked, board_temp
* clock_locked (Clock Locked): true
CGEN clock is locked, good VCO selection.
* board_temp (USDR board temerature): 61.773438 C
The temperature of the USDR board in degrees C.
----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
Full-duplex: YES
Supports AGC: NO
Stream formats: CF32, CS16
Native format: CS16 [full-scale=32768]
Stream args:
* Float Scale - The buffer will be scaled (or expected to be scaled) to [-floatScale;floatScale)
[key=floatScale, default=1.0, type=float]
* Link Format - The format of the samples over the link.
[key=linkFormat, default=CS16, type=string, options=(CS16, CS12)]
* Buffer Length - Hardware packet size over the link.
[key=bufferLength, default=, type=int]
Antennas: LNAH, LNAL, LNAW
Corrections: DC removal, IQ balance
Full gain range: [-12, 61] dB
LNA gain range: [0, 6] dB
VGA1 gain range: [5, 31] dB
VGA2 gain range: [0, 60] dB
Full freq range: [0, 3800] MHz
RF freq range: [0.1, 3800] MHz
Sample rates: [0.1, 80] MSps
Filter bandwidths: [0.5, 80] MHz
Sensors: lo_locked
* lo_locked (LO Locked): true
LO synthesizer is locked, good VCO selection.
----------------------------------------------------
-- TX Channel 0
----------------------------------------------------
Full-duplex: YES
Supports AGC: NO
Stream formats: CF32, CS16
Native format: CS16 [full-scale=32768]
Stream args:
* Float Scale - The buffer will be scaled (or expected to be scaled) to [-floatScale;floatScale)
[key=floatScale, default=1.0, type=float]
* Link Format - The format of the samples over the link.
[key=linkFormat, default=CS16, type=string, options=(CS16, CS12)]
* Buffer Length - Hardware packet size over the link.
[key=bufferLength, default=, type=int]
Antennas: TXH, TXW
Corrections: DC offset, IQ balance
Full gain range: [0, 56] dB
VGA1 gain range: [-35, -4] dB
VGA2 gain range: [0, 25] dB
Full freq range: [0, 3800] MHz
RF freq range: [0.1, 3800] MHz
Sample rates: [0.1, 80] MSps
Filter bandwidths: [0.5, 80] MHz
Sensors: lo_locked
* lo_locked (LO Locked): true
LO synthesizer is locked, good VCO selection.
23:27:46.029559 INFO: [UDEV] turnoff
23:27:46.029565 INFO: [UDEV] M2_LM6: turnoff
23:27:46.029617 INFO: [PCIE] Device /dev/usdr0 destroyed!
CubicSDR install from apt source can't detect usdr. Compiled CubicSDR following this (I'm using wxWidgets 3.1.3 and -DOTHER_LIBS="-latomic"
) works. Launching CubicSDR can detect usdr run the waterfall.
Haven't plugged in antenna to receive real FM signals yet.
The board runs VERY hot without heatsink.
Listening to the radio on RPi5
USB: Now USB 2.0 (not using GT), if there's USB 3.0 cores, it'll support USB 3.0