Git Product home page Git Product logo

libresdr's Introduction

LibreSDR with Zynq SoC overclock and Optimized Sample Rates

This is an unofficial port of PlutoSDR onto LibreSDR a.k.a. ZynqSDR. The repo is based on day0wl's repo with several enhancements:

  • Optimized linux kernel and buildroot to support higher practical sampling rates with libiio/PlutoSDR API (20 MSPS without overlock, compared to ~10 MSPS stock)
  • Xilinx Zynq SoC overclock support (27.5 MSPS achieved with overclock to 1100 MHz CPU + 750 MHz DDR)
  • Use LVDS mode for AD9361 to support max sampling rates in 2T2R mode
  • Based on PlutoSDR v0.38 firmware (Nov 17, 2023)
  • Prebuilt firmware with different overclocking options

There is not a whole lot of information from the manufacturer, but the device can be purchased on Aliexpress, eBay and other platforms. The hardware includes Zynq 7020 Soc with 1GB DDR3 memory. It is better than a few other similarly priced Pluto-based SDRs (like PlutoPlus) due to the larger FPGA and memory.

LibreSDR

The board schematics from one of the Aliexpress sellers is included, see zynqsdr_rev5.pdf. This set of patches was not tested for full functionality in every possible mode, probably contains bugs or incorrect interpretations of schematics and intended for fellow hackers to get started with low level software and FPGA modifications.

Prebuilt firmware

Checkout the prebuilt firmware under the "Release" section on github. The base clock without overclocking is 750MHz for CPU and 525 MHz for memory, and you should be able to run continuous 20MSPS with the libiio/PlutoSDR API over gigabit Ethernet. Several different overclocked firmware package for the Zynq 7020 SoC were provided. With 1100 MHz CPU and 750 MHz memory overclock, I can run 27.5 MSPS continuous sampling on Ubuntu + SDR++.

Build

The build requires Vivado and Vitis 2022.2. I installed these packages to build on Ubuntu:

sudo apt install libgmp-dev libmpc-dev git build-essential fakeroot libncurses5-dev libssl-dev ccache dfu-util u-boot-tools device-tree-compiler mtools bc python3 cpio zip unzip rsync file wget flex bison language-pack-en libtinfo5 x11-utils xvfb dbus-x11 libswt-glx-gtk-4-jni libgtk2.0-0

On Ubuntu 23.10, you need to install libtinfo5 manually:

wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.4-2ubuntu0.1_amd64.deb
sudo dpkg -i libtinfo5_6.4-2ubuntu0.1_amd64.deb

Then build the firmware, run these commands in cloned repo:

# Clone original v0.38 firware for PlutoSDR
git clone --branch v0.38 --recursive https://github.com/analogdevicesinc/plutosdr-fw.git plutosdr-fw_0.38_libre
# Apply patch for LibreSDR
./apply.sh
cd plutosdr-fw_0.38_libre
# Change Vivado path if you installed it to a different folder.
export VIVADO_SETTINGS=/opt/Xilinx/Vivado/2022.2/settings64.sh
export TARGET=libre
make
make sdimg

Collect results in build directory and in addition a set of files for the sd card in build_sdimg folder. Copy the files inside the build_sdimg into a empty SD Card formatted as FAT32 and boot the SDR with the SD card. The default IP for connecting to SDR is 192.168.1.10.

Performance improvements and overclock

The firmware shipped with these devices supports about 11 to 12 MSPS continuous sampling. The original design runs the CPU at 675 MHz and DDR at 525 MHz. In this repo, the default CPU clock has been increased to 750 MHz (still within the spec of the chip, where the maximum is 766 MHz). Combined with other optimizations I've done in this codebase, you can expect around 20 MSPS continuous sampling rate without overclocking.

After the firmware has been successfully built, you can try the overclock script by setting up the CPU clock and DDR clock multipliers manually. All clocks are multiples of 25 MHz. For example, to run CPU at 1100 MHz and DDR at 625 MHz, you can run:

export VIVADO_SETTINGS=/opt/Xilinx/Vivado/2022.2/settings64.sh
export TARGET=libre
OVERCLOCK_CPU_MULT=44 OVERCLOCK_DDR_MULT=25 make overclock
rm -r build_sdimg
make sdimg

You can run the memory at a much higher clock by increasing the timing parameters. They are defined in hdl/projects/libre/system_bd.tcl (looking for PCW_UIPARAM_DDR_CL and a few others). With a 9-7-9-9 timing I can overclock mine to 750 MHz.

With the overclock (1100 MHz CPU + 750 MHz DDR), I can achieve about 27.5 MSPS continuous sampling on Ubuntu and SDR++, and above that the limitation is actually my host computer (Ethernet running at ~900Mbps and the CPU needs to process everything very fast). You need to enlarge the libiio block size in your SDR application to achieve high sampling rates. I use SDR++ and the default sampling block size is too small. You can change it here. I changed it to 1000000 and recompiled SDR++. Enlarging the block buffer is necessary for sampling rates above 20 MSPS. Also you need to remove the sampling rate limit in your SDR software (SDR++ has a limit of 20 MSPS for PlutoSDR and can be easily changed here). A dedicated NIC for connecting to the SDR is recommended.

Further improvements can be made by packing the 12-bit IQ samples into three bytes and do not transfer leading zeros (currently 4 bytes are used for each IQ sample). But that may require changes in HDL, libiio server and clients, and it is difficult to make it compatible with existing software that supports PlutoSDR.

SDR++ and PlutoSDR

Other information

Usually LibreSDR is shipped with empty qspi flash and boots from included SD card. Use any small capacity sd card, format it as FAT32 and copy content of the build_sdimg directory on it. Insert the sdcard into LibreSDR and it should boot from it. Once it is running, the software can be updated using mounted drive, just like PlutoSDR. This will populate QSPI flash and LibreSDR will be able to run without SD Card USB OTG will act as normal PlutoSDR. Serial console is available on the debug port as /dev/ttyUSB2 if you don’t have any other USB serial devices in the system. Set your terminal application to 115200N8. Gigabit Ethernet is enabled, IP address is set by default to 192.168.1.10.

You can also use a full AD provided linux build, just replace BOOT.BIN and device tree file from this build and it should be able to mount the SD card as the root file system, This will allow you to run any Linux applications or scripts directly on LibreSDR.

From this point you are on your own, but pull requests and enhancements are welcome!

libresdr's People

Contributors

brandy92 avatar day0wl avatar hz12opensource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libresdr's Issues

How to populate firmware to QSPI flash (internal) ?

Hello,

Could you please provide more details on how to write firmware to the internal flash drive? I've successfully run your firmware from the SD Card and now want to transfer it to the QSPI flash.

In your instructions, you mentioned:

Once it is running, the software can be updated using a mounted drive, just like with PlutoSDR. This will populate the QSPI flash, and LibreSDR will be able to run without an SD Card, with USB OTG acting as the normal PlutoSDR.

However, I am having trouble with DFU not working in my case. Could you please direct me to some documentation for LibreSDR?

Thanks!

LibreSDR not booting from SD-card

Hi, I realize that you aren't responsible for the LibreSDR but I kinda need help

I tried to copy your pre-built firmware on a freshly formated SD card fileformat FAT32

my LibreSDR does not seem to boot with them and keeps acting as a plutoSDR.
I draw this conclusion from not beeing able to detect it's ethernet port by pinging it, sniffing it or just seeing it in winbox. It still acts as a Pluto working fine from a USB port however I kinda need the ethernet capability.

I think I might be missing the step "Once it is running, the software can be updated using mounted drive" could you explain this to me in greater detail as I struggle to figure what I am supposed to do

SDRAngel is not working with base image.

Hi , trying to use SDRangel, but it is not working. My original firm in internal memory works, is 0.37, no idea form where they got it, no idea if is the same always came or the seller added new one. Problem with that is cannot make work the 6ghz mod. This one works in 6ghz, but SDRangel doesn't work, if I change the frequency always will go to 9999999 , also the gain controls do something wrong.
does anyone have it working in SDRAngel and 6ghz mod?

also how setup the ethernet connection? sorry but so little info of this device. performance in SDR++ is quite impressive comparing with original pluto at same 4mhz, just noise floor is much lower and sensitive.

How do I enter DFU

I have tried the prosses of holding down the button as powering on the the OTG side

Image building error

Hello! Please, help me with my problem

I am using Ubuntu 22.04.4 LTS, Vivado 2022.2 Vitis & Vivado

When I try to do "make" I get

*** buffer overflow detected ***: terminated
Aborted (core dumped)
make[1]: *** [Makefile:1187: u-boot] Error 134
make[1]: exit directory «/home/user/libresdr/plutosdr-fw_0.38_libre/u-boot-xlnx»
make: *** [Makefile:76: u-boot-xlnx/tools/mkimage] Error 2

Since I have a lot of software intalled, I have prepared docker

FROM ubuntu:22.04
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get install -y --no-install-recommends apt-utils git mc libgmp-dev build-essential fakeroot libncurses5-dev libssl-dev ccache u-boot-tools 
RUN apt-get -y install mtools bc python3 cpio zip unzip rsync file 
RUN apt-get -y install wget flex bison language-pack-en libtinfo5 x11-utils xvfb dbus-x11 libswt-glx-gtk-4-jni libgtk2.0-0
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install libmpc-dev dfu-util device-tree-compiler

WORKDIR /workspace
RUN git clone https://github.com/hz12opensource/libresdr.git
RUN mkdir /tools

and docker-compose.yml

version: "3.5"

services:
  libre_builder:
    container_name: librsdr_img
    restart: always
    build: .
    image: librsdr_img
    #entrypoint: bash
    volumes:
      - /home/user:/tools
      - .:/workspace
    network_mode: host
    command: bash

next in container's cli I do everything and finaly make
Finally, everything is finished OK:

...
legal-info/sources/wpa_supplicant-2.10/0002-wpa_supplicant-use-a-less-generic-name-for-IEEE802.1.patch
legal-info/sources/wpa_supplicant-2.10/0001-build-re-enable-options-for-libwpa_client.so-and-.patch
legal-info/sources/wpa_supplicant-2.10/0003-Include-HMAC-SHA384-512-KDF-for-SAE-if-SHA384-512-is.patch
legal-info/sources/wpa_supplicant-2.10/wpa_supplicant-2.10.tar.gz
legal-info/sources/wpa_supplicant-2.10/series
legal-info/sources/libxml2-2.10.4/
legal-info/sources/libxml2-2.10.4/libxml2-2.10.4.tar.xz
rm linux/arch/arm/boot/dts/zynq-libre.dtb

and after make sdimg I see

mkdir /workspace/libresdr/plutosdr-fw_0.38_libre/build_sdimg
cp build/sdk/fsbl/Release/fsbl.elf 	/workspace/libresdr/plutosdr-fw_0.38_libre/build_sdimg/fsbl.elf  
cp: cannot stat 'build/sdk/fsbl/Release/fsbl.elf': No such file or directory
make: *** [Makefile:202: sdimg] Error 1

Question: why is fail? What I have to do?

Changing Pre-Built Firmware Releases

Hi Guys,

I successfully loaded from SD card the baseclock pre-built firmware, but I would like to test the overclock versions too.

How can this be done?

I have tried copying the overclocked files to an sd card and inserting into the LibreSDR, but the LibreSDR does not boot now with SD Card. It will only boot without SD Card plugged in.

I had thought I could copy the pluto.frm file, but they don't exist in the pre-built folders.

*** Second cheeky question, how do we expand the frequency range? I tried the same ssh commands as original pluto, but it didn't work.

PS. I am making a tutorial video for this product and your firmware, so it would be awesome to get an early response.

Thanks,
Matt
(Tech Minds on YT)

Firmware / Board compatibility with srsRAN ?

Hi,
I'm sorry to ask here, but I found very few information on this Zynq 7020 / AD9361 SDR on the web.
Could you tell me if it works with srsRAN ? srsRan support plutoSDR but I would be reassured to have confirmation that still works with this hardware and software modification before putting €300 into it.
Thank you very much

Two Tx channels do not work simultaneously.

I'm trying to start emitting a signal from two Tx channels at once. HOWEVER, I was unable to obtain a working option, since the signal from both channels is emitted in portions in pulsation mode, that is, the signal is either not there.
Tell me how to properly launch two Tx channels on the device (using C++, iio-library and Linux)?

bricked device

About two months ago, I tried a firmware update which ended badly: the card no longer works and seem's bricked
=> unable to reboot with an sdcard.
=> No device appears on the USB port.
But there is a little sign of life when I plug in the debug port:
$ lsusb -v
....
Bus 001 Device 051: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6011 FT4232H Quad HS USB-UART/FIFO IC
bcdDevice 8.00
iManufacturer 1 Xilinx
iProduct 2 Xilinx Debugger
iSerial 3 DebugChannel
...

Is it possible to reinstall firmware with the debug usb port? how ? Found some stuff with openOCD, but this tool is not so simple...

another idea to unbrick the card ?

login fails with given firmware.

Hi, I bought this device. It has already flashed in internal memory the Pluto Firmware. The ADI chip is locked at 3.8ghz. Im trying connect via putty to unlock the 6ghz, and I need login.
Official firmware is root/analog, but doesnt work , tried analog/analog, and many others , but doesn't work.
Could you please tell me if it is the official firmware what is the password?
Thanks

No local ip context @192.168.2.1

I finally got got my setup working to successfully build the project. Right now, I am testing the device using the sdimg output, with plans to ultimately update the nor flash...
When I connect the radio over ethernet, everything seems fine, but when I plug it in to USB, there is no local IP context. Is this the expected behavior?

maco@P65:~$ iio_info -s
Available contexts:
0: (iwlwifi_1,nvme,BAT1,ADP1,coretemp,pch_cannonlake,nvme,acpitz on Micro-Star International Co., Ltd.) [local:]
1: 0456:b673 (Analog Devices Inc. PlutoSDR (ADALM-PLUTO)), serial= [usb:1.51.5]

While plugged in, my machine periodically notifies me that a network connection activation has failed.

Maximum Sampling Rate

Just wondering if anyone has been able to get 20+ MSPS with their LibreSDRs and any of the precompiled firmwares. I've only been able to max out at ~11.5 MSPS, which is about 2x a regular Pluto. Testing was done using IIO in C running on a PC using iio_buffer_refill at various small and large buffer sizes.

Programming fpga on libreSDR verilog, system verilog, HDL, VHDL.

I want to program the PL part of ZYNQ, but I need a backup of the bitstream. Where can I get it from? If you think about it, LibreSDR is a clone of PlutoSDR, but does that mean that a project for Vivado (developed for PlutoSDR) will fit in LibreSDR (even if you ignore the details in the form of pinout, etc.). Due to the lack of information about this device, you have to rely on your own judgment. As I understand it, basically ALL manipulations with the software part are done either through an SD-card or by writing the firmware to QSPI, which is not quite suitable for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.