Questions from a beginner

Discussions related to embedded firmware, driver, and user mode application software development

Moderator: robert.ghilduta

jom
Posts: 22
Joined: Tue Jul 19, 2016 10:08 pm

Questions from a beginner

Post by jom » Wed Jul 20, 2016 11:48 am

Hello

I hope this question is appropriate here. If not, let me know where I can ask these questions.

I'm a beginner at SDRs but it's not the radio portion that I'm new at. RF electronics and processing is my profession but it's all of the software that bogs me down. Git, GNU and all this stuff is a bit overwhelming for someone who doesn't use this stuff very often. I've used Visual Studio and I've programmed PIC devices but that's about it.

So...where does one begin with all of this? I have NOT purchased the bladeRF yet as I wanted to see if I could set up the appropriate software first. If it becomes too much then I can skip on making the big purchase. I'm exclusively a Windows user so I do NOT want to be fooling around with Linux at this point. I'll get buried quite fast if I do (hell...I'm already buried). So with this background a few questions:

1) What is the difference between the bladeRF Windows installation and building it from source? It seems an awful lot of trouble to build it. I've gone through the Wiki and it's helpful guides but there is a LOT going there that I just know nothing about. It is very difficult to follow at times since I don't know much of the jargon. What is the upside of "building" instead of just installing?

2) Does the radio allow you to change what goes into the FPGA? One of my purposes in buying this radio is to be able to play around with DSP filters and the like. Such as inputting signals (thru ADC), processing them...and the output through a DAC. I'd like to implement FFTs, FIR filters and Hilbert transforms if possible. I'm guessing but I assume this would be done through the FPGA. If this can be done what software is normally used?

3) Is there software available to control the radio or it something you have to create yourself?

4) I have MATLAB available to me and after looking around a bit this could be helpful. In fact, that one of the reasons I don't want to bother with Linux since if I'm not using Windows I can't access my MATLAB. Or is there something I'm missing here?

5) GNU Radio seems nice. Is there a Windows version? I'm sure it's used in Linux but that's not for me. As to GNU Radio is that something that MATLAB can be used for instead or do the two applications do completely different things?

6) What is "GIT" exactly? Is it some application used with the radio? I find some of the nomenclature out of my purview...

I apologize for the possible stupid questions and if this is an inappropriate place to ask these questions.

Thanks for any help you can give.

jom

jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Questions from a beginner

Post by jynik » Wed Jul 20, 2016 2:36 pm

Hi jom,

I'll try to answer some of these the best I can, inline'd with your questions.

My advice to you would be to look more into Pothos, GNU Radio, or MATLAB first -- you can do lots with simulation before you have hardware in your hand. ("Simulation before hardware!" is something I expect rings true frequently for someone in your profession! :) )

There is some good reading material linked from the Wiki, that you may be interested in .
I'm exclusively a Windows user so I do NOT want to be fooling around with Linux at this point. I'll get buried quite fast if I do (hell...I'm already buried). So with this background a few questions:
A lot of the Windows applications out there, such as SDR # and SDR Console are generally receive-only. There have been folks in the community doing other cool development in Windows, but as you see, it tends to lean more toward the Linux side of things.

However, as a Windows user looking to dive into development, I think you would be interested in looking into Pothos (another link), which similar to GNU Radio in many regards and works on Windows.

There is a Pothos Windows installer (download page) that already contains bladeRF support (no need to even use the Nuand bladeRF installer), the Pothos GUI, GQRX, and other goodies!
1) What is the difference between the bladeRF Windows installation and building it from source? It seems an awful lot of trouble to build it. I've gone through the Wiki and it's helpful guides but there is a LOT going there that I just know nothing about. It is very difficult to follow at times since I don't know much of the jargon. What is the upside of "building" instead of just installing?
The upside is that you can build yourself the latest and greatest code, without waiting on releases. Familiarizing yourself with the tools may be good if you're intending to do your own development.

Stick with Visual studio 2013 for this -- we're aware of some issues that resulted from changes introduced with Visual Studio 2015.
3) Is there software available to control the radio or it something you have to create yourself?
Some of the programs I noted already would be of interest -- Pothos, GQRX (included with the Pothos installer), SDR-Console, SDR #.

With that said, they all provide different types of "control" of the radio. It becomes a matter of defining what you want to do, and then choosing (or developing) the right tool for the job.
4) I have MATLAB available to me and after looking around a bit this could be helpful. In fact, that one of the reasons I don't want to bother with Linux since if I'm not using Windows I can't access my MATLAB. Or is there something I'm missing here?
There are MATLAB bindings that work on both Windows and Linux. With that said, we definitely see much better performance when using a data-flow oriented framework such as GNU Radio or Pothos.

If you want to develop real-time applications, I'd go with GNU Radio or Pothos, personally. However, the MATLAB interface is great for prototyping and experimenting. I find it convenient to be able to receive samples directly from within MATLAB, and then use scripts to prototype some of the DSP I'd like to do.
5) GNU Radio seems nice. Is there a Windows version? I'm sure it's used in Linux but that's not for me. As to GNU Radio is that something that MATLAB can be used for instead or do the two applications do completely different things?
I've heard that people have been successfully compiling GNU Radio for Windows, but am not sure of the status of this. If you want to experiment with GNU Radio but don't want to mess around with getting Linux installed, the GNU Radio Live SDR Environment is excellent. You can boot this right from a USB flash drive.
I recently submitted a patch to get the latest bladeRF support into the next release of that live image. I have an unofficial release of this live image with this added bladeRF support hosted here.

With that said, I just want to reiterate that you may want to check out Pothos -- I gave the installer a shot and was pleasantly surprised to see lots of stuff working out of the box.

On GNU Radio vs MATLAB -- they're two different tools that have been developed with significantly different goals in mind.

As I've noted, my personal preference tends to be the former for real-time applications and the latter during my prototyping and experimenting stages where I'm recording and processing samples "offline."

I'm sure experts in either can make compelling arguments for one versus the other, however.
6) What is "GIT" exactly? Is it some application used with the radio? I find some of the nomenclature out of my purview...
Git is the version control system used to manage the project's source code.

jom
Posts: 22
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom » Wed Jul 20, 2016 6:26 pm

Wow...thanks for that. It's like drinking from a fire hose! :shock:

OK, you've answered most of what I asked but it did bring to mind a couple of comments/questions...

1) I assume by "SDR # and SDR Console" you meant SDR-Radio which is a program I've downloaded already. Nonetheless I see Pothos in my future. I'll give it a shot!

2) You skipped this question earlier so maybe you didn't see it: Does the radio allow you to change what goes into the FPGA? One of my purposes in buying this radio is to be able to play around with DSP filters and the like. Such as inputting signals (thru ADC), processing them...and the output through a DAC. I'd like to implement FFTs, FIR filters and Hilbert transforms if possible. I'm guessing but I assume this would be done through the FPGA. If this can be done what software is normally used?

3) Build vs. Install: OK, I'll give this a try. I'm following your Windows Build doc on the Wiki...I'll see how it goes. And, yes, I'll stick with VS2013. My history of unmitigated disasters with relatively new MS software means I'm staying away from VS2015. I usually skip versions coming from MS....like my avoidance of Vista and Winblows 8. I have to fight off that absurd Windows 10 pop-up every day just to make sure I don't accidentally click it. :x

4) Radio control...I think I'll be able to work that out. I have written software in VS that is able to control devices such as 3rd party synthesizers so maybe this will be similar...I am an amateur though.

5) I'll looking into GNU Radio Live...thanks for the link!

6) Your quote:
If you want to develop real-time applications, I'd go with GNU Radio or Pothos...
So Pothos (or GNU Radio) are more than just applications themselves? This statement seems to imply they CREATE applications similar to VS2013. Can you clarify?

7) Jargon question: what is a "binding"? ie Matlab binding

Thanks for EVERYTHING...it is MUCH appreciated!! :D

jom

jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Questions from a beginner

Post by jynik » Thu Jul 21, 2016 7:53 am

Hi jom,

I'm glad some of my answers were helpful - I know it's a lot. Bringing all of this SDR "stuff" together includes and requires knowledge from a breadth of domains -- it undoubtedly takes time and patience to put it all together.

Below I've inline'd my responses:
1) I assume by "SDR # and SDR Console" you meant SDR-Radio which is a program I've downloaded already. Nonetheless I see Pothos in my future. I'll give it a shot!
I'm sorry - I always get confused by the name of the program -- by "SDR Console" I was referring to Simon Brown's SDR-Radio program.

SDR# is another Windows Program.

Definitely check out Pothos -- here's a tutorial video by the author to whet your palette: https://www.youtube.com/watch?v=XeaznzSPuXk
You skipped this question earlier so maybe you didn't see it: Does the radio allow you to change what goes into the FPGA? One of my purposes in buying this radio is to be able to play around with DSP filters and the like. Such as inputting signals (thru ADC), processing them...and the output through a DAC. I'd like to implement FFTs, FIR filters and Hilbert transforms if possible. I'm guessing but I assume this would be done through the FPGA. If this can be done what software is normally used?
Whoops - I'm sorry about that.

The short answer is yes -- you are free to modify the FPGA configuration. The source code (VHDL) for the logic on the FPGA is available, and there is an edition of Altera Quartus that is free of charge that you can use. If this is your first time diving into FPGA development, it is certainly going to be diving into the deep end.

All of the things you noted can be done on the host side in software -- a majority of our users work in this mode where they stream IQ samples to the host and do all the DSP on a host machine. That's where GNU Radio or Pothos comes in. There are also libraries like LiquidSDR: http://liquidsdr.org/

My colleagues who are more on the FPGA side of things generally do all their modeling and prototyping in software on the host machine. They then transition their design to HDL (VHDL or Verilog) and simulate extensively, ideally with bit-accurate models (e.g., need to account for error accumulation in fixed point math). Once this is complete, they begin working with "real" hardware and evaluate. Generally, your software prototype/model will help you establish which components require optimization.

Not trying to discourage you -- just letting you know there's a lot there and trying to be realistic with expectations. I'm not sure what your background is with respect FPGAs and HDL, but you can get a lot of mileage out of the Modelsim simulator if you're just learning or want to dive into implementing some of the items you've mentioned.
3) Build vs. Install: OK, I'll give this a try. I'm following your Windows Build doc on the Wiki...I'll see how it goes. And, yes, I'll stick with VS2013. My history of unmitigated disasters with relatively new MS software means I'm staying away from VS2015. I usually skip versions coming from MS....like my avoidance of Vista and Winblows 8. I have to fight off that absurd Windows 10 pop-up every day just to make sure I don't accidentally click it. :x
Excellent! If you decide to go back to the pre-built installer, you've at least picked up a new thing or two, right?

Agreed regarding Win 10 -- I do most Windows dev for the platform on Win 7 with VS2013. I have a Win 10 machine and it just feels like dumbed down UIs keep getting in the way of what I actually want to do. Fortunately all the good "stuff" is still there, generally still available via hotkeys.
4) Radio control...I think I'll be able to work that out. I have written software in VS that is able to control devices such as 3rd party synthesizers so maybe this will be similar...I am an amateur though.
If you haven't seen already, the way the radio is controlled programmatically is via a C library called libbladeRF. There is some documentation available here: https://nuand.com/libbladeRF-doc

You'll also want to review the LMS6002D documentation to better understand what's going on in the transceiver hardware: http://www.limemicro.com/products/field ... #resources

In some form or another, other frameworks (GNU Radio, MATLAB) are all presenting software layers that operate atop of libbladeRF when talking to the hardware.
So Pothos (or GNU Radio) are more than just applications themselves? This statement seems to imply they CREATE applications similar to VS2013. Can you clarify?
Yes, these are both tools that you can use to create SDR applications. Check out that Pothos tutorial I linked above, and google around for the GNU Radio tutorials -- I think seeing them in action will best explain.
Jargon question: what is a "binding"? ie Matlab binding
I think this Wikipedia entry presents a nice formal definition: https://en.wikipedia.org/wiki/Language_binding

In the context of what I said -- libbladeRF (bladeRF.dll in Windows) is the library talks to and controls the bladeRF. As a programmer, you call functions in this library.

The MATLAB "bindings" are some MATLAB glue code that presents an object-oriented MATLAB interface and translates operations into calls to the bladeRF.dll.

For example, my_device.rx.frequency = 6e6 is translated into the library function call of bladerf_set_frequency(device, BLADERF_MODULE_RX, 6e6).

jom
Posts: 22
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom » Thu Jul 21, 2016 8:31 am

OK that is GREAT stuff! I do have a couple of "product" questions but no more tough stuff for now...I just wanted to thank you for the input. It is much appreciated.

I was able to get the GNU Radio onto a flash drive and boot my computer to it. That was helpful. However, it took me two hours to figure out why my computer would not recognize my flash drive as boot-able. I finally got it so now I learned something useful I think.

Question: Do the users you know buy the bladeRF with the larger FPGA or do most think the smaller one is good enough? What's the consensus?

Thanks again!

jom

jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Questions from a beginner

Post by jynik » Thu Jul 21, 2016 9:35 am

Hi jom,

Glad to be of help and that you were able to figure things out!

Regarding, the FPGA, I'm afraid the answer is mostly, "it depends upon what you're looking to do." It takes experience with the device and tools to develop a good sense of how large one's designs are going to be, in terms of resource utilization.

If you're just starting out and "kicking the tires" so to speak, I would personally go with the x40 option. Per the latest x40 fitter report, you still have quite a bit of room to experiment. (x115 report for comparison).

jom
Posts: 22
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom » Thu Jul 28, 2016 10:31 am

jynik

Thanks for all of the help...it is very much appreciated.

I'm still working on the details here but I was given access to a Nuand board a fellow colleague owns. Which leads me to a question: This board seems to have a USB 3.0 connector rather than the one I see on your website. The present version looks more like the Type B USB 2.0 connector.

Since the board I have is at least a year old (with the 3.0) I find it odd you guys would go BACKWARD to a USB 2.0 connector. What am I missing here? :?:

Whatever the case, is there some information available on your site about this earlier version of the board. My colleague didn't have any documentation.

Thanks again!

jom

jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Questions from a beginner

Post by jynik » Mon Aug 01, 2016 8:58 am

Hi jom,

I apologies for the delayed response.

The "new" connector you see on newer bladeRFs is a USB 3.0 Type B connector. Note that there's a top section on it where the USB 3.0 signaling takes place, which differs from the USB 3.0 type B.

Image

The only differences between the two revisions of the bladeRF is that connector. Both are USB 3.0 and everything other than that connector remained the same. The through-hole type B receptacle is much sturdier and resilient to "oops" moments.

In terms of a landing page for resources, https://nuand.com/support.php is the best place to start. From there you can get to source code, schematics, the wiki, the product brief, and more.

Cheers!
Jon

jom
Posts: 22
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom » Tue Aug 02, 2016 7:03 pm

Thanks for that info. The surface mount version is a bit more flimsy I'd imagine.

I've done quite a bit since I posted this thread originally. I've run into some problems however.

First of all when I put the bladeRF software on my computer it asked whether I wanted to upgrade the firmware to "2.0.0". I did this but later when I went into the CMD.exe Windows tool and typed "bladeRF-cli -i" and then typed "version" it tells me the firmware is "1.6.1-git-b7e6642". What am I missing here? The install DID go through the motions of upgrading the firmware but it seems it was a much older version (I think).

EDIT: I seemed to have corrected this. I later put Pothos on my computer and it had a newer version of Zadig. This then put a driver that seemed to act a bit differently in Windows Device Manager. Whatever the case, now when I use bladeRF in the command (CMD.exe) window the Firmware version now says 2.0.0. I didn't change anything so I'm unsure what happened... :?:

Anyway the other issue is CMake. The CMake "Configuring" as spelled out in the "Getting Started" on Github isn't going so well. I get a lot of errors when trying to Configure and Generate. Admittedly I did put the pthreads-win32 and libusb-1.0.20 in a different place on my computer from default. However, I don't know how to use the -DLIBUSB_PATH= in Cmake. Here is the output:
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Checking libusb version...
libusb version: 1.0.20

Cypress backend not available. The following location does not exist: FX3_SDK_PATH=
CMake Warning (dev) at CMakeLists.txt:82 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.

Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
This warning is for project developers. Use -Wno-dev to suppress it.

--

D:/Program Files/bladeRF/lib does not exist. Defaulting libbladeRF install location to D:/Program Files/bladeRF/lib.
CMake Error at libraries/libbladeRF/CMakeLists.txt:104 (message):
No libbladeRF backends are enabled. Please enable one or more backends.


Configuring incomplete, errors occurred!
I would like to go to the next step and build the solution (.sln) to understand what it is giving me. I'm a bit stuck however...

Thanks

jom

jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Questions from a beginner

Post by jynik » Wed Aug 03, 2016 7:14 am

EDIT: I seemed to have corrected this. I later put Pothos on my computer and it had a newer version of Zadig. This then put a driver that seemed to act a bit differently in Windows Device Manager. Whatever the case, now when I use bladeRF in the command (CMD.exe) window the Firmware version now says 2.0.0. I didn't change anything so I'm unsure what happened... :?:
Did you not power cycle the device after flashing the new firmware? The change only takes effect when the board next boots from flash.
Anyway the other issue is CMake. The CMake "Configuring" as spelled out in the "Getting Started" on Github isn't going so well. I get a lot of errors when trying to Configure and Generate. Admittedly I did put the pthreads-win32 and libusb-1.0.20 in a different place on my computer from default. However, I don't know how to use the -DLIBUSB_PATH= in Cmake. Here is the output:
Could you place the two items (pthreads, libusb) in the recommended locations, at least as a test? This will be the path of least resistance.

Generally, when working with CMake I like to delete the "build" directory and start fresh when making changes, as not to pull the rug out from under CMake. I would advise you to do the same.

Your log shows CMake finding libusb 1.0.20, so that's good. That should cause it to enable the libusb backend, so I'm not quite sure why it's complaining. There should be an "ENABLE_BACKEND_LIBUSB" checkbox -- is this checked? If not, can you try checking it and kicking off the configuration again?

Another thing to try is to add the LIBUSB_PATH and LIBPTHREADSWIN32_PATH variables before you click the "Configure" button in the CMake GUI, rather than after it runs and can't find things in the default locations. (Do this from a fresh start, as I mentioned above.) There is an "Add Entry" button where you can specify variables. Add them as those names, and set the type to "Path". This will provide you with a "..." button that you can use to browse to the target directories of each.

- Jon

Post Reply