Commit graph

671 commits

Author SHA1 Message Date
Ryan Tucker
dfaceaa6cc Use ${CMAKE_COMMAND} -E copy instead of cp
Normal Windows doesn't have cp, alas
2014-07-07 18:03:32 -04:00
Ryan Tucker
39afa2f07b Markdown-ify the bladeRF-cli interactive help
Adds a new include, doc/cmd_help.h.  This is generated by
pandoc from doc/interactive-help.md.  It's ugly, but that's
why it's programatically generated.

CMake will either generate a new cmd_help.{h,man} or copy them
in from cmd_help.{h,man}.in if pandoc isn't available.

Update cmd.c to use all of these new #defines.  (It looks
cleaner now...!)

Remove the old get-interactive-commands.bash, which is no longer
a part of the build process.  pandoc also generates a man page
snippet for insertion by help2man.

Also some editorial/spelling clarifications/corrections, and
adjustments for formatting.
2014-07-06 17:04:47 -04:00
Jon Szymaniak
9c651b5996 cmake: Fixed default for LIBUSB_PATH (Windows) 2014-07-05 14:56:29 -04:00
Jon Szymaniak
0d00dbc8e2 driver/linux: Updated README.md
Added note that this driver should not be used in its current form.
2014-07-05 12:20:10 -04:00
Jon Szymaniak
20d587993c bladeRF-cli: Added CHANGELOG 2014-07-05 12:15:10 -04:00
Jon Szymaniak
c3a674ea62 libbladeRF: Added CHANGELOG 2014-07-05 03:25:48 -04:00
Jon Szymaniak
c73bae576a bladeRF-cli: Bumped version to v0.11.0
Changes include:

- Added experimental DC calibration table generation
    + Changed usage of 'calibrate' command
    + Move 'correct' functionality into 'calibrate' command
- Added '-e <command>' support
- Added "pretty print" of LMS registers
- Fixed '<rx|tx> wait' hang-ups
- Differentiate between "file not found" and file I/O errors
- Addressed a crash in the 'tx' command
- Fixed handling of unterminated quotes
2014-07-04 11:44:33 -04:00
Jon Szymaniak
14f515e467 libbladeRF: Version bumped to v0.16.0
Changes include:

- Added XB-200 support
- Added experimental DC calibration and DC calibration table support
- Added "software autoload" of FPGAs and DC cal tables from config directories
- Added "File not found" (BLADERF_ERR_NO_FILE) return code
- Allow tuning up to 3.8GHz
- Fixed incorrect version checks
    + This resolves issue where VCTCXO value isn't loaded when using FPGA v0.0.3
- Fixed intermittent FPGA load failures
2014-07-04 11:40:17 -04:00
Jon Szymaniak
78d13c8870 bladeRF-cli: Removed TODO comment, no action needed 2014-07-04 11:26:10 -04:00
Jon Szymaniak
0b139ca2bb host: Added UDEV_RULES_PATH CMake option
This allows alternative paths, such as /usr/lib/udev/rules.d, to be
specified.
2014-07-04 11:11:06 -04:00
Jon Szymaniak
d2d848cc44 libbladeRF: Added BLADERF_FREQUENCY_MIN_XB200 definition to API header 2014-07-04 10:50:04 -04:00
Jon Szymaniak
3b6f70a883 libbladeRF: Removed old bladerf_xb200_attach() function from API
This is a vestige of earlier code. bladerf_expansion_attach() is the
function that performs the desired functionality.

As such bladerf_xb200_attach() has been made static and renamed in xb.c.
2014-07-04 10:15:20 -04:00
Jon Szymaniak
339f0549c2 libbladeRF: Fixed flipped logic in version checks and an erroneous check
The implementations of these were the opposite of what is described
in the associated function descriptions.

Additionally, a version check was incorrectly testing the device's
firmware version instead of the FPGA version.
2014-07-03 15:40:44 -04:00
Jon Szymaniak
0eb27140f9 libbladeRF: Don't enable LMS DCCAL clocks when reading back DC cal values
The DCCAL clocks need to be enable when using DC_LOAD.

However, it appears that enabling the DCCAL clocks when reading back
values at later time yields intermittently corrupted read values
2014-07-02 23:22:25 -04:00
Jon Szymaniak
39799711ef libbladeRF: Fixed unintentional switch case fall-throughs 2014-07-02 01:06:16 -04:00
Jon Szymaniak
a5402b78d9 libbladeRF: Fixed incorrect LMS LPF register configuration
Two issues existed in the LMS LPF configuration:

(1) The LPF bypass was not being disabled when switching to
BLADERF_LPF_DISABLED. Therefore, its state would be different depending
on whether the previous state was BLADERF_LPF_BYPASSED or
BLADERF_LPF_NORMAL.

(2) BLADERF_LPF_BYPASSED was leaving the LPF powered on. According to
the TX/RX LPF block diagram (Figure 3.5, in v1.1r4) in the LMS6002D
programming guide, this implies that the LPF was enabled while its
input was shorted to its output.
2014-07-01 23:02:00 -04:00
Jon Szymaniak
1b1a61bc88 libbladeRF: Removed 3.72GHz SW limit. Allow tuning up to 3.8GHz.
This was limited due to 3.72GHz being the maximum value show in the
LMS6002D programming guide's FREQSEL table. According to a response
on the limemicro-opensource Google group, we should be able to use
the same FREQSEL value from 3.72GHz - 3.8GHz.
2014-06-30 23:32:02 -04:00
Jon Szymaniak
93d180c908 libbladeRF: Reset frequency when existing loopback mode
This ensures that device registers (e.g., SELOUT) are restored properly
upon exiting loopback mode, as the user may have crossed bands.
2014-06-30 20:45:05 -04:00
Jon Szymaniak
3c2d571e45 bladeRF-cli, libbladeRF: Fixed DC cal table extension (.tbl)
As noted in commit 67938789f9, the calibration tables were intended to
have a .tbl extension. However, the calibration table functionality in
the previous commits were incorrectly using a .bin extension.
2014-06-30 20:06:57 -04:00
Jon Szymaniak
83800540a4 libbladeRF: Ensure device is configured after FPGA "software autoload"
bladerf_load_fpga() is now used, as it will initialized the device after
and FPGA load, if needed.
2014-06-30 19:40:24 -04:00
Jon Szymaniak
a151ba4f99 bladeRF-cli: Handle unterminated quote as a non-fatal error condition
And additional return value has been added to str2args in order to
differentiate between an unexpected fatal (e.g, memory) error and
unterminated quotes.

This was previously causing cmd_handle() to fall through to an
"Unknown error" case, which is treated as a fatal error, resulting in
the CLI being terminated.

Thank you to Jens Elofsson (jenselo) for tracking down and reporting the
underlying defect! (Issue #259)
2014-06-30 01:34:00 -04:00
Jon Szymaniak
7ce4b81258 libbladeRF: Fixed memory leaks in DC cal table autoload 2014-06-30 00:04:39 -04:00
Jon Szymaniak
f0fb36ad6e bladeRF-cli: Updated output filename for 'cal table' 2014-06-30 00:04:39 -04:00
Jon Szymaniak
66dd7843b5 bladeRF-cli: Moved IQ correction to 'calibrate' command.
There was some overlap in 'calibrate' and 'correct', so these two
have been consolidated.
2014-06-30 00:04:39 -04:00
Jon Szymaniak
dd2db2370d bladeRF-cli: Revised usage of 'calibrate' command
Added explicit parameter to denote dc calibration:
    Changed 'cal <tx|rx>' to 'cal dc <tx|rx>'
    Changed 'cal table' to 'cal table dc'

In upcoming changesets, this will allow for IQ imbalance corrections
to be accounted for.
2014-06-30 00:04:39 -04:00
Jon Szymaniak
406c8d3fa2 Windows warning cleanup 2014-06-30 00:04:39 -04:00
Jon Szymaniak
67938789f9 libbladeRF: Load calibration tables or FPGA bitstream on device open
On Linux and OSX, the following directories will be searched,
in the order listed:
    ~/.config/Nuand/bladeRF
    ~/.Nuand/bladeRF
    /etc/Nuand/bladeRF

In Windows, %appdata%/Nuand/bladeRF will searched.

The following files will be loaded, if found in these search paths:

    FPGA image: hostedx40.rbf or hostedx115.rbf, depending on the
                size of the FPGA reported by the device.

    DC Calibration tables: <serial>_dc_<rx|tx>.tbl

libbladeRF: Added Windows support to file_find
2014-06-30 00:04:39 -04:00
Jon Szymaniak
6c20a6784e libbladeRF: Added function to search for files and read their contents. 2014-06-30 00:04:39 -04:00
Jon Szymaniak
7f4e0e8b6f libbladeRF: Aesthetic cleanup of labels in file_ops.c 2014-06-30 00:04:38 -04:00
Jon Szymaniak
c1ffb2dafe libbladeRF: Moved ARRAY_SIZE() macro to host config header 2014-06-30 00:04:38 -04:00
Jon Szymaniak
e28f973a4b libbladeRF: Removed calibration load from public API
This will be replaced by some detection from a config file
2014-06-30 00:04:38 -04:00
Jon Szymaniak
173512f249 bladeRF-cli: Removed 'load cal'
This will be replaced with auto loading
2014-06-30 00:04:38 -04:00
Jon Szymaniak
d3b9bbf86f libbladeRF: The LPF Tuning DC value is not always 23 2014-06-30 00:04:38 -04:00
Jon Szymaniak
6526e3db76 bladeRF-cli: Cleaned up 'calibrate' usage, added ability to set vals
The names of operations and the overall usage of the 'calibrate' command
has been cleaned up.

For each operation, it is now possible to write the specified value.
2014-06-30 00:04:38 -04:00
Jon Szymaniak
ed83325d66 libbladeRF: Fixed table assignments during TX DC cal table loading
Items were being assigned to the RX module
2014-06-30 00:04:38 -04:00
Jon Szymaniak
046135dd92 bladeRF-cli: Added additional information to DC cal table generation 2014-06-30 00:04:38 -04:00
Jon Szymaniak
a0d8fc2197 bladeRF-cli: Reduced default dc cal table frequency granularity 2014-06-30 00:04:38 -04:00
Jon Szymaniak
bb1d618bf9 libbladeRF: Added a means to clear and disable calibration tables 2014-06-30 00:04:38 -04:00
Jon Szymaniak
3a487a4827 libbladeRF: Apply LMS reg values and reset freq when loading DC cal tbl 2014-06-30 00:04:38 -04:00
Jon Szymaniak
601672a033 libbladeRF, bladeRF-cli: DC calibration table entry size fixes, added fields
The DC calibration table entries' offset values are int16_t, not
uint8_t. Although the actual register values are uint8_t, the libbladeRF
interface has normalized them.

We might want to bypass this normalization to reduce the size of this
calibration table, especially if we want to fit it in flash.
2014-06-30 00:04:38 -04:00
Jon Szymaniak
4dc24fb050 bladeRF-cli: Added 'load cal[ibration] <file>' support. 2014-06-30 00:04:38 -04:00
Jon Szymaniak
eaa76ee831 libbladeRF: Added bladerf_load_calibration_table()
This function provides the ability to load DC offset tables, and will
be used to support loading of IQ balance correction tables in the future.
2014-06-30 00:04:38 -04:00
Jon Szymaniak
0d2f271ef1 bladeRF-cli: Added DC offset calibration table generation 2014-06-30 00:04:38 -04:00
Jon Szymaniak
e05eb84e9b libbladeRF: Added image types for additional calibrations, typo fix 2014-06-30 00:04:37 -04:00
Jon Szymaniak
8f2934d0f3 bladeRF-cli: For LMS DC calibration, perform dummy TX in a loopback mode
This avoids momentarily transmitting on the external TX port while we
run some samples, which seems to be required to get the TX LPF auto
calibration to converge.
2014-06-30 00:04:37 -04:00
Jon Szymaniak
ead1a2cde4 bladeRF-cli: Added parameter readback to 'cal dc_lms_*' items 2014-06-30 00:04:37 -04:00
Jon Szymaniak
a1b9f80671 libbladeRF: Added functions to get/set LMS DC calibration values 2014-06-30 00:04:37 -04:00
Jon Szymaniak
e73438dddc libbladeRF: Removed LMS DC cal routines from device init
In order for the DC cal tables to work, the LMS calibration values will
need to be the same as when the table was generated. Therefore, we
cannot perform these cal routines during device init.
2014-06-30 00:04:37 -04:00
Jon Szymaniak
952db39be0 libbladeRF: Added DC calibration table structure and routines 2014-06-30 00:04:37 -04:00
Jon Szymaniak
d53d9d1ae4 bladeRF-cli: Updated 'calibrate' help text and removed no-arg execution. 2014-06-30 00:04:37 -04:00