# Writing a Radio Driver

**URL:** <https://www.ruby-forum.com/t/writing-a-radio-driver/232587>\
**Category:** GNU Radio\
**Created:** [October 16, 2014, 8:22pm UTC](https://www.ruby-forum.com/t/writing-a-radio-driver/232587 "2014-10-16T20:22:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 16, 2014, 8:22pm UTC](https://www.ruby-forum.com/t/writing-a-radio-driver/232587/1 "2014-10-16T20:22:21Z")

</div>

Hello Everyone,

I have a custom PCB to power an SDR, and I’m going to need to provide  
a gnuradio driver for it.

We are using:

- Xilinx Zynq 7020 SoC
- Analog Devices AD9364 ADC
- AvNet ZedBoard for prototyping

I can only imagine that we will ultimately use a tweaked version of  
the Ettus R. UHD driver. I have found a couple of other drivers  
that people have written, as well.

Short of old-fashioned source-diving, I am unsure of where to begin.  
Can anyone recommend some good reading on the gnuradio architecture  
and/or driver layer? I’m guessing I’ll have to write a source block  
for the radio, leaving the issue of running the flow graph on the PL  
of the Zynq and interfacing properly with the AXI bus.

Thanks,  
Harrison

–  
Harrison C.  
Software Consultant  
+1 559.464.5387  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Harrison\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@Harrison\_C](https://www.ruby-forum.com/u/Harrison_C)\
**Post date:** [October 16, 2014, 9:05pm UTC](https://www.ruby-forum.com/t/writing-a-radio-driver/232587/2 "2014-10-16T21:05:13Z")

</div>

Hi Harrison,

Here’s a good tutorial on writing a custom block:

[http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules](http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules)

You can create a source block with _gr\_modtool add -t source …_

You may also try to add your receiver to the source block in gr-osmosdr  
[http://sdr.osmocom.org/trac/wiki/GrOsmoSDR](http://sdr.osmocom.org/trac/wiki/GrOsmoSDR), which already supports  
multiple SDR hardware.

There is also a document on Zynq-based acceleration in GR:

[http://gnuradio.org/redmine/projects/gnuradio/wiki/Zynq](http://gnuradio.org/redmine/projects/gnuradio/wiki/Zynq)

Regards,

Andras

2014-10-16 20:21 GMT+02:00 Harrison C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Harrison\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@Harrison\_C](https://www.ruby-forum.com/u/Harrison_C)\
**Post date:** [October 16, 2014, 9:29pm UTC](https://www.ruby-forum.com/t/writing-a-radio-driver/232587/3 "2014-10-16T21:29:38Z")

</div>

Hi Harrison,

There’s no “driver architecture” in GNU Radio; you just write  
sink/source blocks.  
If you have a few minutes to spare, start with the GNU Radio tutorials  
[1] from start to hardware; that should give you a solid primer on how  
things work with GNU Radio. If you then know how you get your samples  
from the ADC through your Zynq into your userland, you’re basically set  
😃 well, aside from minor things like figuring out how to expose your  
hardware controls most practically to GNU Radio, and how to avoid  
overhead.  
Again, there’s no standard for hardware control in GNU Radio[1].

UHD is quite specific to Ettus devices, so I don’t think screwing your  
stuff onto that seems very wise (though I’ve seen parts similar to yours  
in Ettus products 😉 [2]). UHD, though, is open source, including the  
FPGA image and the matching drivers as well as the userland interface,  
and I don’t think the developers mind you looking at the code they  
produced to tackle the FPGA-userland interface.

Greetings,  
Marcus

[1] maybe there should be. I think we should wrap this up in clean  
interface specifications, and define CORBA objects for that 😃 j/k.  
[2] There is an upcoming embedded USRP, employing a Zynq, the E300.  
Ettus presented some information on grcon 2014:  
[http://www.trondeau.com/storage/grcon14/presentations/Sep16\_05\_Ettus\_Updates.pdf](http://www.trondeau.com/storage/grcon14/presentations/Sep16_05_Ettus_Updates.pdf)

---

<div class="post-metadata">

**Author:** ![Harrison\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@Harrison\_C](https://www.ruby-forum.com/u/Harrison_C)\
**Post date:** [October 20, 2014, 2:19pm UTC](https://www.ruby-forum.com/t/writing-a-radio-driver/232587/4 "2014-10-20T14:19:55Z")

</div>

Harrison,

On option is to start with Nutaq’s software package for the Zedboard  
([http://nutaq.com/en/products/zeptosdr](http://nutaq.com/en/products/zeptosdr)).

This software package includes GNU Radio sink/source blocks on PC to get  
your samples from the ADC through your Zynq into your user land on the  
PC. It also includes those same GNU Radio sink/source blocks, but for a  
GNU Radio running on the ARM processor (includes image with Linux, GNU  
Radio, Nutaq drivers, etc.. for ARM). The FPGA image with comprehensive  
source files and documentation, and the matching host and ARM drivers  
(with source code) as well as the GNU Radio user land interface are  
provided, which should kick-start your work on the Zedboard as far as  
streaming from GNU Radio on the Zedboard is concerned.

Additionally, when using the FMC Radio420x RF daughter card, software  
package contains GNU Radio blocks to expose your hardware controls  
practically. Our software package includes an FPGA IP Core for the  
Radio420x that aims at abstracting the list of the AXI-lite Registers  
through the use of this user friendly Radio420x FPGA core, as well as  
the corresponding GNU Radio blocks so that you can avoid pulling signals  
in the user logic to control the Radio420x and rather call functions on  
the host computer to control the radio parameters (clk freq, Tx freq, Rx  
freq, filters, gains, auto-calibration of DC offset and IQ imbalance,  
etc…). When using an FMC daughter card from a 3rd party vendor with  
the Zedboard, you may use generic AXI-lite Registers read and write  
functions in the Nutaq API to control the AXI-lite FMC IP core provided  
with the FMC card and easily integrate the new card with your existing  
GNU Radio application. The package also includes GNU Radio blocks to  
read and write to Zynq FPGA registers. It should kick-start your work on  
the Zedboard as far as controlling registers from GNU Radio on the  
Zedboard is concerned.

This software package is available online but password protected until  
we find the most comprehensive way to decouple what’s specific to  
Zedboard from what’s specific to the FMC Radio420x. But you can request  
access for a free evaluation.

Good luck.

Tristan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

-----Message d’origine-----  
De: [discuss-gnuradio-bounces+tristan.martin=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+tristan.martin=removed_email_address@domain.invalid)  
[[mailto:discuss-gnuradio-bounces+tristan.martin=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+tristan.martin=removed_email_address@domain.invalid)] De la  
part de Marcus M.  
Envoy: 16 octobre 2014 15:29  
: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Objet: Re: [Discuss-gnuradio] Writing a Radio Driver

Hi Harrison,

There’s no “driver architecture” in GNU Radio; you just write  
sink/source blocks.  
If you have a few minutes to spare, start with the GNU Radio tutorials  
[1] from start to hardware; that should give you a solid primer on how  
things work with GNU Radio. If you then know how you get your samples  
from the ADC through your Zynq into your userland, you’re basically set  
😃 well, aside from minor things like figuring out how to expose your  
hardware controls most practically to GNU Radio, and how to avoid  
overhead.  
Again, there’s no standard for hardware control in GNU Radio[1].

UHD is quite specific to Ettus devices, so I don’t think screwing your  
stuff onto that seems very wise (though I’ve seen parts similar to yours  
in Ettus products 😉 [2]). UHD, though, is open source, including the  
FPGA image and the matching drivers as well as the userland interface,  
and I don’t think the developers mind you looking at the code they  
produced to tackle the FPGA-userland interface.

Greetings,  
Marcus

[1] maybe there should be. I think we should wrap this up in clean  
interface specifications, and define CORBA objects for that 😃 j/k.  
[2] There is an upcoming embedded USRP, employing a Zynq, the E300.  
Ettus presented some information on grcon 2014:  
[http://www.trondeau.com/storage/grcon14/presentations/Sep16\_05\_Ettus\_Updates.pdf](http://www.trondeau.com/storage/grcon14/presentations/Sep16_05_Ettus_Updates.pdf)

On 16.10.2014 20:21, Harrison C. wrote:

> I can only imagine that we will ultimately use a tweaked version of  
> Harrison

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**
