Trying to get bladeRF to work with osmosdr

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
blkbx
Posts: 16
Joined: Sat Jul 27, 2013 6:44 pm

Trying to get bladeRF to work with osmosdr

Post by blkbx »

Hello. I've followed the various compliation and configuration instructions in the READMEs on the git repository, and I've managed to compile and install everything and was attempting to simply read some samples out from the bladeRF. However, some issues have seemed to crop up which I'm hoping to get some help with.

I used the bladerf-cli program to load the FX3 firmware and FPGA:
./bladerf-cli -d /dev/bladerf2 -f bladerf.img
./bladerf-cli -d /dev/bladerf2 -l hostedx40.rbf

and all seemed good, with the output:
bladeRF> probe

Path: /dev/bladerf2
Serial: 0x0000000000000000
Firmware: v0.3
FPGA: v0.0

So then I tried to set up a simple block diagram in gnuradio-companion using an osmocom source block to a FFT plot, but it just kept erroring out saying it couldn't get any samples. Any idea why this would be, or are there detailed instruction on how to set up the osmocom source block to work with bladeRF? Thanks.
madengr
Posts: 34
Joined: Fri Mar 01, 2013 6:51 am

Re: Trying to get bladeRF to work with osmosdr

Post by madengr »

Shouldn't have to change any setting on the source block other than frequency and sample rate (maybe filter BW too, start with 1.5 MHz); at least I have not. It should find the first device. Start with 8 MHz sample rate. I have been able to go as high as 40 MHz but it is unstable. Also don't use a USB extension cable. A 6' type A to micro seems OK, but forget about a 10'. FWIW I'm using GNU Radio 3.7.0 and the Osmocom source off the Osmocom repository (not the nuand one). Also make sure you are exited from the CLI before running the GRC block. Maybe stop the GRC block then query the device with the CLI to see if it received the proper sample rate and frequency.

Mine has been working sporadically. I can usually get it to stream in GRC, but seems like it's tuning off frequency as my test signals does not show up in the FFT, but the nose is there with the proper filter roll-off.
blkbx
Posts: 16
Joined: Sat Jul 27, 2013 6:44 pm

Re: Trying to get bladeRF to work with osmosdr

Post by blkbx »

I did manage to get it to work, although I only pushed it up to 20MHz sample rate. In my GRC spectrogram I get the LO peak at DC and and I can see what seem to be jumps in the power from my home's WiFi, although it's often pretty weak unless I put my phone pretty close and download something.

I wasn't aware that I had to exit out of the CLI program, I couldn't figure out why getting samples would only sporadically work (usually failure to open device), but now it appears that it was because I still had the CLI program open in some instances.
tarvidsson
Posts: 1
Joined: Tue Jul 30, 2013 8:02 am

Re: Trying to get bladeRF to work with osmosdr

Post by tarvidsson »

I had a similar issue, my solution was to set the samplerate before starting gnuradio with the bladerf-cli. It looked to me like the gnuradio plugin did
not set the samplerate in the bladerf so no samples where produced.
madengr
Posts: 34
Joined: Fri Mar 01, 2013 6:51 am

Re: Trying to get bladeRF to work with osmosdr

Post by madengr »

The osmosdr block seems to be limited on what sample rates it will set the bladeRF. 8 MHz works consistently, 10 MHz usually not. The CLI sets and prints just about any sample rate, which makes sense since I think the Si Labs clock chip has 1 Hz resolution. However who knows if it's really setting the chip to that. Something maybe I will measure tonight. Maybe has more to do with crosssing clock domains inside the FPGA. I can't imagine it works with all sample rates. Suppose we need guidance on what sample rates are valid.

At 40 MHz with a 10' long USB cable, samples were definitely lost as the spectrum was choppy. This behavior ceased with a 6 foot cable.
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: Trying to get bladeRF to work with osmosdr

Post by bpadalino »

The TX, RX and FX3 interfaces are all on different clock domains.

The FX3 will run the PCLK at 100MHz when it is active. The TX and RX clock domains run at 2x the sample rate due to the LMS6002D requiring the clock to be 2x the samplerate, and the IQ select signal to be at the clock rate.

The Si5338 should be getting set to the correct value to the Hz. As samples come in, they feed into a dual port FIFO which collects samples until there is a DMA length (1024 samples in SS mode, 512 samples in HS mode) available, at which time it will transfer the data over to the FX3.

Samples might be getting dropped at the host due to processing? We will try to run more tests and characterize it, but fundamentally there shouldn't be a limit to the sample rate and, in the end, even rational sample rates should be available in the form (a + b/c) Hz.
engidea
Posts: 13
Joined: Sat Jun 01, 2013 3:20 am

Re: Trying to get bladeRF to work with osmosdr

Post by engidea »

Hello all

I have bladeRF working with osmosdr but what I get is not something I expect.
Attached there are two screenshot centered at two frequencies

869000k and you see a blip at 868.8
868900k the blinp at 868.8 is kind of disappeared and a blimp happens at 868.5

Rx antenna is plugged and results are pretty much reliable.

What is happening ?
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: Trying to get bladeRF to work with osmosdr

Post by bpadalino »

It appears like your analog LPF bandwidth is a bit wide for your sample rate. Try setting your bandwidth to be 1.5MHz and your sample rate to be 2MHz. This will kill off any aliases which might be coming into the band.

Does that yield any better results?
engidea
Posts: 13
Joined: Sat Jun 01, 2013 3:20 am

Re: Trying to get bladeRF to work with osmosdr

Post by engidea »

Yes, better, see the attached images

However, when a simple 868Mhz transmitter is on the results are still to be understood.

Can you point out to some sort of documentation that can explain the common rules so it is possible to have a reasonably trustworthy spectrum analyzer using fladeRF ?

What I know is from playing with an HP spectum analyzer

Center frequency: The frequency that is under observation
Frequency Span: The frequency interval that is under observation (apparently called sample rate under osmocom_fft ?)
Sweep time: The time it takes to sweep the above interval
Resolution bandwidth: The "smallest" frequency that wants to be observed

It would be great if it was possible to have the same concepts applied to bladeRF, any help ?

Thanks
enyke
Posts: 1
Joined: Fri Aug 23, 2013 4:17 pm

Re: Trying to get bladeRF to work with osmosdr

Post by enyke »

Hi all,

I am a newbie trying to install the bladeRF and get it to working with the GNU radio and osmosdr. I was able to install the board, login to the bladerf-cli, set parameters, receive samples etc. So thats good.

I followed the instructions from http://nuand.com/forums/viewtopic.php?f=9&t=2804 to setup the gnuradio as well as osmosdr. However I am not able to capture samples either from the GRC tool or osmosdr tools. I get the following error message that bladerf_soruce_c is unable to open the device


>> osmocom_fft -a bladerf -v -f 900e6 -s 1e6
gr-osmosdr v0.1.0-8-ge97339c1 (0.1.1git) gnuradio v3.7.0-104-g6bf21a5a
built-in source types: file fcd rtl_tcp bladerf

FATAL: bladerf_source_c failed to open bladeRF device /dev/bladerf0

Trying to fill up 1 missing channel(s) with null source(s).
This is being done to prevent the application from crashing
due to a gnuradio bug. The maintainers have been informed.

Source has no sample rates (wrong device arguments?).

>>

The bladerf device does not show up in the source/sink options in the GRC as well.

Would be grateful if somebody could help out :)
engidea
Posts: 13
Joined: Sat Jun 01, 2013 3:20 am

Re: Trying to get bladeRF to work with osmosdr

Post by engidea »

Most likely cause is that you used the cli being root and now using osmosrd as normal use
ou can change permission to /dev/blader0 to 666 or add a udev rule like this

# this will make the bladerf device writable by nonroot
KERNEL=="bladerf0", MODE="0666"
Post Reply