Commit graph

2,022 commits

Author SHA1 Message Date
Robert Ghilduta
2ce14de630 libbladeRF: fix GCC 7 error
GCC 7 rightfully believes that this buffer can be 11 bytes long. Counting the
additional NULL byte, this buffer should be at least 12 bytes in size.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
77c4c1b750 2017.07 release changelog 2017-07-06 08:27:47 -07:00
Robert Ghilduta
dcc7647fef bladeRF-cli: changelog and version bump ( v1.5.0 ) bladeRF-cli_v1.5.0 2017-07-06 08:27:47 -07:00
Robert Ghilduta
fe718e8f70 bladeRF-cli: add AGC print and set commands
The AGC can be enabled by running set agc on, and it can be disabled by running
set agc off.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
8f7b4f10c4 hdl: bump the FPGA version to 0.7.0 fpga_v0.7.0 2017-07-06 08:27:47 -07:00
Robert Ghilduta
bdf8958f25 hdl: add band selection to AGC
This fixup allows the AGC LMS driver to select the appropriate LNA when changing
the LNA's gain. libbladeRF reads, masks, and writes this field, however for
performance reasons the AGC LMS driver should know the final value of the
register without first reading it.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
e60ca35427 hdl: instantiate DC LUT NIOS exports 2017-07-06 08:27:47 -07:00
Robert Ghilduta
258d875829 hdl: add DC LUT NIOS exports 2017-07-06 08:27:47 -07:00
Robert Ghilduta
24003d87bd hdl: upgrade NIOS to Quartus 17 2017-07-06 08:27:47 -07:00
Robert Ghilduta
ce9476b9f3 hdl: add DC LUT mux correction
Allow the AGC to choose the appropriate DC offset LUT setting for correcting
the DC offset. Essentially, libbladeRF loads the DC offset lookup table from a
previously computed DC calibration table, and NIOS exposes the correction for
each of the gains. The AGC the selects which correction it wants applied based
on its gain setting.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
86dc25d225 hdl: add AGC synchronizers
The AGC core runs in a different clock domain for that of the NiOS core. Three
synchrinozers have been added to allow the AGC core to drive signals in the
lms_rx_clock_out clock domain while communicating with the NiOS core in the
\80MHz\ clock domain.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
0c95136b0b nios: add support for NIOS grabbing the SPI arbiter lock 2017-07-06 08:27:47 -07:00
Robert Ghilduta
908bfcc1e5 hdl: instantiate AGC NIOS support 2017-07-06 08:27:47 -07:00
Robert Ghilduta
5f1d75fe55 hdl: Add arbitration support to the AGC's LMS6 driver
This ensures the LMS6 SPI controller waits its turn to use the SPI bus.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
73959e7228 hdl: Add Automatic Gain Control core
Automatic Gain Control is essential for a receive chain to drastically increase
the system's dynamic range. RF frontends, such as the LMS6002D, have static
ranges of about 6.02dB per bit. In the case of a 12 bit ADC that means 72dB of
dynamic range. That means that without changing any of the LNA or VGA gains (the
gain remain unchanged or "static") the RF frontend should be able to "see"
signals 72dB around the middle of its range which is set by the LNA and VGA
gains. Although those values seem high, that range is only usable if the
incoming signal requires an infinitesimally small amount of SNR to demodulate.
The 802.11a 6Mbps rate requires about 6dB of SNR, so that along with the noise
figure of the receiver very quickly start taking dB away from the 72dB of
dynamic range. The only option to be able to listen to a signal, which with its
SNR requirements falls below the static range, is to start using the RF
frontend's dnyamic range. The dynamic range of the receiver is adjusted by
altering the settings of physical amplifiers such as the LNA, and VGAs. For the
LMS6002D this range goes from about -120dBm to about +4dBm.

At this point an AGC's useful becomes apparent. The AGC quickly and wisely
adjusts the values of the physical amplifiers to bring the incoming singal
along with its SNR requirements into the static range of the RF frontend.

The AGC implementation in this commit is specific to 802.11 on the LMS6002D.
The AGC idles at the higest gain state so as to not miss anything, and moves to
lower gain settings when the power measurement IIR indicates the system does
not have enough headroom for the 10dB of PAPR 802.11 allows for.

The AGC threshold values overlap a little bit between the high, mid, and low
gain settings. This is done on purpose to add hysteresis to the core.

It is important to note that the AGC does not instantaneously go from high to
low gain, and it will stop at the middle gain setting, wait for the group delays
of the analog RF components to expire, and collect a new IIR reading before
deciding it has settled or if it should go on to the low gain stage.

The power ranges and subsequent gain settings are as follows:

High gain: -82dBm - -52dBm
    lna_gain     =>   6 dB (Max)
    rxvga1_gain  =>  30 dB
    rxvga2_gain  =>  15 dB

Mid gain: -52dBm - -30dBm
    lna_gain     =>   3 dB (Mid)
    rxvga1_gain  =>  30 dB
    rxvga2_gain  =>   0 dB

Low gain: -30dBm - -17dBm
    lna_gain     =>   3 dB (Mid)
    rxvga1_gain  =>  12 dB
    rxvga2_gain  =>   0 dB
2017-07-06 08:27:47 -07:00
Robert Ghilduta
8c783f444f hdl: Add arbiter hdl to NIOS subsystem 2017-07-06 08:27:47 -07:00
Robert Ghilduta
d92a24b224 hdl: Add arbiter to NIOS
Instantiate the arbiter in Qsys
2017-07-06 08:27:47 -07:00
Robert Ghilduta
f787ddcec0 hdl: upgrade IP from Quartus 15 to 16 2017-07-06 08:27:47 -07:00
Robert Ghilduta
0fcce9df88 hdl: Upgrade NIOS to Quartus 16.0 2017-07-06 08:27:47 -07:00
Robert Ghilduta
9614529e50 hdl: Add arbiter to NIOS's IPX 2017-07-06 08:27:47 -07:00
Robert Ghilduta
519176fe66 hdl: fix lms6002d testbench
The lms6002d's dependencies now include the AGC and SPI controller.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
2a87390f8a hdl: Add NIOS compatible arbiter
This is a round robin request/ack based arbiter that also supports requests
from NIOS. NIOS has the highest priority.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
1434ae89b8 libbladeRF: Updated to v1.8.0 libbladeRF_v1.8.0
libbladeRF v1.8.0 introduces support for the Automatic Gain Control.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
ebecc847da libbladeRF: only enable AGC when it is supported
The AGC depends on a newer DC cal table and FPGA version 0.7.0 being loaded. A
DC cal table version of 2 or greater is also required for the AGC to work.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
f1ef088f2b libbladeRF: add gain_mode settings to control AGC
bladerf_set_gain_mode() and bladerf_get_gain_mode() were added to allow for
control of the bladeRF's AGC.
2017-07-05 08:59:09 -07:00
Robert Ghilduta
905c65c2a5 libbladeRF: add AGC GPIO bit
Bit 12 controls the AGC
2017-07-05 08:59:08 -07:00
Robert Ghilduta
e7fb00c683 bladeRF-cli: add cal table agc rx functionality 2017-07-05 08:59:08 -07:00
Robert Ghilduta
b31d4e6d5c bladeRF-cli: print verbose output for DC LUT calculation 2017-07-05 08:59:08 -07:00
Robert Ghilduta
53a698fde2 libbladeRF: introduce support for BLADERF_CAP_AGC_DC_LUT (FPGA v0.7.0) 2017-07-05 08:59:08 -07:00
Robert Ghilduta
7aff155a97 libbladeRF: add gain specific mean errors to DC calibration table
The DC calibration table will now include mean residual errors for 3 different
gains (that will be used by the AGC amont other things) including:
    Max : LNA=6dB, RXVGA1=30dB, RXVGA2=15dB
    Mid : LNA=6dB, RXVGA1=30dB, RXVGA2= 0dB
    Low : LNA=3dB, RXVGA1=12dB, RXVGA2= 0dB

The DC cal table version has been bumped to 2. This commit will allow backward
compatibility with existing DC cal tables.
2017-07-05 08:59:08 -07:00
Robert Ghilduta
666cd5860f libbladeRF: change the tuning call so it returns a tuning entry
This paves the way for the dc cal table to return gain specific tuning
information that will be used by the AGC.
2017-07-05 08:59:08 -07:00
Robert Ghilduta
d8aa462e6a add libbladeRF and bladeRF-cli support for setting AGC DC correction LUT 2017-07-05 08:58:53 -07:00
Oliver Jowett
00a83b8c6b Document why postinst should succeed if the FPGA download fails 2017-07-05 08:58:17 -07:00
Oliver Jowett
2fea0c78da Don't make postinst fail entirely (producing half-configured packages and
making the overall install operation fail) if the FPGA download fails.

(cherry picked from commit 13befc071b3cddb913ce961c3cd7b08216bba2e5)
2017-07-05 08:58:17 -07:00
Brian Glod
1410ac2df9 matlab: Update README.md matlab_v0.1.3
- Added "Before Starting" section
- Added "MATLAB Toolbox Requirements" section
2017-07-05 08:58:17 -07:00
ifrasch
2f4db2c78a hdl: Fixed simulation files
-Added missing ports to nios_system.vhd
-Added missing files to nuand.do
-Compile.do will now compile successfully in Modelsim
2017-07-05 08:58:17 -07:00
Petr Vaněk
d847e2d857 libbladeRF_test: Include time.h for compatibility with musl libc 2017-07-05 08:58:17 -07:00
Thomas Brown
21690e5da0 libbladeRF: Use system clock_gettime on macOS >= 10.12. 2017-07-05 08:58:17 -07:00
Ian Frasch
fcd775f2b9 bladeRF-fsk: Fixed misinformation in README.md
- Made changes to the readme which were meant to be part of the
    initial bladeRF-fsk commit, but were not.

- Also added a comment to rx_ch_filter.h, regarding MATLAB

- Cleaned up trailing whitespace.
2016-08-24 10:05:05 -04:00
Brian Padalino
96a99c02cc fsk: Removing warnings.
Added a return to main() and initializing variables to remove
warnings when building code.
2016-08-23 17:41:37 -04:00
Jon Szymaniak
4de1d02e65 bladeRF-fsk: Fixed 32-bit Windows build issue
Narrowing conversion requires a sanity check and cast.
2016-08-22 16:58:49 -04:00
Ian Frasch
63afe69ac5 bladeRF-fsk: Added support for Visual studio 2012
- Added round() and roundf() functions for VS version 2012 and below, since
    they lack implementation of these functions

- Minor formatting edits to make the compiler (v17.00.50727.1) happy
2016-08-22 16:13:20 -04:00
Jon Szymaniak
eaef4fd70b Updated CONTRIBUTORS 2016-08-22 16:11:33 -04:00
Jon Szymaniak
6d5b456340 bladeRF-fsk: Use inttypes macros to print uint64_t
This addresses a build issue on OSX.
2016-08-16 18:58:22 -04:00
Jon Szymaniak
589ceea0bd bladeRF-fsk: Fixed uninitialized variable in correlator test program
Ensure status is defaulted to a failure code.
2016-08-16 17:49:58 -04:00
Ian Frasch
d7c4506f2b bladeRF-fsk: Added bladeRF-fsk utility
This commit introduces a new utility which is a bladeRF-to-bladeRF text/file
transfer program. The program uses a custom FSK software modem (implemented in
host-side C code) to send/receive data. Included is a Matlab/Octave
simulation/implementation of the modem's physical layer. Supports
Windows/Linux/OSX. More info can be found in the README.md.

This utility now builds/installs as part of the bladeRF host side code. Meaning
it is included when building the host software from the source.
2016-08-15 13:33:44 -04:00
Jon Szymaniak
3734f5c46a bladeRF-cli: Corrected incorrect frequency increment in help text
As of 1154ef7b, the calibration table generation uses a default of
10 MHz increments. This was changed due to the tradeoff between
improved results and a longer calibration run-time.

Fixes #480
2016-07-12 18:45:19 -04:00
Jon Szymaniak
ab12ebd3fb bladeRF 2016.06 release 2016.06 2016-06-29 17:24:49 -04:00
Jon Szymaniak
a865682aca debian: Updated FX3 FW and FPGA bitstream post-install scripts 2016-06-29 16:45:06 -04:00
Jon Szymaniak
e4e7ef896a matlab: Updated version to v0.1.2 matlab-v0.1.2 2016-06-29 14:35:17 -04:00