Questions from a beginner

Discussions related to embedded firmware, driver, and user mode application software development
jom
Posts: 23
Joined: Tue Jul 19, 2016 10:08 pm

Questions from a beginner

Post by jom »

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 »

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: 23
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom »

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 »

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: 23
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom »

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 »

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: 23
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom »

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 »

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: 23
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom »

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 »

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
jom
Posts: 23
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom »

Thanks for that.

Recycling the board: I think I did but it wasn't done with purpose so I can't say. I had the board in and out over a period of time yesterday so I don't know if that was why it came back showing "2.0.0". If I had to guess I'd say no since after installing Porthos and using the newer version of Zadig the board shows up in the Device Manager in a different place in the list. After that the version showed it as "2.0.0". So something changed....

I tried CMake again and it seemed to have gotten worse...or at least more "RED" from the output:
The C compiler identification is MSVC 18.0.21005.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Build type not specified: defaulting to a release build.
Check if the system is big endian
Searching 16 bit integer
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of unsigned short
Check size of unsigned short - done
Using unsigned short
Check if the system is big endian - little endian
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Checking libusb version...
Failed to load D:/Program Files/PothosSDR/lib/libusb-1.0.dll

CMake Warning at cmake/modules/FindLibUSB.cmake:174 (message):


Failed to compile (compiled=TRUE) or run (retval=-1) libusb version check.

This may occur if libusb is earlier than v1.0.10.

Setting LIBUSB_VERSION to 0.0.0.

Call Stack (most recent call first):
CMakeLists.txt:68 (include)


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.

--

C:/Program Files/bladeRF/lib does not exist. Defaulting libbladeRF install location to C:/Program Files/bladeRF/lib.
CMake Warning (dev) at libraries/libbladeRF/CMakeLists.txt:130 (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.

CMake Error at cmake/modules/FindLibPThreadsWin32.cmake:83 (message):
Unable to find pthread-win32 COPYING.LIB file
Call Stack (most recent call first):
libraries/libbladeRF/CMakeLists.txt:173 (find_package)


Configuring incomplete, errors occurred!
I moved the "libusb-1.0.20", "pthreads-w32" and "bladeRF" to the default locations. The "bladeRF" does not have a "lib" folder after I installed it in the default location but I don't know why CMake is looking for it.

As noted in the output CMake could not load "D:/Program Files/PothosSDR/lib/libusb-1.0.dll". The file is there so I don't know why it couldn't load. Does this relate to the "libusb-1.0.20" it is using in the other path? In fact, I don't even know how CMake knows Pothos was placed on my "D" drive. :?:

FX3_SDK_PATH is blank and I don't know what to put there anyway.

Before I ran this above I deleted the cache and deleted what was in the "build" directory.

Thanks

EDIT TO ADD: I noticed that in the instructions on the Wiki it says to use Zadig and have it install a "libusbK" driver. Yet "libusb-1.0.20" was downloaded. Are these two different drivers? These doesn't seem to be but four choices on Zadig and none of these have anything to do with 1.0.20. I don't understand. Which driver is supposed to be used?

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

Re: Questions from a beginner

Post by jom »

Drivers: I'm not sure at this point what the driver is supposed to be. I did get SDR Console to work only after I changed the driver to Cypress from the libsub driver. This morning however SDR Console won't work. :(

I still haven't got CMake to work for me (as in the last post) so I kind of put that aside.

Pothos is somewhat incomprehensible to me. I go around and around with the instructions on Github only to get confused more. Soapy this and GNU that are driving me nuts. :lol: I need to step back and start over...I've put way too many installs on my system the last week and it's hard to keep track of.

I really have no specific questions (other than the last post above). I'm rather frustrated at the moment. :|

EDIT to add: I got to try the SoapySDR bladeRF plug-in build process tonight. Everything went fine (CMake actually worked!) until I actually tried to build the solution in VS2013. I got 137 errors. I later used another method (command line suggestion on one of the wikis) which then worked. Once it was installed it only put the bladeRF.dll in the Soapy folder. Is that all it was supposed to do? It didn't create any bin directory as suggested in the user guide. :?:

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

Re: Questions from a beginner

Post by jom »

OK, I finally got this to work for me. A lot of screwing around and putting things in the right place (I think)....several hours of frustration mostly. :o

Anyway, at this point I have the "solution" files in VS 2013 ready to do....something. I'm not sure what at this point. So if I may ask: are there any examples of what people have done at this point and can there be a way to build a Windows interface to the radio at this point? Or...am I barking up the wrong tree?

Also, on another issue, is there a place that has some good examples of Pothos working with the bladeRF? I found that this program is quite confusing at times. I think it's capabilities is WAY more than what I had originally thought. Again, much of the nomenclature that is used in with the program I find a bit out of my league. Also, even though there are a few videos from the creator on YouTube none direct you to any example files you can use to run radio...well...at least no bladeRF examples. Many of the videos just end abruptly..it kind of leaves you hanging... :?:

Thanks for any info you can give.

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

Re: Questions from a beginner

Post by jynik »

Hi jom,

Great job on the progress you've made so far. I'm really sorry to have left you hanging -- life's been really busy for me and it's getting increasingly difficult to spend as much time as I'd like providing detailed responses. Your questions here are open ended, but hopefully my arbitrary rantings here will be at least mildly useful...

The fact that you've endured through the frustration and stuck with it is fantastic -- things will start making more sense as they become more familiar. Not to be a masochist, but a little pain always seems to be involved with learning new toolchains, languages, etc. :?

At this point you know how to build yourself a brand new bladeRF.dll, bladeRF.lib, etc. This will allow you to play with the codebase, and more importantly, create debug builds that you can use to debug into libbladeRF (or add debug print statements) when writing your custom programs. One reason I love open source software is this reason precisely. Sure, the documentation generally notes the conditions under which errors are thrown, but it's great to be able to see what exact conditions are causing the underlying code to either say, "Hey, you're doing something wrong here!" or go off the rails.

I'm really not too sure about other folks' work in Windows that you could leverage to learn more. (I'm a Linux guy, and am not so familiar with what open-source projects are available on the Windows side, aside from what I've already mentioned.)

If I were in your shoes, I would break your project into smaller goals, work towards those, and then integrate them together as a larger project you're envisioning. For example:
  • Figure out how to create a new "Solution" in Visual Studio and program a simple console-based "Hello World". You could either do this the Visual Studio way, or with CMake. The former might be the best option for now, if you're itching to just start on some code.
  • Do the same, but with a program that uses the bladeRF API to open a device and print some information, such as its serial number, firmware, and FPGA version
  • Further extend that simple command-line program to RX some samples into a large heap-allocated buffer, and then save them to a file in the format that works best for you. If you're a MATLAB or Octave guy, exporting samples as a CSV might work well.
  • In parallel, start looking into the GUI programming tasks you'd like to do. Mock them up and experiment with the different types of views you'd like
  • Make another set of little projects to do some of the signal processing you'd like to do (e.g., FM demodulation -> audio playback). Try recording samples in the bladeRF-cli and feeding sample files through these.


In short, break things down into lots of very concise projects - get these working well first under "ideal" conditions, and then deal with integrating components as an additional step. When things don't work, you can go back to those smaller individual projects and seek to understand where the differences in behavior come from.

With respect to Pothos -- Josh Blum is pretty great about offering advice and is reachable in the #pothos IRC channel on Freenode, as well as some mailing lists. There's some links to the mailing lists here: https://github.com/pothosware/pothos/issues/2

Josh has a few bladeRFs and has done some cool work with them. I bet he or someone else in the Pothos community would be willing to show you how to configure the source/sink blocks for a bladeRF. Bandwidth and sample rate permitting, you should generally be able modify examples to target the bladeRF.
jom
Posts: 23
Joined: Tue Jul 19, 2016 10:08 pm

Re: Questions from a beginner

Post by jom »

Thanks a bunch!

What I think you are saying is maybe where I kind of thought this was going: At this point you can build whatever one likes such as a command line or even a "windows based" SDR control (like GNURadio) using this code...I think. Maybe I'll work up a quick Windows app with a few buttons to push to get the radio to do something. I'd like to see if I can get the TX to work...I have my own spectrum analyzer I can use to direct the signal too. :)

A side question here: I don't think jynik can answer this as it seems he is using Linux but in case others are reading this: In Visual Studio when I hit the "Local Windows Debugger" button I get a "project out of date" window with a file " win_runtime - Debug Win32" listed to re-build. When I do I get an error "Unable to start program C:/...etc.../host/build/Debug/ALL_BUILD The system cannot find the file specified". If anyone has this error can they explain why it happens?

Another question: Given my lack of experience with "C/C++" is it possible to use any of these "build" folder files in C# or Visual Basic instead? I can use the latter languages FAR better than C/C++...at least that way I can get something going a lot sooner. The problem really is that I don't do programming on a regular basis. This always makes it hard since I often have to re-learn stuff I've already done before. You don't forget everything but often things come back to you slower since you haven't used it in awhile.

CMake Issues:

I did find something odd that jynik might be interested in. When using CMake one of several errors that kept coming up was CMake looking and not finding the libusb in my Pothos directory. I found that weird as I have no clue why it was looking for that in my Pothos directory. So I tried to go through many of the "CMakeLists" text files to find where it was that CMake was using my Pothos directory. Not knowing CMake script syntax made this task quite difficult. So I eventually just changed the name of my Pothos directory to something else (putting "xxxx" at the end or something) temporarily. Only THEN did CMake find the libusb info where I had directed it to.

I had a similar issue with where CMake was looking for some "lib" directory in my bladeRF folder. I took my witless brain a day to figure out just to create this directory where CMake was looking for it. That seemed to solve the problem. Funny thing is NOTHING ended up in that directory so I have no clue what it wanted this for (see my posts from a few days ago above for the output from CMake).

I will direct my Pothos issues to the author Josh (poor guy...lol).

Thanks again for everything!

jom
Post Reply