GNU Radio *on* the PlutoSDR: Proof of Concept

TL;DR: You can run GNU Radio on the Pluto's internal Zynq, but you probably don't want to.

My Pluto arrived in the mail Friday, so I spent the weekend having some fun hacking on the software. I know it's not technically a question, but I thought this might be of interest to someone.  This weekend I managed to get an Ubuntu userland to boot on the Pluto and then ran GNU Radio in it. To clarify, here I'm referring to running GNU Radio entirely on the processor inside the PlutoSDR. 

Overall setup is a modified Buildroot image that calls switch_root to load an Ubuntu userland off of a USB flash drive, then makes it self available over SSH via a USB WiFi dongle. 

Logging in to Ubuntu:

Once that all works, we can just use APT to install GNU Radio, and either run the GUI via X11 forwarding or use the Python API directly from the command line. 

  A simple GNU Radio flow graph (GFSK demodulator for Si4463)

For anyone interested in trying this, here are the general steps:

  • Build the Pluto firmware from source. Analog Devices was awesome, and provides great instructions on the wiki.
  • Reconfigure Linux to have EXT4 drivers. Ubuntu needs a file system that can support symlinks better than FAT32
  • Modify Buildroot image to mount USB drive and switch_root as init process. This means replacing the Buildroot / BusyBox init script (in the root of the initramfs image) with a custom one. Mine is attached for reference.
  • Create Ubuntu armhf userland. I did this using qemu and debootstrap, you could probably start with the armhf base system images Canonical provides instead.
  • Install GNU Radio plus libiio, libad9361-iio, and gr-iio (also openssh-server, etc.) into userland. This is really slow on the device. I'd recommend doing this using qemu and chroot. Also then set up services for wpa_supplicant and optionally getty on a USB-UART adapter (will require building device driver into kernel) for debugging.
  • Copy userland to ext4 flash drive
  • Connect flash drive plus wifi dongle (and/or USB - UART adapter)
  • Boot, ssh in, launch GNU Radio, have fun!

I don't have a pretty packaged build process for all of this yet. The userland especially was a bunch of trial and error to get right the first time. Also, if you try this, be prepared to get your Pluto stuck unable to boot a few times. Put it into DFU mode (provided you haven't messed up u-boot), and reset to the release firmware.

Right now this is mostly just a curiosity. X11 is comically slow on the Pluto, and GNU Radio benefits from a beefier CPU. But, it can be done, and for simple designs might be practical with some more polish. If anyone has questions on how to do this, or ideas on ways of making it more useful, definitely let me know. I think my next step is getting u-boot to boot directly off USB, but that is going to have to wait for my 1.27 mm header JTAG/UART breakout board (Clone of the ADALM-JTAGUART, which isn't quite worth the $50 DigiKey wants for it) to arrive. 

init.zip
    •  Analog Employees 
    on Jul 13, 2018 5:06 PM over 2 years ago

     Iracigt:

     

    This is pretty cool - thanks for sharing.

     

    I could be wrong, but I thought Michael had U-Boot booting FIT files from USB, but we decided to disable it since it caused boot time to be too long. (waiting for USB to time out) so we didn't enable it by default, but it is there...

     

    u-boot-xlnx/zynq-common.h at pluto · analogdevicesinc/u-boot-xlnx · GitHub 

     

    -Robin

  • Hi Iracigt,

    Great blog, and thanks for sharing. I have a one question:

    are you using a Mac OS for this purpose? If so, can you tell me the extent to which Mac OS lends itself to be used? For example is it useful to see GNU radio spectrum and constellations and the block diagram for various encoders to be used, just the way you used a GFSK demod etc?

    I am actually planning to get myself a plutosdr, but since I have a MacBook I am not entirely sure how much useful it will be to me.

    Thanks in advance.

    •  Analog Employees 
    on Aug 9, 2018 4:59 PM over 2 years ago

    rogueprocessor,

    GNURadio can be installed locally on macOS: MacInstall - GNU Radio 

    You will have to install gr-iio (gnuradio pluto support blocks), but all the dependencies can be built on macOS.

    -Travis

  • Hi Travis,

    thanks for the quick reply. So I think I can go ahead with getting the PlutoSDR. However I still have one nagging doubt, if could tell me are there some ways in which MacBook will be inferior in using sdr as compared to Ubuntu or windows, that would be great.

    EDIT: holy moly, I just realised I was reading your book on SDR and from there I got to know about the plutosdr. Small world!

    •  Analog Employees 
    on Aug 9, 2018 5:19 PM over 2 years ago

    All the underlying drivers and such are built and tested on macOS, but the application space it the less confirmed area. The hardware definitely works fine and I use MATLAB all the time with Pluto on my mac, but I haven't used GNURadio yet.  I know others have been successful though.

    I would recommend trying to install GNURadio first and make sure the blocks can showup for Pluto.

    -Travis