Below is the LiteX-M2SDR installed on a Raspberry Pi 5. Please follow the step-by-step tutorial below to get your SDR running.
To connect the LiteX-M2SDR on the Raspberry Pi 5 board, you need an M.2 hat like the Pineboards HatDrive BM1L.
This step requires rpi-imager. On Debian or similar OS, use this command to install the tool:
sudo apt install rpi-imagerOnce installed, launch the tool with the following command (root user is required for write access to mass storage):
sudo rpi-imager- Click on CHOOSE DEVICE and select Raspberry Pi 5.

- Click on CHOOSE OS and select Raspberry Pi OS (64-bit).

- Click on CHOOSE STORAGE and select the SD card (use
sudo fdisk -lto list mass storage devices). - Click NEXT.
On the next page, rpi-imager allows OS customization:
If you plan to use SSH initially, click on EDIT SETTINGS,
go to the GENERAL pane to set the username and password:
and enable SSH in the SERVICES pane:

After configuration, click SAVE and then YES.
The next page is the last point before erasing the device: double-check the selected mass storage.
Now, rpi-imager will download the image and write it to the SD card.
Once rpi-imager has written the SD card, some modifications must be applied to use a PCIe device. Mount the first SD card partition and edit config.txt and cmdline.txt. Both files are in the firmware directory.
config.txt
In the [all] section, please add:
kernel=kernel8.img
dtparam=pciex1=on
dtoverlay=pcie-32bit-dma-pi5
dtoverlay=pciex1-compat-pi5,l1ss=off,no-l0s=on,no-mip=off
# Run as fast as firmware/board allows
arm_boost=1kernel8.img: ensures a standard 4K PAGE SIZE instead of 16K.dtparam=pciex1=on: enables PCIe support.dtoverlay=pcie-32bit-dma-pi5: enables 32-bit DMA addressing instead of 64-bit.dtoverlay=pciex1-compat-pi5,l1ss=off,no-l0s=on,no-mip=off: improves support for PCIe devices that may not work well with the default configuration;l1ss=offdisables a power-saving feature,no-l0s=ondisables L0s (Active State Power Management - L0s state), andno-mip=offenables MIP (Maximum Payload Size Inference).
cmdline.txt
Please append the line with pci=noaer pcie_aspm=off:
pci=noaer: disables PCIe advanced error reporting (AER: Corrected error received).pcie_aspm=off: ignores PCIe Active State Power Management. Leaves any configuration done by firmware unchanged.
Please plug in your Ethernet cable, HDMI monitor, USB keyboard, and the MicroSD card generated earlier. You can power your Raspberry Pi now over the USB-C port using a 5V@4A power supply.
Log in over SSH using the assigned IP and your password:
ssh toto@XXX.YYY.Z.A
# Update the system
sudo apt update
sudo apt dist-upgrade
sudo rebootInsert the LiteX-M2SDR module before powering your Raspberry Pi. You’ll need an M2x3mm screw to lock the SDR module in place.
# Log in over SSH using your IP and password
ssh toto@XXX.YYY.Z.A
# Install missing dependencies
sudo apt install -y cmake soapysdr-tools libsoapysdr0.8 libsoapysdr-dev
# On the Raspberry Pi, clone the LiteX-M2SDR source tree
mkdir Code
cd Code
git clone https://github.com/enjoy-digital/litex_m2sdr
# Move to the software directory
cd litex_m2sdr/litex_m2sdr/software
# Compile the command line tools and the SoapySDR module for Litex-M2SDR
./build.py
# Build and Install the LiteX-M2SDR Linux kernel driver for arm64
cd kernel
make ARCH=arm64 clean all
sudo make ARCH=arm64 install
cd ..
# Verify the list of compiled tools
git status
# If you want to use LiteX-M2SDR Python tools later
sudo apt install -y python3-numpyuser/m2sdr_util info
user/m2sdr_rfOn subsequent boots, the LiteX-M2SDR driver is automatically loaded:
# Check whether it works
~/Code/litex_m2sdr/litex_m2sdr/software/user/m2sdr_util infoTBD


