enjoy-digital / litex_m2sdr

LiteX based M2 SDR FPGA board.
BSD 2-Clause "Simplified" License
24 stars 2 forks source link
                        __   _ __      _  __    __  ______  _______  ___
                       / /  (_) /____ | |/_/___/  |/  /_  |/ __/ _ \/ _ \
                      / /__/ / __/ -_)>  </___/ /|_/ / __/_\ \/ // / , _/
                     /____/_/\__/\__/_/|_|   /_/  /_/____/___/____/_/|_|
                              LiteX based M2 SDR FPGA board.
                            Copyright (c) 2024 Enjoy-Digital.

License

[!WARNING]

LiteX-M2SDR is still in the lab, engineering new features. πŸ§ͺ Expect things to change or break, but feel free to contribute! Hardware will be available on the webshop soon.

[> Intro

We know what you'll first ask when discovering this new SDR project: what's the RFIC? πŸ€” Let's answer straight away: Another AD936X-based SDR! πŸ˜„

Why yet another SDR based on this RFIC? Because we've been designing FPGA-based projects for clients with this chip for almost 10 years now and still think this RFIC has incredible capabilities and possibilities that haven't been fully tapped by open-source projects. We believe it can provide a fantastic and simple solution when paired with the LiteX framework we're developing. πŸš€

Imagine a minimalist AD9361-based SDR with:

OK, you probably also realized this project is a showcase for LiteX capabilities, haha. πŸ˜… Rest assured, we'll do our best to gather and implement your requests to make this SDR as flexible and versatile as possible!

This board is proudly developed in France πŸ‡«πŸ‡· by Enjoy-Digital, managing the project and gateware/software development, and our partner Lambdaconcept designing the hardware. πŸ₯–πŸ·

Ideal for SDR enthusiasts, this versatile board fits directly into an M2 slot or can team up with others in a PCIe M2 carrier for more complex projects, including coherent MIMO SDRs. πŸ”§

For Ethernet support with 1000BaseX/2500BaseX and SATA connectivity to directly record/play samples to/from an SSD, mount it on the LiteX Acorn Mini Baseboard! πŸ’½

Unlock new possibilities in your SDR projects with this cutting-edge boardβ€”we'll try our best to meet your needs! πŸŽ‰

[> PCIe SoC Design

The PCIe design is the first variant developed for the board and does not require an additional baseboard. Just pop the M2SDR into a PCIe M2 slot, connect your antennas, and you're ready to go! πŸš€

The SoC has the following architecture:

The PCIe design has already been validated at the maximum AD9361 specified sample rate: 2T2R @ 61.44MSPS (and also seems to correctly handle the oversampling at 2T2R @ 122.88MSPS with 7.9 Gbps of bandwidth on the PCIe bus; this oversampling feature is already in place and more tests/experiments will be done with it in the future).

[> Ethernet SoC Design (1/2.5Gbps x 1 or 2).

[!WARNING]

WiP πŸ§ͺ Still in the lab, all the cores required are already developped and interfaces have been validated but the SoC still need to be assembled/tested and software developped.

The Ethernet design variant will gives flexibility when deploying the SDR. The PCIe connector has 4 SerDes transceivers that are in most cases used for... PCIe :) But these are 4 classical GTP transceivers of the Artix7 FPGA that are connected to the PCIe Hardened PHY in the case of a PCIe application but that can be used for any other SerDes-based protocol: Ethernet 1000BaseX/2500BaseX, SATA, etc...

In this design, the PCIe core will then be replaced with LiteEth, providing the 1000BaseX or 2500BaseX PHY but also the UDP/IP hardware stack + Streaming/Etherbone front-end cores.

TODO: Add diagram and more info.

[> Getting Started

For SDR Enthusiasts

If you are an SDR enthusiast looking to get started with the LiteX-M2SDR board, follow these simple steps to get up and running quickly:

  1. Connect the Board:

    • Insert the LiteX-M2SDR board into an available M2 slot on your Linux computer and connect your antennas.
  2. Install Required Software:

    • Ensure you have the necessary software installed on your Linux system. You can do this by running the following command in your terminal:
      sudo apt install gnuradio gnuradio-dev soapysdr-tools libsoapysdr0.8 libsoapysdr-dev libgnuradio-soapy3.10.1 gqrx
  3. Clone the Repository:

    • Clone the LiteX-M2SDR repository using the following command:
      git clone https://github.com/enjoy-digital/litex_m2sdr
  4. Build and Install Software: Software build use make and cmake for the C kernel driver and utilities, but since we also like Python πŸ˜…, we created a small script on top if it to simplify our developpment and installation:

    • Navigate to the software directory and run the build script:
      cd software
      ./build.py
    • This will build the necessary components including the kernel driver, user-space utilities, and the SoapySDR driver.
  5. Load the Kernel Driver:

    • Load the kernel driver with the following commands:
      cd software/kernel
      sudo ./init.sh
    • πŸš€ Ready for launch!
  6. Run Your SDR Software:

    • Now, you can launch your preferred SDR software (like GQRX or GNU Radio) and select the LiteX-M2SDR board through SoapySDR. πŸ“‘

[!WARNING]

WiP πŸ§ͺ Content below is more our memo as developers than anything useful to read πŸ˜…. This will be reworked/integrated differently soon.

For Software Developers

For those who want to dive deeper into development with the LiteX-M2SDR board, follow these additional steps after completing the SDR enthusiast steps:

  1. Run Software Tests:

    • Test the kernel:
      cd software/kernel
      make clean all
      sudo ./init.sh
    • Test the user-space utilities:
      cd software/user
      make clean all
      ./m2sdr_util info
      ./m2sdr_rf init -samplerate=30720000
      ./tone_gen.py tone_tx.bin
      ./m2sdr_play tone_tx.bin 100000
  2. SoapySDR Detection/Probe:

    • Detect the LiteX-M2SDR board:
      SoapySDRUtil --probe="driver=LiteXM2SDR"
  3. Run GNU Radio FM Test:

    • Open and run the GNU Radio FM test:
      gnuradio-companion ../gnuradio/test_fm_rx.grc
  4. Enable Debugging in Kernel:

    • Enable debugging:
      sudo sh -c "echo 'module litepcie +p' > /sys/kernel/debug/dynamic_debug/control"

For Software & FPGA Developers

For those who want to explore the full potential of the LiteX-M2SDR board, including FPGA development, follow these additional steps after completing the software developer steps:

  1. Install LiteX:

  2. Ethernet and PCIe Tests:

    • For Ethernet tests, if the board is mounted in an Acorn Mini Baseboard:
      ./litex_m2sdr.py --with-ethernet --ethernet-sfp=0 --build --load
      ping 192.168.1.50
    • For PCIe tests, if the board is mounted directly in an M2 slot:
      ./litex_m2sdr.py --with-pcie --variant=m2 --pcie-lanes=N_LANES --build --load
      lspci
  3. Use JTAGBone/PCIeBone:

    • Start the LiteX server for JTAG or PCIe:
      litex_server --jtag --jtag-config=openocd_xc7_ft2232.cfg # JTAGBone
      sudo litex_server --pcie --pcie-bar=04:00.0              # PCIeBone (Adapt bar)
  4. Flash the Board Over PCIe:

    • Flash the board:
      cd software
      ./flash.py ../build/litex_m2sdr_platform/gateware/litex_m2sdr_platform.bin
  5. Reboot or Rescan PCIe Bus:

    • Rescan the PCIe bus:
      echo 1 | sudo tee /sys/bus/pci/devices/0000\:0X\:00.0/remove # Replace X with actual value
      echo 1 | sudo tee /sys/bus/pci/rescan

[> Contact

E-mail: florent@enjoy-digital.fr