Compare commits

..

No commits in common. "master" and "python_v1.4.0" have entirely different histories.

84 changed files with 1899 additions and 1574 deletions

3
.gitignore vendored
View file

@ -57,8 +57,5 @@ host/misc/windows/scripts/work
env/ env/
venv/ venv/
ENV/ ENV/
__pycache__/
*.py[cod]
*$py.class
.vscode/ .vscode/

View file

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
UPSTREAM='https://www.nuand.com/fx3/bladeRF_fw_v2.6.0.img' UPSTREAM='https://www.nuand.com/fx3/bladeRF_fw_v2.4.0.img'
CHECKSUM='7cc51b4eedebf54dd01be83745d1c59f' CHECKSUM='337f570f2e3fdb26abde0f0765196d92'
DATAFILE='/usr/share/Nuand/bladeRF/bladeRF_fw.img' DATAFILE='/usr/share/Nuand/bladeRF/bladeRF_fw.img'
DESCRIPT='firmware' DESCRIPT='firmware'
MYNAMEIS='bladerf-firmware-fx3' MYNAMEIS='bladerf-firmware-fx3'

View file

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedx115.rbf' UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedx115.rbf'
CHECKSUM='a7f25be8abdab3835e734599eb846ea4' CHECKSUM='94ee5c7f68abe5c3392202246789fedd'
DATAFILE='/usr/share/Nuand/bladeRF/hostedx115.rbf' DATAFILE='/usr/share/Nuand/bladeRF/hostedx115.rbf'
DESCRIPT='FPGA bitstream' DESCRIPT='FPGA bitstream'
MYNAMEIS='bladerf-fpga-hostedx115' MYNAMEIS='bladerf-fpga-hostedx115'

View file

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedx40.rbf' UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedx40.rbf'
CHECKSUM='f3d0e55aa4cae485df6d3c20004b7742' CHECKSUM='25f402b3734c9aa0d37db9531f93335c'
DATAFILE='/usr/share/Nuand/bladeRF/hostedx40.rbf' DATAFILE='/usr/share/Nuand/bladeRF/hostedx40.rbf'
DESCRIPT='FPGA bitstream' DESCRIPT='FPGA bitstream'
MYNAMEIS='bladerf-fpga-hostedx40' MYNAMEIS='bladerf-fpga-hostedx40'

View file

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedxA4.rbf' UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedxA4.rbf'
CHECKSUM='276a74b748d699a9fc348babd34af19c' CHECKSUM='c24af70cf56b13123295125a22d5e921'
DATAFILE='/usr/share/Nuand/bladeRF/hostedxA4.rbf' DATAFILE='/usr/share/Nuand/bladeRF/hostedxA4.rbf'
DESCRIPT='FPGA bitstream' DESCRIPT='FPGA bitstream'
MYNAMEIS='bladerf-fpga-hostedxa4' MYNAMEIS='bladerf-fpga-hostedxa4'

View file

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedxA5.rbf' UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedxA5.rbf'
CHECKSUM='be0909dc27b48a08c54db33675130f27' CHECKSUM='ae6391cc3fd467bbb07868450612ce17'
DATAFILE='/usr/share/Nuand/bladeRF/hostedxA5.rbf' DATAFILE='/usr/share/Nuand/bladeRF/hostedxA5.rbf'
DESCRIPT='FPGA bitstream' DESCRIPT='FPGA bitstream'
MYNAMEIS='bladerf-fpga-hostedxa5' MYNAMEIS='bladerf-fpga-hostedxa5'

View file

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedxA9.rbf' UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedxA9.rbf'
CHECKSUM='1ab3bc8bdcf16a5f0ddf3fcdbaa6556b' CHECKSUM='7dfe8c32f260d43a14b9583375a1a6eb'
DATAFILE='/usr/share/Nuand/bladeRF/hostedxA9.rbf' DATAFILE='/usr/share/Nuand/bladeRF/hostedxA9.rbf'
DESCRIPT='FPGA bitstream' DESCRIPT='FPGA bitstream'
MYNAMEIS='bladerf-fpga-hostedxa9' MYNAMEIS='bladerf-fpga-hostedxa9'

4
debian/control vendored
View file

@ -2,8 +2,8 @@ Source: bladerf
Priority: optional Priority: optional
Maintainer: Nuand LLC <bladeRF@nuand.com> Maintainer: Nuand LLC <bladeRF@nuand.com>
Build-Depends: debhelper (>=9), cmake (>= 2.8.5), pkg-config, doxygen, Build-Depends: debhelper (>=9), cmake (>= 2.8.5), pkg-config, doxygen,
libusb-1.0-0-dev (>= 1.0.12), libedit-dev, libncurses5-dev, libusb-1.0-0-dev (>= 1.0.12), libtecla-dev | libtecla1-dev, libncurses5-dev,
git, help2man, pandoc, libcurl4-openssl-dev git, help2man, pandoc
Standards-Version: 4.1.4 Standards-Version: 4.1.4
Section: comm Section: comm
Homepage: https://www.nuand.com/bladeRF Homepage: https://www.nuand.com/bladeRF

View file

@ -29,8 +29,6 @@
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>
#include <ad9361_api.h>
/** /**
* The purpose of this header file is to allow the use of libad9361 without * The purpose of this header file is to allow the use of libad9361 without
* including all of the unnecessary defines, etc, used during compilation. * including all of the unnecessary defines, etc, used during compilation.
@ -48,6 +46,15 @@
* From common.h * From common.h
******************************************************************************/ ******************************************************************************/
struct clk_onecell_data {
struct clk **clks;
uint32_t clk_num;
};
/******************************************************************************
* From ad9361.h
******************************************************************************/
#define AD936X_REG_TX1_OUT_1_PHASE_CORR 0x08E #define AD936X_REG_TX1_OUT_1_PHASE_CORR 0x08E
#define AD936X_REG_TX1_OUT_1_GAIN_CORR 0x08F #define AD936X_REG_TX1_OUT_1_GAIN_CORR 0x08F
#define AD936X_REG_TX2_OUT_1_PHASE_CORR 0x090 #define AD936X_REG_TX2_OUT_1_PHASE_CORR 0x090
@ -91,6 +98,681 @@
#define AD936X_CNT(x) ((((x)-1) & 0x7) << 12) #define AD936X_CNT(x) ((((x)-1) & 0x7) << 12)
#define AD936X_ADDR(x) ((x)&0x3FF) #define AD936X_ADDR(x) ((x)&0x3FF)
enum dev_id { ID_AD9361, ID_AD9364, ID_AD9363A };
enum ad9361_clocks {
BB_REFCLK,
RX_REFCLK,
TX_REFCLK,
BBPLL_CLK,
ADC_CLK,
R2_CLK,
R1_CLK,
CLKRF_CLK,
RX_SAMPL_CLK,
DAC_CLK,
T2_CLK,
T1_CLK,
CLKTF_CLK,
TX_SAMPL_CLK,
RX_RFPLL_INT,
TX_RFPLL_INT,
RX_RFPLL_DUMMY,
TX_RFPLL_DUMMY,
RX_RFPLL,
TX_RFPLL,
NUM_AD9361_CLKS,
EXT_REF_CLK,
};
enum rx_gain_table_name {
TBL_200_1300_MHZ,
TBL_1300_4000_MHZ,
TBL_4000_6000_MHZ,
RXGAIN_TBLS_END,
};
enum rx_gain_table_type {
RXGAIN_FULL_TBL,
RXGAIN_SPLIT_TBL,
};
struct rx_gain_info {
enum rx_gain_table_type tbl_type;
int32_t starting_gain_db;
int32_t max_gain_db;
int32_t gain_step_db;
int32_t max_idx;
int32_t idx_step_offset;
};
enum ad9361_pdata_rx_freq {
BBPLL_FREQ,
ADC_FREQ,
R2_FREQ,
R1_FREQ,
CLKRF_FREQ,
RX_SAMPL_FREQ,
NUM_RX_CLOCKS,
};
enum ad9361_pdata_tx_freq {
IGNORE_FREQ,
DAC_FREQ,
T2_FREQ,
T1_FREQ,
CLKTF_FREQ,
TX_SAMPL_FREQ,
NUM_TX_CLOCKS,
};
struct ad9361_fastlock_entry {
//#define FASTLOOK_INIT 1
uint8_t flags;
uint8_t alc_orig;
uint8_t alc_written;
};
struct ad9361_fastlock {
uint8_t save_profile;
uint8_t current_profile[2];
struct ad9361_fastlock_entry entry[2][8];
};
enum ad9361_bist_mode {
BIST_DISABLE,
BIST_INJ_TX,
BIST_INJ_RX,
};
enum ad9361_clkout {
CLKOUT_DISABLE,
BUFFERED_XTALN_DCXO,
ADC_CLK_DIV_2,
ADC_CLK_DIV_3,
ADC_CLK_DIV_4,
ADC_CLK_DIV_8,
ADC_CLK_DIV_16,
};
enum rf_gain_ctrl_mode {
RF_GAIN_MGC,
RF_GAIN_FASTATTACK_AGC,
RF_GAIN_SLOWATTACK_AGC,
RF_GAIN_HYBRID_AGC
};
enum f_agc_target_gain_index_type {
MAX_GAIN,
SET_GAIN,
OPTIMIZED_GAIN,
NO_GAIN_CHANGE,
};
enum rssi_restart_mode {
AGC_IN_FAST_ATTACK_MODE_LOCKS_THE_GAIN,
EN_AGC_PIN_IS_PULLED_HIGH,
ENTERS_RX_MODE,
GAIN_CHANGE_OCCURS,
SPI_WRITE_TO_REGISTER,
GAIN_CHANGE_OCCURS_OR_EN_AGC_PIN_PULLED_HIGH,
};
struct rssi_control {
enum rssi_restart_mode restart_mode;
bool rssi_unit_is_rx_samples;
uint32_t rssi_delay;
uint32_t rssi_wait;
uint32_t rssi_duration;
};
struct port_control {
uint8_t pp_conf[3];
uint8_t rx_clk_data_delay;
uint8_t tx_clk_data_delay;
uint8_t digital_io_ctrl;
uint8_t lvds_bias_ctrl;
uint8_t lvds_invert[2];
uint8_t clk_out_drive;
uint8_t dataclk_drive;
uint8_t data_port_drive;
uint8_t clk_out_slew;
uint8_t dataclk_slew;
uint8_t data_port_slew;
};
struct ctrl_outs_control {
uint8_t index;
uint8_t en_mask;
};
struct elna_control {
uint16_t gain_mdB;
uint16_t bypass_loss_mdB;
uint32_t settling_delay_ns;
bool elna_1_control_en;
bool elna_2_control_en;
bool elna_in_gaintable_all_index_en;
};
struct auxadc_control {
int8_t offset;
uint32_t temp_time_inteval_ms;
uint32_t temp_sensor_decimation;
bool periodic_temp_measuremnt;
uint32_t auxadc_clock_rate;
uint32_t auxadc_decimation;
};
struct auxdac_control {
uint16_t dac1_default_value;
uint16_t dac2_default_value;
bool auxdac_manual_mode_en;
bool dac1_in_rx_en;
bool dac1_in_tx_en;
bool dac1_in_alert_en;
bool dac2_in_rx_en;
bool dac2_in_tx_en;
bool dac2_in_alert_en;
uint8_t dac1_rx_delay_us;
uint8_t dac1_tx_delay_us;
uint8_t dac2_rx_delay_us;
uint8_t dac2_tx_delay_us;
};
struct gpo_control {
bool gpo0_inactive_state_high_en;
bool gpo1_inactive_state_high_en;
bool gpo2_inactive_state_high_en;
bool gpo3_inactive_state_high_en;
bool gpo0_slave_rx_en;
bool gpo0_slave_tx_en;
bool gpo1_slave_rx_en;
bool gpo1_slave_tx_en;
bool gpo2_slave_rx_en;
bool gpo2_slave_tx_en;
bool gpo3_slave_rx_en;
bool gpo3_slave_tx_en;
uint8_t gpo0_rx_delay_us;
uint8_t gpo0_tx_delay_us;
uint8_t gpo1_rx_delay_us;
uint8_t gpo1_tx_delay_us;
uint8_t gpo2_rx_delay_us;
uint8_t gpo2_tx_delay_us;
uint8_t gpo3_rx_delay_us;
uint8_t gpo3_tx_delay_us;
};
struct tx_monitor_control {
bool tx_mon_track_en;
bool one_shot_mode_en;
uint32_t low_high_gain_threshold_mdB;
uint8_t low_gain_dB;
uint8_t high_gain_dB;
uint16_t tx_mon_delay;
uint16_t tx_mon_duration;
uint8_t tx1_mon_front_end_gain;
uint8_t tx2_mon_front_end_gain;
uint8_t tx1_mon_lo_cm;
uint8_t tx2_mon_lo_cm;
};
struct gain_control {
enum rf_gain_ctrl_mode rx1_mode;
enum rf_gain_ctrl_mode rx2_mode;
uint8_t adc_ovr_sample_size;
uint8_t adc_small_overload_thresh;
uint8_t adc_large_overload_thresh;
uint16_t lmt_overload_high_thresh;
uint16_t lmt_overload_low_thresh;
uint16_t dec_pow_measuremnt_duration;
uint8_t low_power_thresh;
bool dig_gain_en;
uint8_t max_dig_gain;
bool mgc_rx1_ctrl_inp_en;
bool mgc_rx2_ctrl_inp_en;
uint8_t mgc_inc_gain_step;
uint8_t mgc_dec_gain_step;
uint8_t mgc_split_table_ctrl_inp_gain_mode;
uint8_t agc_attack_delay_extra_margin_us;
uint8_t agc_outer_thresh_high;
uint8_t agc_outer_thresh_high_dec_steps;
uint8_t agc_inner_thresh_high;
uint8_t agc_inner_thresh_high_dec_steps;
uint8_t agc_inner_thresh_low;
uint8_t agc_inner_thresh_low_inc_steps;
uint8_t agc_outer_thresh_low;
uint8_t agc_outer_thresh_low_inc_steps;
uint8_t adc_small_overload_exceed_counter;
uint8_t adc_large_overload_exceed_counter;
uint8_t adc_large_overload_inc_steps;
bool adc_lmt_small_overload_prevent_gain_inc;
uint8_t lmt_overload_large_exceed_counter;
uint8_t lmt_overload_small_exceed_counter;
uint8_t lmt_overload_large_inc_steps;
uint8_t dig_saturation_exceed_counter;
uint8_t dig_gain_step_size;
bool sync_for_gain_counter_en;
uint32_t gain_update_interval_us;
bool immed_gain_change_if_large_adc_overload;
bool immed_gain_change_if_large_lmt_overload;
uint32_t f_agc_dec_pow_measuremnt_duration;
uint32_t f_agc_state_wait_time_ns;
bool f_agc_allow_agc_gain_increase;
uint8_t f_agc_lp_thresh_increment_time;
uint8_t f_agc_lp_thresh_increment_steps;
uint8_t f_agc_lock_level;
bool f_agc_lock_level_lmt_gain_increase_en;
uint8_t f_agc_lock_level_gain_increase_upper_limit;
uint8_t f_agc_lpf_final_settling_steps;
uint8_t f_agc_lmt_final_settling_steps;
uint8_t f_agc_final_overrange_count;
bool f_agc_gain_increase_after_gain_lock_en;
enum f_agc_target_gain_index_type f_agc_gain_index_type_after_exit_rx_mode;
bool f_agc_use_last_lock_level_for_set_gain_en;
uint8_t f_agc_optimized_gain_offset;
bool f_agc_rst_gla_stronger_sig_thresh_exceeded_en;
uint8_t f_agc_rst_gla_stronger_sig_thresh_above_ll;
bool f_agc_rst_gla_engergy_lost_sig_thresh_exceeded_en;
bool f_agc_rst_gla_engergy_lost_goto_optim_gain_en;
uint8_t f_agc_rst_gla_engergy_lost_sig_thresh_below_ll;
uint8_t f_agc_energy_lost_stronger_sig_gain_lock_exit_cnt;
bool f_agc_rst_gla_large_adc_overload_en;
bool f_agc_rst_gla_large_lmt_overload_en;
bool f_agc_rst_gla_en_agc_pulled_high_en;
enum f_agc_target_gain_index_type f_agc_rst_gla_if_en_agc_pulled_high_mode;
uint8_t f_agc_power_measurement_duration_in_state5;
};
struct ad9361_phy_platform_data {
bool rx2tx2;
bool fdd;
bool fdd_independent_mode;
bool split_gt;
bool use_extclk;
bool ensm_pin_pulse_mode;
bool ensm_pin_ctrl;
bool debug_mode;
bool tdd_use_dual_synth;
bool tdd_skip_vco_cal;
bool use_ext_rx_lo;
bool use_ext_tx_lo;
bool rx1rx2_phase_inversion_en;
bool qec_tracking_slow_mode_en;
uint8_t dc_offset_update_events;
uint8_t dc_offset_attenuation_high;
uint8_t dc_offset_attenuation_low;
uint8_t rf_dc_offset_count_high;
uint8_t rf_dc_offset_count_low;
uint8_t dig_interface_tune_skipmode;
uint8_t dig_interface_tune_fir_disable;
uint32_t dcxo_coarse;
uint32_t dcxo_fine;
uint32_t rf_rx_input_sel;
uint32_t rf_tx_output_sel;
uint32_t rx1tx1_mode_use_rx_num;
uint32_t rx1tx1_mode_use_tx_num;
uint32_t rx_path_clks[NUM_RX_CLOCKS];
uint32_t tx_path_clks[NUM_TX_CLOCKS];
uint32_t trx_synth_max_fref;
uint64_t rx_synth_freq;
uint64_t tx_synth_freq;
uint32_t rf_rx_bandwidth_Hz;
uint32_t rf_tx_bandwidth_Hz;
int32_t tx_atten;
bool update_tx_gain_via_alert;
uint32_t rx_fastlock_delay_ns;
uint32_t tx_fastlock_delay_ns;
bool trx_fastlock_pinctrl_en[2];
enum ad9361_clkout ad9361_clkout_mode;
struct gain_control gain_ctrl;
struct rssi_control rssi_ctrl;
struct port_control port_ctrl;
struct ctrl_outs_control ctrl_outs_ctrl;
struct elna_control elna_ctrl;
struct auxadc_control auxadc_ctrl;
struct auxdac_control auxdac_ctrl;
struct gpo_control gpo_ctrl;
struct tx_monitor_control txmon_ctrl;
int32_t gpio_resetb;
int32_t gpio_sync;
int32_t gpio_cal_sw1;
int32_t gpio_cal_sw2;
};
struct ad9361_rf_phy {
enum dev_id dev_sel;
uint8_t id_no;
struct spi_device *spi;
struct gpio_device *gpio;
struct clk *clk_refin;
struct clk *clks[NUM_AD9361_CLKS];
struct refclk_scale *ref_clk_scale[NUM_AD9361_CLKS];
struct clk_onecell_data clk_data;
uint32_t (*ad9361_rfpll_ext_recalc_rate)(struct refclk_scale *clk_priv);
int32_t (*ad9361_rfpll_ext_round_rate)(struct refclk_scale *clk_priv,
uint32_t rate);
int32_t (*ad9361_rfpll_ext_set_rate)(struct refclk_scale *clk_priv,
uint32_t rate);
struct ad9361_phy_platform_data *pdata;
uint8_t prev_ensm_state;
uint8_t curr_ensm_state;
uint8_t cached_rx_rfpll_div;
uint8_t cached_tx_rfpll_div;
struct rx_gain_info rx_gain[RXGAIN_TBLS_END];
enum rx_gain_table_name current_table;
bool ensm_pin_ctl_en;
bool auto_cal_en;
uint64_t last_tx_quad_cal_freq;
uint32_t last_tx_quad_cal_phase;
uint64_t current_tx_lo_freq;
uint64_t current_rx_lo_freq;
bool current_tx_use_tdd_table;
bool current_rx_use_tdd_table;
uint32_t flags;
uint32_t cal_threshold_freq;
uint32_t current_rx_bw_Hz;
uint32_t current_tx_bw_Hz;
uint32_t rxbbf_div;
uint32_t rate_governor;
bool bypass_rx_fir;
bool bypass_tx_fir;
bool rx_eq_2tx;
bool filt_valid;
uint32_t filt_rx_path_clks[NUM_RX_CLOCKS];
uint32_t filt_tx_path_clks[NUM_TX_CLOCKS];
uint32_t filt_rx_bw_Hz;
uint32_t filt_tx_bw_Hz;
uint8_t tx_fir_int;
uint8_t tx_fir_ntaps;
uint8_t rx_fir_dec;
uint8_t rx_fir_ntaps;
uint8_t agc_mode[2];
bool rfdc_track_en;
bool bbdc_track_en;
bool quad_track_en;
bool txmon_tdd_en;
uint16_t auxdac1_value;
uint16_t auxdac2_value;
uint32_t tx1_atten_cached;
uint32_t tx2_atten_cached;
struct ad9361_fastlock fastlock;
struct axiadc_converter *adc_conv;
struct axiadc_state *adc_state;
int32_t bist_loopback_mode;
enum ad9361_bist_mode bist_prbs_mode;
enum ad9361_bist_mode bist_tone_mode;
uint32_t bist_tone_freq_Hz;
uint32_t bist_tone_level_dB;
uint32_t bist_tone_mask;
bool bbpll_initialized;
};
struct rf_rx_gain {
uint32_t ant;
int32_t gain_db;
uint32_t fgt_lmt_index;
uint32_t lmt_gain;
uint32_t lpf_gain;
uint32_t digital_gain;
uint32_t lna_index;
uint32_t tia_index;
uint32_t mixer_index;
};
struct rf_rssi {
uint32_t ant;
uint32_t symbol;
uint32_t preamble;
int32_t multiplier;
uint8_t duration;
};
int32_t ad9361_get_rx_gain(struct ad9361_rf_phy *phy,
uint32_t rx_id,
struct rf_rx_gain *rx_gain);
int32_t ad9361_spi_read(struct spi_device *spi, uint32_t reg);
int32_t ad9361_spi_write(struct spi_device *spi, uint32_t reg, uint32_t val);
void ad9361_get_bist_loopback(struct ad9361_rf_phy *phy, int32_t *mode);
int32_t ad9361_bist_loopback(struct ad9361_rf_phy *phy, int32_t mode);
/******************************************************************************
* From ad9361_api.h
******************************************************************************/
typedef struct {
enum dev_id dev_sel;
uint8_t id_no;
uint32_t reference_clk_rate;
uint8_t two_rx_two_tx_mode_enable;
uint8_t one_rx_one_tx_mode_use_rx_num;
uint8_t one_rx_one_tx_mode_use_tx_num;
uint8_t frequency_division_duplex_mode_enable;
uint8_t frequency_division_duplex_independent_mode_enable;
uint8_t tdd_use_dual_synth_mode_enable;
uint8_t tdd_skip_vco_cal_enable;
uint32_t tx_fastlock_delay_ns;
uint32_t rx_fastlock_delay_ns;
uint8_t rx_fastlock_pincontrol_enable;
uint8_t tx_fastlock_pincontrol_enable;
uint8_t external_rx_lo_enable;
uint8_t external_tx_lo_enable;
uint8_t dc_offset_tracking_update_event_mask;
uint8_t dc_offset_attenuation_high_range;
uint8_t dc_offset_attenuation_low_range;
uint8_t dc_offset_count_high_range;
uint8_t dc_offset_count_low_range;
uint8_t split_gain_table_mode_enable;
uint32_t trx_synthesizer_target_fref_overwrite_hz;
uint8_t qec_tracking_slow_mode_enable;
uint8_t ensm_enable_pin_pulse_mode_enable;
uint8_t ensm_enable_txnrx_control_enable;
uint64_t rx_synthesizer_frequency_hz;
uint64_t tx_synthesizer_frequency_hz;
uint32_t rx_path_clock_frequencies[6];
uint32_t tx_path_clock_frequencies[6];
uint32_t rf_rx_bandwidth_hz;
uint32_t rf_tx_bandwidth_hz;
uint32_t rx_rf_port_input_select;
uint32_t tx_rf_port_input_select;
int32_t tx_attenuation_mdB;
uint8_t update_tx_gain_in_alert_enable;
uint8_t xo_disable_use_ext_refclk_enable;
uint32_t dcxo_coarse_and_fine_tune[2];
uint32_t clk_output_mode_select;
uint8_t gc_rx1_mode;
uint8_t gc_rx2_mode;
uint8_t gc_adc_large_overload_thresh;
uint8_t gc_adc_ovr_sample_size;
uint8_t gc_adc_small_overload_thresh;
uint16_t gc_dec_pow_measurement_duration;
uint8_t gc_dig_gain_enable;
uint16_t gc_lmt_overload_high_thresh;
uint16_t gc_lmt_overload_low_thresh;
uint8_t gc_low_power_thresh;
uint8_t gc_max_dig_gain;
uint8_t mgc_dec_gain_step;
uint8_t mgc_inc_gain_step;
uint8_t mgc_rx1_ctrl_inp_enable;
uint8_t mgc_rx2_ctrl_inp_enable;
uint8_t mgc_split_table_ctrl_inp_gain_mode;
uint8_t agc_adc_large_overload_exceed_counter;
uint8_t agc_adc_large_overload_inc_steps;
uint8_t agc_adc_lmt_small_overload_prevent_gain_inc_enable;
uint8_t agc_adc_small_overload_exceed_counter;
uint8_t agc_dig_gain_step_size;
uint8_t agc_dig_saturation_exceed_counter;
uint32_t agc_gain_update_interval_us;
uint8_t agc_immed_gain_change_if_large_adc_overload_enable;
uint8_t agc_immed_gain_change_if_large_lmt_overload_enable;
uint8_t agc_inner_thresh_high;
uint8_t agc_inner_thresh_high_dec_steps;
uint8_t agc_inner_thresh_low;
uint8_t agc_inner_thresh_low_inc_steps;
uint8_t agc_lmt_overload_large_exceed_counter;
uint8_t agc_lmt_overload_large_inc_steps;
uint8_t agc_lmt_overload_small_exceed_counter;
uint8_t agc_outer_thresh_high;
uint8_t agc_outer_thresh_high_dec_steps;
uint8_t agc_outer_thresh_low;
uint8_t agc_outer_thresh_low_inc_steps;
uint32_t agc_attack_delay_extra_margin_us;
uint8_t agc_sync_for_gain_counter_enable;
uint32_t fagc_dec_pow_measuremnt_duration;
uint32_t fagc_state_wait_time_ns;
uint8_t fagc_allow_agc_gain_increase;
uint32_t fagc_lp_thresh_increment_time;
uint32_t fagc_lp_thresh_increment_steps;
uint8_t fagc_lock_level_lmt_gain_increase_en;
uint32_t fagc_lock_level_gain_increase_upper_limit;
uint32_t fagc_lpf_final_settling_steps;
uint32_t fagc_lmt_final_settling_steps;
uint32_t fagc_final_overrange_count;
uint8_t fagc_gain_increase_after_gain_lock_en;
uint32_t fagc_gain_index_type_after_exit_rx_mode;
uint8_t fagc_use_last_lock_level_for_set_gain_en;
uint8_t fagc_rst_gla_stronger_sig_thresh_exceeded_en;
uint32_t fagc_optimized_gain_offset;
uint32_t fagc_rst_gla_stronger_sig_thresh_above_ll;
uint8_t fagc_rst_gla_engergy_lost_sig_thresh_exceeded_en;
uint8_t fagc_rst_gla_engergy_lost_goto_optim_gain_en;
uint32_t fagc_rst_gla_engergy_lost_sig_thresh_below_ll;
uint32_t fagc_energy_lost_stronger_sig_gain_lock_exit_cnt;
uint8_t fagc_rst_gla_large_adc_overload_en;
uint8_t fagc_rst_gla_large_lmt_overload_en;
uint8_t fagc_rst_gla_en_agc_pulled_high_en;
uint32_t fagc_rst_gla_if_en_agc_pulled_high_mode;
uint32_t fagc_power_measurement_duration_in_state5;
uint32_t rssi_delay;
uint32_t rssi_duration;
uint8_t rssi_restart_mode;
uint8_t rssi_unit_is_rx_samples_enable;
uint32_t rssi_wait;
uint32_t aux_adc_decimation;
uint32_t aux_adc_rate;
uint8_t aux_dac_manual_mode_enable;
uint32_t aux_dac1_default_value_mV;
uint8_t aux_dac1_active_in_rx_enable;
uint8_t aux_dac1_active_in_tx_enable;
uint8_t aux_dac1_active_in_alert_enable;
uint32_t aux_dac1_rx_delay_us;
uint32_t aux_dac1_tx_delay_us;
uint32_t aux_dac2_default_value_mV;
uint8_t aux_dac2_active_in_rx_enable;
uint8_t aux_dac2_active_in_tx_enable;
uint8_t aux_dac2_active_in_alert_enable;
uint32_t aux_dac2_rx_delay_us;
uint32_t aux_dac2_tx_delay_us;
uint32_t temp_sense_decimation;
uint16_t temp_sense_measurement_interval_ms;
int8_t temp_sense_offset_signed;
uint8_t temp_sense_periodic_measurement_enable;
uint8_t ctrl_outs_enable_mask;
uint8_t ctrl_outs_index;
uint32_t elna_settling_delay_ns;
uint32_t elna_gain_mdB;
uint32_t elna_bypass_loss_mdB;
uint8_t elna_rx1_gpo0_control_enable;
uint8_t elna_rx2_gpo1_control_enable;
uint8_t elna_gaintable_all_index_enable;
uint8_t digital_interface_tune_skip_mode;
uint8_t digital_interface_tune_fir_disable;
uint8_t pp_tx_swap_enable;
uint8_t pp_rx_swap_enable;
uint8_t tx_channel_swap_enable;
uint8_t rx_channel_swap_enable;
uint8_t rx_frame_pulse_mode_enable;
uint8_t two_t_two_r_timing_enable;
uint8_t invert_data_bus_enable;
uint8_t invert_data_clk_enable;
uint8_t fdd_alt_word_order_enable;
uint8_t invert_rx_frame_enable;
uint8_t fdd_rx_rate_2tx_enable;
uint8_t swap_ports_enable;
uint8_t single_data_rate_enable;
uint8_t lvds_mode_enable;
uint8_t half_duplex_mode_enable;
uint8_t single_port_mode_enable;
uint8_t full_port_enable;
uint8_t full_duplex_swap_bits_enable;
uint32_t delay_rx_data;
uint32_t rx_data_clock_delay;
uint32_t rx_data_delay;
uint32_t tx_fb_clock_delay;
uint32_t tx_data_delay;
uint32_t lvds_bias_mV;
uint8_t lvds_rx_onchip_termination_enable;
uint8_t rx1rx2_phase_inversion_en;
uint8_t lvds_invert1_control;
uint8_t lvds_invert2_control;
uint8_t clk_out_drive;
uint8_t dataclk_drive;
uint8_t data_port_drive;
uint8_t clk_out_slew;
uint8_t dataclk_slew;
uint8_t data_port_slew;
uint8_t gpo0_inactive_state_high_enable;
uint8_t gpo1_inactive_state_high_enable;
uint8_t gpo2_inactive_state_high_enable;
uint8_t gpo3_inactive_state_high_enable;
uint8_t gpo0_slave_rx_enable;
uint8_t gpo0_slave_tx_enable;
uint8_t gpo1_slave_rx_enable;
uint8_t gpo1_slave_tx_enable;
uint8_t gpo2_slave_rx_enable;
uint8_t gpo2_slave_tx_enable;
uint8_t gpo3_slave_rx_enable;
uint8_t gpo3_slave_tx_enable;
uint8_t gpo0_rx_delay_us;
uint8_t gpo0_tx_delay_us;
uint8_t gpo1_rx_delay_us;
uint8_t gpo1_tx_delay_us;
uint8_t gpo2_rx_delay_us;
uint8_t gpo2_tx_delay_us;
uint8_t gpo3_rx_delay_us;
uint8_t gpo3_tx_delay_us;
uint32_t low_high_gain_threshold_mdB;
uint32_t low_gain_dB;
uint32_t high_gain_dB;
uint8_t tx_mon_track_en;
uint8_t one_shot_mode_en;
uint32_t tx_mon_delay;
uint32_t tx_mon_duration;
uint32_t tx1_mon_front_end_gain;
uint32_t tx2_mon_front_end_gain;
uint32_t tx1_mon_lo_cm;
uint32_t tx2_mon_lo_cm;
int32_t gpio_resetb;
int32_t gpio_sync;
int32_t gpio_cal_sw1;
int32_t gpio_cal_sw2;
uint32_t (*ad9361_rfpll_ext_recalc_rate)(struct refclk_scale *clk_priv);
int32_t (*ad9361_rfpll_ext_round_rate)(struct refclk_scale *clk_priv,
uint32_t rate);
int32_t (*ad9361_rfpll_ext_set_rate)(struct refclk_scale *clk_priv,
uint32_t rate);
} AD9361_InitParam;
typedef struct {
uint32_t rx; /* 1, 2, 3(both) */
int32_t rx_gain; /* -12, -6, 0, 6 */
uint32_t rx_dec; /* 1, 2, 4 */
int16_t rx_coef[128];
uint8_t rx_coef_size;
uint32_t rx_path_clks[6];
uint32_t rx_bandwidth;
} AD9361_RXFIRConfig;
typedef struct {
uint32_t tx; /* 1, 2, 3(both) */
int32_t tx_gain; /* -6, 0 */
uint32_t tx_int; /* 1, 2, 4 */
int16_t tx_coef[128];
uint8_t tx_coef_size;
uint32_t tx_path_clks[6];
uint32_t tx_bandwidth;
} AD9361_TXFIRConfig;
#define AD936X_A_BALANCED 0 #define AD936X_A_BALANCED 0
#define AD936X_B_BALANCED 1 #define AD936X_B_BALANCED 1
#define AD936X_C_BALANCED 2 #define AD936X_C_BALANCED 2
@ -107,5 +789,70 @@
#define AD936X_TXA 0 #define AD936X_TXA 0
#define AD936X_TXB 1 #define AD936X_TXB 1
int32_t ad9361_init(struct ad9361_rf_phy **ad9361_phy,
AD9361_InitParam *init_param,
void *userdata);
int32_t ad9361_deinit(struct ad9361_rf_phy *phy);
int32_t ad9361_set_rx_rf_gain(struct ad9361_rf_phy *phy,
uint8_t ch,
int32_t gain_db);
int32_t ad9361_set_rx_rf_bandwidth(struct ad9361_rf_phy *phy,
uint32_t bandwidth_hz);
int32_t ad9361_get_rx_rf_bandwidth(struct ad9361_rf_phy *phy,
uint32_t *bandwidth_hz);
int32_t ad9361_set_rx_sampling_freq(struct ad9361_rf_phy *phy,
uint32_t sampling_freq_hz);
int32_t ad9361_get_rx_sampling_freq(struct ad9361_rf_phy *phy,
uint32_t *sampling_freq_hz);
int32_t ad9361_set_rx_lo_freq(struct ad9361_rf_phy *phy, uint64_t lo_freq_hz);
int32_t ad9361_get_rx_lo_freq(struct ad9361_rf_phy *phy, uint64_t *lo_freq_hz);
int32_t ad9361_get_rx_rssi(struct ad9361_rf_phy *phy,
uint8_t ch,
struct rf_rssi *rssi);
int32_t ad9361_set_rx_gain_control_mode(struct ad9361_rf_phy *phy,
uint8_t ch,
uint8_t gc_mode);
int32_t ad9361_get_rx_gain_control_mode(struct ad9361_rf_phy *phy,
uint8_t ch,
uint8_t *gc_mode);
int32_t ad9361_set_rx_fir_config(struct ad9361_rf_phy *phy,
AD9361_RXFIRConfig fir_cfg);
int32_t ad9361_set_rx_fir_en_dis(struct ad9361_rf_phy *phy, uint8_t en_dis);
int32_t ad9361_set_rx_rf_port_input(struct ad9361_rf_phy *phy, uint32_t mode);
int32_t ad9361_get_rx_rf_port_input(struct ad9361_rf_phy *phy, uint32_t *mode);
int32_t ad9361_set_tx_attenuation(struct ad9361_rf_phy *phy,
uint8_t ch,
uint32_t attenuation_mdb);
int32_t ad9361_get_tx_attenuation(struct ad9361_rf_phy *phy,
uint8_t ch,
uint32_t *attenuation_mdb);
int32_t ad9361_set_tx_rf_bandwidth(struct ad9361_rf_phy *phy,
uint32_t bandwidth_hz);
int32_t ad9361_get_tx_rf_bandwidth(struct ad9361_rf_phy *phy,
uint32_t *bandwidth_hz);
int32_t ad9361_set_tx_sampling_freq(struct ad9361_rf_phy *phy,
uint32_t sampling_freq_hz);
int32_t ad9361_get_tx_sampling_freq(struct ad9361_rf_phy *phy,
uint32_t *sampling_freq_hz);
int32_t ad9361_set_tx_lo_freq(struct ad9361_rf_phy *phy, uint64_t lo_freq_hz);
int32_t ad9361_get_tx_lo_freq(struct ad9361_rf_phy *phy, uint64_t *lo_freq_hz);
int32_t ad9361_set_tx_fir_config(struct ad9361_rf_phy *phy,
AD9361_TXFIRConfig fir_cfg);
int32_t ad9361_set_tx_fir_en_dis(struct ad9361_rf_phy *phy, uint8_t en_dis);
int32_t ad9361_get_tx_rssi(struct ad9361_rf_phy *phy,
uint8_t ch,
uint32_t *rssi_db_x_1000);
int32_t ad9361_set_tx_rf_port_output(struct ad9361_rf_phy *phy, uint32_t mode);
int32_t ad9361_get_tx_rf_port_output(struct ad9361_rf_phy *phy, uint32_t *mode);
int32_t ad9361_get_temp(struct ad9361_rf_phy *phy);
int32_t ad9361_rx_fastlock_store(struct ad9361_rf_phy *phy, uint32_t profile);
int32_t ad9361_rx_fastlock_save(struct ad9361_rf_phy *phy,
uint32_t profile,
uint8_t *values);
int32_t ad9361_tx_fastlock_store(struct ad9361_rf_phy *phy, uint32_t profile);
int32_t ad9361_tx_fastlock_save(struct ad9361_rf_phy *phy,
uint32_t profile,
uint8_t *values);
int32_t ad9361_set_no_ch_mode(struct ad9361_rf_phy *phy, uint8_t no_ch_mode);
#endif // AD936X_H_ #endif // AD936X_H_

View file

@ -5,12 +5,6 @@ For more detailed information, please see the git change log and issue tracker
hosted on GitHub: https://github.com/nuand/bladeRF hosted on GitHub: https://github.com/nuand/bladeRF
================================================================================ ================================================================================
v2.6.0 (2025-05-06)
--------------------------------
* Increase GPIF buffer size for increase performance
* Fixed missing break in BLADE_USB_CMD_QUERY_FPGA_SOURCE command handling
* Improved FX3 SDK setup instructions in README
v2.5.0 (2024-07-30) v2.5.0 (2024-07-30)
-------------------------------- --------------------------------
* Bumped GPIF DMA buffer size to 8192 bytes * Bumped GPIF DMA buffer size to 8192 bytes

View file

@ -33,7 +33,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../host/cmake/modules)
# Update these definitions when updating the firmware version # Update these definitions when updating the firmware version
set(VERSION_INFO_MAJOR 2) set(VERSION_INFO_MAJOR 2)
set(VERSION_INFO_MINOR 6) set(VERSION_INFO_MINOR 5)
set(VERSION_INFO_PATCH 0) set(VERSION_INFO_PATCH 0)
if(NOT DEFINED VERSION_INFO_EXTRA) if(NOT DEFINED VERSION_INFO_EXTRA)

View file

@ -5,30 +5,6 @@ For more detailed information, please see the git change log and issue tracker
hosted on GitHub: https://github.com/nuand/bladeRF hosted on GitHub: https://github.com/nuand/bladeRF
================================================================================ ================================================================================
--------------------------------
v0.16.0 (2025-05-06)
--------------------------------
This version brings significant FPGA improvements including sc16q11 packed mode
support and optimized USB throughput, along with important bug fixes for bladeRF
1.0 and 2.0 micro devices.
Features:
* hdl: Added sc16q11 packed mode for improved sample efficiency
* hdl: Increased FX3 GPIF buffer sizes, boosting USB throughput (~356MB/s)
* hdl: Implemented dynamic Nios base address assignment based on RAM size
* hdl: Added parallel build support for hosted FPGA variants (40, 115, A4, A5, A9)
* nios: Enabled elf-gdb and gdb-server support for improved debugging capability
* hdl: Added git revision information to FPGA build outputs
Fixes:
* hdl: Fixed delayed sample and off-by-one timestamp bugs on bladeRF 1.0
* hdl: Corrected TX meta sample gap issue when timestamp set to META NOW
* hdl: Fixed corrupted UART buffer in command_uart component
* hdl: Resolved TX deadlock scenarios by refactoring RX/TX DMA prioritization
* hdl: Improved FPGA simulation accuracy for bladeRF 1 and 2 micro models
* hdl: Fixed false timing paths and resolved multiple timing violations
-------------------------------- --------------------------------
v0.15.3 (2023-08-09) v0.15.3 (2023-08-09)
-------------------------------- --------------------------------

View file

@ -36,9 +36,7 @@ LIBAD936X_DIR := ../../../../fpga/ip/analogdevicesinc/no_OS
INC_DIRS += $(LIBAD936X_BUILDDIR) \ INC_DIRS += $(LIBAD936X_BUILDDIR) \
../$(LIBAD936X_DIR)/include \ ../$(LIBAD936X_DIR)/include \
../../../../../../host/common/include \ ../../../../../../host/common/include
../../../../../../host/build/common/thirdparty/ad936x/ \
../../../../../../thirdparty/analogdevicesinc/no-OS_local/platform_bladerf2/
LIB_DIRS += $(LIBAD936X_BUILDDIR) LIB_DIRS += $(LIBAD936X_BUILDDIR)
LDDEPS += $(LIBAD936X_BUILDDIR)/libad936x.a LDDEPS += $(LIBAD936X_BUILDDIR)/libad936x.a
@ -82,6 +80,3 @@ $(LIBAD936X_BUILDDIR)/Makefile: $(LIBAD936X_MAKE_DEP)
$(LIBAD936X_BUILDDIR)/libad936x.a: $(LIBAD936X_BUILD_DEP) $(LIBAD936X_BUILDDIR)/libad936x.a: $(LIBAD936X_BUILD_DEP)
@$(ECHO) Info: Building libad936x @$(ECHO) Info: Building libad936x
@$(MAKE) --no-print-directory -C $(LIBAD936X_BUILDDIR) ad936x @$(MAKE) --no-print-directory -C $(LIBAD936X_BUILDDIR) ad936x
# Ensure libad936x is built before the application objects that depend on its headers
$(APP_OBJS): $(LIBAD936X_BUILDDIR)/libad936x.a

View file

@ -38,8 +38,7 @@ LIBAD936X_DIR := ../../../../fpga/ip/analogdevicesinc/no_OS
INC_DIRS += $(LIBAD936X_BUILDDIR) \ INC_DIRS += $(LIBAD936X_BUILDDIR) \
../$(LIBAD936X_DIR)/include \ ../$(LIBAD936X_DIR)/include \
../../../../../../host/common/include \ ../../../../../../host/common/include
../../../../../../thirdparty/analogdevicesinc/no-OS_local/platform_bladerf2/
LIB_DIRS += $(LIBAD936X_BUILDDIR) LIB_DIRS += $(LIBAD936X_BUILDDIR)
LDDEPS += $(LIBAD936X_BUILDDIR)/libad936x.a LDDEPS += $(LIBAD936X_BUILDDIR)/libad936x.a

View file

@ -3,41 +3,6 @@
# Build a bladeRF fpga image # Build a bladeRF fpga image
################################################################################ ################################################################################
# Ensure we're in the right directory and submodules are initialized
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# Initialize and update submodules if needed
echo "Checking and initializing submodules..."
cd "$PROJECT_ROOT"
if [ -f .gitmodules ]; then
# Initialize submodules if not already initialized
git submodule init
# Update submodules to ensure they're checked out
git submodule update
echo "Submodules initialized and updated."
fi
cd "$SCRIPT_DIR"
cleanup() {
# Prevent recursive cleanup calls
trap '' INT TERM HUP
echo "Cleaning up and terminating builds..."
if [ -n "${build_pids[*]}" ]; then
for pid in "${build_pids[@]}"; do
pkill -P $pid 2>/dev/null || true
done
fi
exit 1
}
# Set up trap to catch Ctrl+C and other termination signals
trap cleanup INT TERM HUP
function print_boards() { function print_boards() {
echo "Supported boards:" echo "Supported boards:"
for i in ../fpga/platforms/*/build/platform.conf ; do for i in ../fpga/platforms/*/build/platform.conf ; do
@ -80,7 +45,6 @@ function usage()
echo " synth Synthesize the design" echo " synth Synthesize the design"
echo " full (default) Fit the design and create programming files" echo " full (default) Fit the design and create programming files"
echo " -S <seed> Fitter seed setting (default: 1)" echo " -S <seed> Fitter seed setting (default: 1)"
echo " -D Output directory name won't contain the date"
echo " -h Show this text" echo " -h Show this text"
echo "" echo ""
@ -162,9 +126,8 @@ fi
nios_rev="Tiny" nios_rev="Tiny"
flow="full" flow="full"
seed="1" seed="1"
omit_date=false
while getopts ":cb:r:s:a:fn:l:S:DhH" opt; do while getopts ":cb:r:s:a:Hfn:l:S:h" opt; do
case $opt in case $opt in
c) c)
clear_work_dir=1 clear_work_dir=1
@ -208,10 +171,6 @@ while getopts ":cb:r:s:a:fn:l:S:DhH" opt; do
seed=$OPTARG seed=$OPTARG
;; ;;
D)
omit_date=true
;;
h) h)
usage usage
exit 0 exit 0
@ -233,31 +192,22 @@ if [ "$build_hosted" == "1" ]; then
mkdir -p build_logs mkdir -p build_logs
build_pids=() build_pids=()
echo "Starting parallel builds for all hosted configurations..."
for config in "bladeRF 40" "bladeRF 115" "bladeRF-micro A4" "bladeRF-micro A5" "bladeRF-micro A9"; do for config in "bladeRF 40" "bladeRF 115" "bladeRF-micro A4" "bladeRF-micro A5" "bladeRF-micro A9"; do
read -r board size <<< "$config" read -r board size <<< "$config"
log_file="build_logs/$board-hosted-$size.log" echo "Starting build for $board hosted $size..."
$0 -b "$board" -r hosted -s "$size" > "$log_file" 2>&1 & $0 -b "$board" -r hosted -s "$size" > "build_logs/$board-hosted-$size.log" 2>&1 &
build_pids+=($!) build_pids+=($!)
echo " → $board $size (PID: ${build_pids[-1]})"
done done
echo "Waiting for ${#build_pids[@]} builds to complete..." echo "Waiting for ${#build_pids[@]} hosted builds to complete..."
# Monitor build processes
failed=0
for pid in "${build_pids[@]}"; do for pid in "${build_pids[@]}"; do
if ! wait "$pid"; then if ! wait "$pid"; then
failed=1 echo "Build failed. Check build_logs directory for details."
exit 1
fi fi
done done
if [ "$failed" -ne 0 ]; then
echo "One or more builds failed. Check build_logs directory for details."
cleanup
exit 1
fi
echo "All hosted builds completed successfully!" echo "All hosted builds completed successfully!"
exit 0 exit 0
fi fi
@ -525,11 +475,7 @@ if [[ ${flow} == "full" ]]; then
BUILD_TIME_DONE=$(date -d"$BUILD_TIME_DONE" '+%F_%H.%M.%S') BUILD_TIME_DONE=$(date -d"$BUILD_TIME_DONE" '+%F_%H.%M.%S')
BUILD_NAME="$rev"x"$size" BUILD_NAME="$rev"x"$size"
if [ "$omit_date" = false ]; then BUILD_OUTPUT_DIR="$BUILD_NAME"-"$BUILD_TIME_DONE"
BUILD_OUTPUT_DIR="$BUILD_NAME"-"$BUILD_TIME_DONE"
else
BUILD_OUTPUT_DIR="$BUILD_NAME"
fi
RBF=$BUILD_NAME.rbf RBF=$BUILD_NAME.rbf
mkdir -p "$BUILD_OUTPUT_DIR" mkdir -p "$BUILD_OUTPUT_DIR"

View file

@ -4,7 +4,6 @@ project(bladeRF C)
################################################################################ ################################################################################
# Project configuration # Project configuration
################################################################################ ################################################################################
add_compile_definitions(NUAND_MODIFICATIONS=1)
# All build output lands in this directory: # All build output lands in this directory:
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)

View file

@ -316,9 +316,7 @@
/******************************************************************************* /*******************************************************************************
* Miscellaneous utility macros * Miscellaneous utility macros
******************************************************************************/ ******************************************************************************/
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(n) (sizeof(n) / sizeof(n[0])) #define ARRAY_SIZE(n) (sizeof(n) / sizeof(n[0]))
#endif
/** /**
* GCC 7+ warns on implicit fallthroughs in switch statements * GCC 7+ warns on implicit fallthroughs in switch statements

View file

@ -39,9 +39,7 @@ extern "C" {
#endif // __MACH__ #endif // __MACH__
typedef int clockid_t; typedef int clockid_t;
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0 #define CLOCK_REALTIME 0
#endif
int clock_gettime(clockid_t clk_id, struct timespec *tp); int clock_gettime(clockid_t clk_id, struct timespec *tp);

View file

@ -51,9 +51,7 @@
#include <pthread.h> #include <pthread.h>
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0 #define CLOCK_REALTIME 0
#endif
#define THREAD pthread_t #define THREAD pthread_t
#define MUTEX pthread_mutex_t #define MUTEX pthread_mutex_t

View file

@ -36,9 +36,7 @@ extern "C" {
#endif #endif
typedef int clockid_t; typedef int clockid_t;
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0 #define CLOCK_REALTIME 0
#endif
int clock_gettime(clockid_t clk_id, struct timespec *tp); int clock_gettime(clockid_t clk_id, struct timespec *tp);

View file

@ -5,56 +5,6 @@ For more detailed information, please see the git change log and issue tracker
hosted on GitHub: https://github.com/Nuand/bladeRF hosted on GitHub: https://github.com/Nuand/bladeRF
================================================================================ ================================================================================
v2.6.0 (2025-05-06)
--------------------------------
This version of libbladeRF is intended for use with:
FX3 Firmware v2.6.0
FPGA v0.16.0
New Features:
* Added SC16_Q11 packed sample format support, improving sample efficiency
* Increased FX3 GPIF buffer sizes, significantly boosting USB throughput (~356MB/s)
* Implemented dynamic Nios base address assignment based on RAM size
* Added parallel build support for hosted FPGA variants (40, 115, A4, A5, A9)
* Enabled elf-gdb and gdb-server support for improved FPGA debugging capability
* Added git revision information to FPGA build outputs
* bladeRF 2.0: Added support for gain calibration loading, enabling, and management
* bladeRF 2.0: Introduced bladeRF-power CLI tool for managing gain calibration
* bladeRF 2.0: Added bladerf_get_gain_target function for gain management
* bladeRF 2.0: Added bladerf_format_to_string API call
* bladeRF 2.0: Added bladerf_image_print_metadata API to display image metadata
* bladeRF 2.0: Improved compatibility checking between FPGA and FX3 firmware GPIF buffers
Improvements:
* libbladeRF now compiles and runs under MinGW and MSVC on Windows platforms
* Replaced libpthreadswin32 dependency with native libbladeRF threading macros
* Improved error handling and reporting for out-of-range frequency and sample rate settings
* Added detailed logging for USB transfer and Nios access timeouts
* Updated Doxygen to v1.9.8, adding support for light/dark modes and modernized configuration
* Improved GPIF buffer alignment handling for larger FX3 buffer sizes
* Added CMake find_package() support for easier integration into external projects
* Streamlined internal error checking macros, simplifying codebase
* Enhanced sync_rx_meta example with additional argument parsing and MIMO support
* Improved FPGA simulations for bladeRF 1.0 and bladeRF 2.0 micro
Bug Fixes:
* Fixed delayed sample and off-by-one timestamp issues on bladeRF 1.0
* Corrected TX meta sample gap issue when timestamp set to META_NOW
* Resolved corrupted UART buffer in command_uart component
* Fixed TX deadlock scenarios by refactoring RX/TX DMA prioritization
* Addressed SC16_Q11 packed RX discontinuity issue on overflow condition
* Fixed false timing paths and resolved multiple timing violations
* Fixed calibration load check in bladerf_get_gain_calibration
* Corrected RX meta packet timestamp and flags assignment
* Fixed sync TX initialization bug
Miscellaneous:
* Updated API documentation to reflect larger GPIF buffer sizes
* Improved FX3 SDK setup instructions in README
* Minor typo and documentation corrections throughout the codebase
v2.5.0 (2023-02-13) v2.5.0 (2023-02-13)
-------------------------------- --------------------------------

View file

@ -2,7 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#define FREQ_HOP_SPACING (bladerf_frequency)40e6 #define FREQ_HOP_SPACING (bladerf_frequency)40e6
#define ITERATIONS 10000 #define ITERATIONS 10000
@ -79,16 +78,16 @@ int main(int argc, char *argv[])
for (i = 0; i < num_frequencies; i++) { for (i = 0; i < num_frequencies; i++) {
status = bladerf_set_frequency(dev, ch, frequencies[i]); status = bladerf_set_frequency(dev, ch, frequencies[i]);
if (status != 0) { if (status != 0) {
fprintf(stderr, "Failed to set frequency to %" PRIu64 " Hz: %s\n", fprintf(stderr, "Failed to set frequency to %lu Hz: %s\n",
frequencies[i], bladerf_strerror(status)); frequencies[i], bladerf_strerror(status));
return status; return status;
} }
bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_VERBOSE); bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_VERBOSE);
printf("Frequency: %" PRIu64 " Hz\n", frequencies[i]); printf("Frequency: %lu Hz\n", frequencies[i]);
status = bladerf_get_quick_tune(dev, ch, &quick_tunes[i]); status = bladerf_get_quick_tune(dev, ch, &quick_tunes[i]);
if (status != 0) { if (status != 0) {
fprintf(stderr, "Failed to get quick tune for %" PRIu64 " Hz: %s\n", fprintf(stderr, "Failed to get quick tune for %lu Hz: %s\n",
frequencies[i], bladerf_strerror(status)); frequencies[i], bladerf_strerror(status));
return status; return status;
} }

View file

@ -2165,7 +2165,7 @@ int bladerf_set_oversample_register_config(struct bladerf *dev) {
return BLADERF_ERR_UNSUPPORTED; return BLADERF_ERR_UNSUPPORTED;
} }
bladerf_set_rfic_register(dev,0x003,0xD4); // OC Register bladerf_set_rfic_register(dev,0x003,0x54); // OC Register
/* TX Register Assignments */ /* TX Register Assignments */
bladerf_set_rfic_register(dev,0x02,0xc0); // TX Enable and Filter Control bladerf_set_rfic_register(dev,0x02,0xc0); // TX Enable and Filter Control

View file

@ -1369,18 +1369,6 @@ static int bladerf1_enable_module(struct bladerf *dev,
} }
lms_enable_rffe(dev, ch, enable); lms_enable_rffe(dev, ch, enable);
if (enable && !BLADERF_CHANNEL_IS_TX(ch)) {
struct bladerf_sync *sync = &board_data->sync[ch];
if (sync->initialized) {
status = sync_prime_stream(sync, 0);
if (status != 0) {
return status;
}
}
}
status = dev->backend->enable_module( status = dev->backend->enable_module(
dev, BLADERF_CHANNEL_IS_TX(ch) ? BLADERF_TX : BLADERF_RX, enable); dev, BLADERF_CHANNEL_IS_TX(ch) ? BLADERF_TX : BLADERF_RX, enable);

View file

@ -13,7 +13,6 @@
static const struct compat fw_compat[] = { static const struct compat fw_compat[] = {
/* Firmware requires >= FPGA */ /* Firmware requires >= FPGA */
{ VERSION(2, 6, 0), VERSION(0, 16, 0) },
{ VERSION(2, 5, 0), VERSION(0, 16, 0) }, { VERSION(2, 5, 0), VERSION(0, 16, 0) },
{ VERSION(2, 4, 0), VERSION(0, 6, 0) }, { VERSION(2, 4, 0), VERSION(0, 6, 0) },
{ VERSION(2, 3, 2), VERSION(0, 0, 2) }, { VERSION(2, 3, 2), VERSION(0, 0, 2) },
@ -37,7 +36,6 @@ const struct version_compat_table bladerf1_fw_compat_table = {fw_compat, ARRAY_S
static const struct compat fpga_compat[] = { static const struct compat fpga_compat[] = {
/* FPGA requires >= Firmware */ /* FPGA requires >= Firmware */
{ VERSION(0, 16, 0), VERSION(2, 6, 0) },
{ VERSION(0, 16, 0), VERSION(2, 5, 0) }, { VERSION(0, 16, 0), VERSION(2, 5, 0) },
{ VERSION(0, 15, 3), VERSION(2, 4, 0) }, { VERSION(0, 15, 3), VERSION(2, 4, 0) },
{ VERSION(0, 15, 1), VERSION(2, 4, 0) }, { VERSION(0, 15, 1), VERSION(2, 4, 0) },

View file

@ -2471,9 +2471,8 @@ static int bladerf2_set_loopback(struct bladerf *dev, bladerf_loopback mode)
IF_COMMAND_MODE(dev, RFIC_COMMAND_FPGA, { IF_COMMAND_MODE(dev, RFIC_COMMAND_FPGA, {
if (BLADERF_LB_RFIC_BIST == mode) { if (BLADERF_LB_RFIC_BIST == mode) {
log_error( log_debug(
"%s: RFIC BIST requires HOST tuning mode (currently FPGA). " "%s: BLADERF_LB_RFIC_BIST not supported in FPGA command mode\n",
"Check BLADERF_DEFAULT_TUNING_MODE env var.\n",
__FUNCTION__); __FUNCTION__);
return BLADERF_ERR_UNSUPPORTED; return BLADERF_ERR_UNSUPPORTED;
} }

View file

@ -312,8 +312,7 @@ bool check_total_sample_rate(struct bladerf *dev)
bladerf_sample_rate rate_accum = 0; bladerf_sample_rate rate_accum = 0;
size_t active_channels = 0; size_t active_channels = 0;
const bladerf_sample_rate MAX_SAMPLE_THROUGHPUT = const bladerf_sample_rate MAX_SAMPLE_THROUGHPUT = 80000000;
(dev->feature == BLADERF_FEATURE_OVERSAMPLE) ? 160000000 : 80000000;
/* Read RFFE control register */ /* Read RFFE control register */
status = dev->backend->rffe_control_read(dev, &reg); status = dev->backend->rffe_control_read(dev, &reg);

View file

@ -13,7 +13,6 @@
static const struct compat fw_compat[] = { static const struct compat fw_compat[] = {
/* Firmware requires >= FPGA */ /* Firmware requires >= FPGA */
{ VERSION(2, 6, 0), VERSION(0, 16, 0) },
{ VERSION(2, 5, 0), VERSION(0, 16, 0) }, { VERSION(2, 5, 0), VERSION(0, 16, 0) },
{ VERSION(2, 4, 0), VERSION(0, 6, 0) }, { VERSION(2, 4, 0), VERSION(0, 6, 0) },
{ VERSION(2, 3, 2), VERSION(0, 6, 0) }, { VERSION(2, 3, 2), VERSION(0, 6, 0) },
@ -29,7 +28,6 @@ const struct version_compat_table bladerf2_fw_compat_table = {fw_compat, ARRAY_S
static const struct compat fpga_compat[] = { static const struct compat fpga_compat[] = {
/* FPGA requires >= Firmware */ /* FPGA requires >= Firmware */
{ VERSION(0, 16, 0), VERSION(2, 6, 0) },
{ VERSION(0, 16, 0), VERSION(2, 5, 0) }, { VERSION(0, 16, 0), VERSION(2, 5, 0) },
{ VERSION(0, 15, 3), VERSION(2, 4, 0) }, { VERSION(0, 15, 3), VERSION(2, 4, 0) },
{ VERSION(0, 15, 2), VERSION(2, 4, 0) }, { VERSION(0, 15, 2), VERSION(2, 4, 0) },

View file

@ -319,14 +319,6 @@ static int _rfic_fpga_enable_module(struct bladerf *dev,
/* Perform backend setup */ /* Perform backend setup */
if (be_setup) { if (be_setup) {
if (dir == BLADERF_RX) {
struct bladerf_sync *sync = &board_data->sync[BLADERF_RX];
if (sync->initialized) {
CHECK_STATUS(sync_prime_stream(sync, 0));
}
}
CHECK_STATUS(dev->backend->enable_module(dev, dir, true)); CHECK_STATUS(dev->backend->enable_module(dev, dir, true));
} }

View file

@ -337,14 +337,6 @@ static int _rfic_host_enable_module(struct bladerf *dev,
} }
if (dir_enable || backend_clear) { if (dir_enable || backend_clear) {
if (dir == BLADERF_RX) {
struct bladerf_sync *sync = &board_data->sync[BLADERF_RX];
if (sync->initialized) {
CHECK_STATUS(sync_prime_stream(sync, 0));
}
}
CHECK_STATUS(dev->backend->enable_module(dev, dir, true)); CHECK_STATUS(dev->backend->enable_module(dev, dir, true));
} }
} }

View file

@ -271,22 +271,6 @@ int sync_init(struct bladerf_sync *sync,
goto error; goto error;
} }
if ((layout & BLADERF_DIRECTION_MASK) == BLADERF_RX) {
sync->buf_mgmt.buffer_seq =
(uint32_t *)malloc(num_buffers * sizeof(uint32_t));
if (sync->buf_mgmt.buffer_seq == NULL) {
status = BLADERF_ERR_MEM;
goto error;
}
} else {
sync->buf_mgmt.buffer_seq = NULL;
}
sync->buf_mgmt.expected_seq = 0;
sync->buf_mgmt.next_seq = 0;
sync->buf_mgmt.reorder_len = 0;
sync->buf_mgmt.reorder_limit = 0;
switch (layout & BLADERF_DIRECTION_MASK) { switch (layout & BLADERF_DIRECTION_MASK) {
case BLADERF_RX: case BLADERF_RX:
/* When starting up an RX stream, the first 'num_transfers' /* When starting up an RX stream, the first 'num_transfers'
@ -306,8 +290,6 @@ int sync_init(struct bladerf_sync *sync,
sync->meta.msg_timestamp = 0; sync->meta.msg_timestamp = 0;
sync->meta.msg_flags = 0; sync->meta.msg_flags = 0;
sync_reset_sequence_tracking(&sync->buf_mgmt, num_transfers);
break; break;
case BLADERF_TX: case BLADERF_TX:
@ -350,21 +332,13 @@ void sync_deinit(struct bladerf_sync *sync)
sync_worker_deinit(sync->worker, &sync->buf_mgmt.lock, sync_worker_deinit(sync->worker, &sync->buf_mgmt.lock,
&sync->buf_mgmt.buf_ready); &sync->buf_mgmt.buf_ready);
if (sync->buf_mgmt.actual_lengths) {
free(sync->buf_mgmt.actual_lengths);
}
/* De-allocate our buffer management resources */ /* De-allocate our buffer management resources */
if (sync->buf_mgmt.status) { if (sync->buf_mgmt.status) {
MUTEX_DESTROY(&sync->buf_mgmt.lock); MUTEX_DESTROY(&sync->buf_mgmt.lock);
free(sync->buf_mgmt.status); free(sync->buf_mgmt.status);
sync->buf_mgmt.status = NULL;
}
if (sync->buf_mgmt.actual_lengths) {
free(sync->buf_mgmt.actual_lengths);
sync->buf_mgmt.actual_lengths = NULL;
}
if (sync->buf_mgmt.buffer_seq) {
free(sync->buf_mgmt.buffer_seq);
sync->buf_mgmt.buffer_seq = NULL;
} }
MUTEX_DESTROY(&sync->lock); MUTEX_DESTROY(&sync->lock);
@ -405,43 +379,6 @@ static int wait_for_buffer(struct buffer_mgmt *b,
# define SYNC_WORKER_START_TIMEOUT_MS 250 # define SYNC_WORKER_START_TIMEOUT_MS 250
#endif #endif
int sync_prime_stream(struct bladerf_sync *sync, unsigned int timeout_ms)
{
int status;
unsigned int wait_ms = timeout_ms ? timeout_ms : SYNC_WORKER_START_TIMEOUT_MS;
if (sync == NULL || !sync->initialized) {
return 0;
}
if ((sync->stream_config.layout & BLADERF_DIRECTION_MASK) != BLADERF_RX) {
return 0;
}
if (sync->worker == NULL) {
return BLADERF_ERR_INVAL;
}
switch (sync_worker_get_state(sync->worker, NULL)) {
case SYNC_WORKER_STATE_RUNNING:
return 0;
case SYNC_WORKER_STATE_IDLE:
break;
default:
return BLADERF_ERR_UNEXPECTED;
}
sync_worker_submit_request(sync->worker, SYNC_WORKER_START);
status = sync_worker_wait_for_state(sync->worker,
SYNC_WORKER_STATE_RUNNING,
wait_ms);
return status;
}
/* Returns # of timestamps (or time steps) left in a message */ /* Returns # of timestamps (or time steps) left in a message */
static inline unsigned int ts_remaining(struct bladerf_sync *s) static inline unsigned int ts_remaining(struct bladerf_sync *s)
{ {

View file

@ -23,7 +23,6 @@
#define STREAMING_SYNC_H_ #define STREAMING_SYNC_H_
#include <limits.h> #include <limits.h>
#include <stdint.h>
#include <libbladeRF.h> #include <libbladeRF.h>
@ -48,16 +47,6 @@ typedef enum {
SYNC_BUFFER_IN_FLIGHT, /**< Currently being transferred */ SYNC_BUFFER_IN_FLIGHT, /**< Currently being transferred */
} sync_buffer_status; } sync_buffer_status;
#ifndef SYNC_RX_MAX_REORDER
#define SYNC_RX_MAX_REORDER 256
#endif
struct rx_reorder_entry {
uint32_t seq;
unsigned int buf_idx;
size_t num_samples;
};
typedef enum { typedef enum {
SYNC_META_STATE_HEADER, /**< Extract the metadata header */ SYNC_META_STATE_HEADER, /**< Extract the metadata header */
SYNC_META_STATE_SAMPLES, /**< Process samples */ SYNC_META_STATE_SAMPLES, /**< Process samples */
@ -96,68 +85,12 @@ struct buffer_mgmt {
* submitting full buffers to the underlying async system */ * submitting full buffers to the underlying async system */
sync_tx_submitter submitter; sync_tx_submitter submitter;
/* RX-specific tracking for out-of-order completions */
uint32_t *buffer_seq;
uint32_t expected_seq;
uint32_t next_seq;
struct rx_reorder_entry reorder[SYNC_RX_MAX_REORDER];
size_t reorder_len;
unsigned int reorder_limit;
MUTEX lock; MUTEX lock;
COND buf_ready; /**< Buffer produced by RX callback, or COND buf_ready; /**< Buffer produced by RX callback, or
* buffer emptied by TX callback */ * buffer emptied by TX callback */
}; };
static inline void sync_reset_sequence_tracking(struct buffer_mgmt *b,
unsigned int num_in_flight)
{
if (b == NULL) {
return;
}
if (!b->buffer_seq) {
b->expected_seq = 0;
b->next_seq = 0;
b->reorder_len = 0;
return;
}
for (size_t i = 0; i < SYNC_RX_MAX_REORDER; ++i) {
b->reorder[i].seq = 0;
b->reorder[i].buf_idx = 0;
b->reorder[i].num_samples = 0;
}
for (unsigned int i = 0; i < b->num_buffers; ++i) {
b->buffer_seq[i] = UINT32_MAX;
}
unsigned int limit = num_in_flight;
if (limit > b->num_buffers) {
limit = b->num_buffers;
}
for (unsigned int i = 0; i < limit; ++i) {
b->buffer_seq[i] = i;
}
b->expected_seq = 0;
b->next_seq = limit;
b->reorder_len = 0;
/* Allow a larger reorder window independent of instantaneous slack. */
if (b->num_buffers > 1) {
unsigned int capacity = b->num_buffers - 1;
if (capacity > SYNC_RX_MAX_REORDER) {
capacity = SYNC_RX_MAX_REORDER;
}
b->reorder_limit = capacity;
} else {
b->reorder_limit = 0;
}
}
/* State of API-side sync interface */ /* State of API-side sync interface */
typedef enum { typedef enum {
SYNC_STATE_CHECK_WORKER, SYNC_STATE_CHECK_WORKER,
@ -256,6 +189,4 @@ unsigned int sync_buf2idx(struct buffer_mgmt *b, void *addr);
void *sync_idx2buf(struct buffer_mgmt *b, unsigned int idx); void *sync_idx2buf(struct buffer_mgmt *b, unsigned int idx);
int sync_prime_stream(struct bladerf_sync *sync, unsigned int timeout_ms);
#endif #endif

View file

@ -17,7 +17,6 @@
*/ */
#include <errno.h> #include <errno.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -44,75 +43,6 @@
void *sync_worker_task(void *arg); void *sync_worker_task(void *arg);
static void mark_buffer_ready(struct buffer_mgmt *b,
unsigned int idx,
size_t num_samples)
{
b->status[idx] = SYNC_BUFFER_FULL;
b->actual_lengths[idx] = num_samples;
COND_SIGNAL(&b->buf_ready);
}
static void flush_reorder_entries(struct buffer_mgmt *b)
{
bool progressed = true;
while (progressed && b->reorder_len > 0) {
progressed = false;
for (size_t i = 0; i < b->reorder_len; ++i) {
if (b->reorder[i].seq == b->expected_seq) {
mark_buffer_ready(b, b->reorder[i].buf_idx,
b->reorder[i].num_samples);
b->expected_seq++;
for (size_t j = i; j + 1 < b->reorder_len; ++j) {
b->reorder[j] = b->reorder[j + 1];
}
b->reorder_len--;
progressed = true;
break;
}
}
}
}
static bool hold_out_of_order_buffer(struct buffer_mgmt *b,
uint32_t seq,
unsigned int idx,
size_t num_samples)
{
if (b->reorder_limit == 0 || b->reorder_len >= b->reorder_limit) {
return false;
}
const uint32_t new_distance = seq - b->expected_seq;
size_t insert_pos = 0;
while (insert_pos < b->reorder_len) {
const uint32_t existing_distance =
b->reorder[insert_pos].seq - b->expected_seq;
if (existing_distance > new_distance) {
break;
}
insert_pos++;
}
for (size_t i = b->reorder_len; i > insert_pos; --i) {
b->reorder[i] = b->reorder[i - 1];
}
b->reorder[insert_pos].seq = seq;
b->reorder[insert_pos].buf_idx = idx;
b->reorder[insert_pos].num_samples = num_samples;
b->reorder_len++;
return true;
}
static void *rx_callback(struct bladerf *dev, static void *rx_callback(struct bladerf *dev,
struct bladerf_stream *stream, struct bladerf_stream *stream,
struct bladerf_metadata *meta, struct bladerf_metadata *meta,
@ -150,81 +80,28 @@ static void *rx_callback(struct bladerf *dev,
if (b->resubmit_count == 0) { if (b->resubmit_count == 0) {
if (b->status[b->prod_i] == SYNC_BUFFER_EMPTY) { if (b->status[b->prod_i] == SYNC_BUFFER_EMPTY) {
bool release_now = true; /* This buffer is now ready for the consumer */
uint32_t seq = 0; b->status[samples_idx] = SYNC_BUFFER_FULL;
b->actual_lengths[samples_idx] = num_samples;
if (b->buffer_seq) { COND_SIGNAL(&b->buf_ready);
seq = b->buffer_seq[samples_idx];
if (seq != b->expected_seq) {
const uint32_t distance = seq - b->expected_seq;
if (distance != 0 && distance <= b->reorder_limit) {
if (hold_out_of_order_buffer(b, seq, samples_idx,
num_samples)) {
release_now = false;
log_verbose("%s worker: buf[%u] held for reorder "
"(seq=%u expect=%u)\n",
worker2str(s), samples_idx, seq,
b->expected_seq);
} else {
log_warning("%s worker: RX reorder window full "
"(limit=%u). Forwarding buf[%u] "
"(seq=%u, expect=%u).\n",
worker2str(s), b->reorder_limit,
samples_idx, seq, b->expected_seq);
}
} else if (distance != 0) {
log_warning("%s worker: RX reorder distance %u exceeds "
"window %u. Forwarding buf[%u].\n",
worker2str(s), distance, b->reorder_limit,
samples_idx);
}
}
}
if (release_now) {
mark_buffer_ready(b, samples_idx, num_samples);
if (b->buffer_seq && seq == b->expected_seq) {
b->expected_seq++;
flush_reorder_entries(b);
}
log_verbose("%s worker: buf[%u] = full\n",
worker2str(s), samples_idx);
}
/* Update the state of the buffer being submitted next */ /* Update the state of the buffer being submitted next */
next_idx = b->prod_i; next_idx = b->prod_i;
b->status[next_idx] = SYNC_BUFFER_IN_FLIGHT; b->status[next_idx] = SYNC_BUFFER_IN_FLIGHT;
if (b->buffer_seq) {
b->buffer_seq[next_idx] = b->next_seq++;
}
next_buf = b->buffers[next_idx]; next_buf = b->buffers[next_idx];
/* Advance to the next buffer for the next callback */ /* Advance to the next buffer for the next callback */
b->prod_i = (next_idx + 1) % b->num_buffers; b->prod_i = (next_idx + 1) % b->num_buffers;
if (release_now) { log_verbose("%s worker: buf[%u] = full, buf[%u] = in_flight\n",
log_verbose("%s worker: buf[%u] now in_flight\n", worker2str(s), samples_idx, next_idx);
worker2str(s), next_idx);
}
} else { } else {
if (b->reorder_len > 0) { /* TODO propagate back the RX Overrun to the sync_rx() caller */
/* We're holding buffers to restore order. Skip submitting a log_debug("RX overrun @ buffer %u\r\n", samples_idx);
* new transfer this time to avoid overwriting held data. */
next_buf = BLADERF_STREAM_NO_DATA;
log_verbose("%s worker: delaying submission while reorder "
"queue drains\n", worker2str(s));
} else {
/* TODO propagate back the RX Overrun to the sync_rx() caller */
log_debug("RX overrun @ buffer %u\r\n", samples_idx);
next_buf = samples; next_buf = samples;
b->resubmit_count = s->stream_config.num_xfers - 1; b->resubmit_count = s->stream_config.num_xfers - 1;
}
} }
} else { } else {
/* We're still recovering from an overrun at this point. Just /* We're still recovering from an overrun at this point. Just
@ -551,9 +428,6 @@ static sync_worker_state exec_idle_state(struct bladerf_sync *s)
s->buf_mgmt.status[i] = SYNC_BUFFER_EMPTY; s->buf_mgmt.status[i] = SYNC_BUFFER_EMPTY;
} }
} }
sync_reset_sequence_tracking(&s->buf_mgmt,
s->stream_config.num_xfers);
} }
MUTEX_UNLOCK(&s->buf_mgmt.lock); MUTEX_UNLOCK(&s->buf_mgmt.lock);

View file

@ -10,7 +10,6 @@ add_subdirectory(test_ctrl)
add_subdirectory(test_freq_hop) add_subdirectory(test_freq_hop)
add_subdirectory(test_fw_check) add_subdirectory(test_fw_check)
add_subdirectory(test_open) add_subdirectory(test_open)
add_subdirectory(test_oversample)
add_subdirectory(test_packet) add_subdirectory(test_packet)
add_subdirectory(test_parse) add_subdirectory(test_parse)
add_subdirectory(test_peripheral_timing) add_subdirectory(test_peripheral_timing)

View file

@ -1,15 +1,14 @@
contourpy>=1.1.1 contourpy==1.3.1
cycler==0.12.1 cycler==0.12.1
fonttools==4.56.0 fonttools==4.56.0
kiwisolver>=1.4.7 kiwisolver==1.4.8
matplotlib>=3.7.5 matplotlib==3.10.0
numpy>=1.24.4 numpy==2.2.3
packaging==24.2 packaging==24.2
pandas>=2.0.3 pandas==2.2.3
pillow>=10.4.0 pillow==11.1.0
pyparsing>=3.1.4 pyparsing==3.2.1
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
pytz==2025.1 pytz==2025.1
scipy>=1.8.0
six==1.17.0 six==1.17.0
tzdata==2025.1 tzdata==2025.1

View file

@ -5,7 +5,7 @@ kiwisolver==1.4.5
matplotlib==3.8.0 matplotlib==3.8.0
numpy==1.26.0 numpy==1.26.0
packaging==23.2 packaging==23.2
Pillow==11.3.0 Pillow==10.0.1
pyparsing==3.1.1 pyparsing==3.1.1
python-dateutil==2.8.2 python-dateutil==2.8.2
six==1.16.0 six==1.16.0

View file

@ -1,37 +0,0 @@
cmake_minimum_required(VERSION 3.10...3.27)
project(libbladeRF_test_oversample C)
set(INCLUDES
${libbladeRF_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/../common/include
${CMAKE_CURRENT_SOURCE_DIR}/../../../common/include
${CMAKE_CURRENT_SOURCE_DIR}/../../../common/include/windows
)
if(MSVC)
set(INCLUDES ${INCLUDES} ${MSVC_C99_INCLUDES})
endif()
set(SRC
src/main.c
../common/src/test_common.c
)
if(MSVC OR WIN32)
set(SRC ${SRC}
${CMAKE_CURRENT_SOURCE_DIR}/../../../common/src/windows/getopt_long.c
${CMAKE_CURRENT_SOURCE_DIR}/../../../common/src/windows/clock_gettime.c
)
endif()
include_directories(${INCLUDES})
add_executable(${PROJECT_NAME} ${SRC})
target_link_libraries(${PROJECT_NAME}
libbladerf_shared
)
# Only link with the math library on non-Windows platforms
if(NOT WIN32 AND NOT MSVC)
target_link_libraries(${PROJECT_NAME} m)
endif()
add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME})

View file

@ -1,167 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <getopt.h>
#if !defined(_WIN32)
#include <unistd.h> // for getopt
#else
#include <windows.h>
#include <clock_gettime.h>
#endif
#include <libbladeRF.h>
#include <math.h>
#include "log.h"
#include "test_common.h"
#include "libbladeRF.h"
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_RESET "\x1b[0m"
/* Use CLOCK_MONOTONIC as a portable alternative that works on FreeBSD and Linux */
#if defined(_WIN32)
/* On Windows, only CLOCK_REALTIME is supported by our implementation */
#define TIMING_CLOCK CLOCK_REALTIME
#else
#ifndef CLOCK_MONOTONIC_PRECISE
#ifdef __FreeBSD__
/* FreeBSD defines CLOCK_MONOTONIC_PRECISE for higher precision */
#define TIMING_CLOCK CLOCK_MONOTONIC_PRECISE
#elif defined(CLOCK_MONOTONIC_RAW) && defined(__linux__)
/* Linux has CLOCK_MONOTONIC_RAW which is not affected by NTP adjustments */
#define TIMING_CLOCK CLOCK_MONOTONIC_RAW
#else
/* Fallback to CLOCK_MONOTONIC which is POSIX standard */
#define TIMING_CLOCK CLOCK_MONOTONIC
#endif
#else
#define TIMING_CLOCK CLOCK_MONOTONIC_PRECISE
#endif
#endif
void print_usage(const char *prog_name)
{
printf("Usage: %s [-h] [-v] [-c channel]\n", prog_name);
printf(" -h Show this help message\n");
printf(" -v Enable verbose logging\n");
printf(" -c Channel to test (1 or 2, default: 1)\n");
}
int main(int argc, char *argv[])
{
int status = 0;
struct bladerf *dev = NULL;
int opt;
int opt_ind = 0;
bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_INFO);
bladerf_frequency freq = 915e6;
bladerf_sample_rate samp_rate = 122.88e6;
bladerf_channel channel = BLADERF_CHANNEL_RX(0);
const unsigned int num_buffers = 64;
const unsigned int buffer_size = 16384;
const unsigned int num_transfers = 16;
const unsigned int timeout_ms = 1000;
struct timespec start, end;
struct option longopts[] = {
{"help", no_argument, 0, 'h'},
{"verbose", no_argument, 0, 'v'},
{"channel", required_argument, 0, 'c'},
{0, 0, 0, 0}
};
while ((opt = getopt_long(argc, argv, "hvc:", longopts, &opt_ind)) != -1) {
switch (opt) {
case 'h':
print_usage(argv[0]);
return EXIT_SUCCESS;
case 'v':
bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_VERBOSE);
break;
case 'c': {
int ch_selected= atoi(optarg);
if (ch_selected != 1 && ch_selected != 2) {
fprintf(stderr, "Error: Channel must be 1 or 2\n");
print_usage(argv[0]);
return EXIT_FAILURE;
}
channel = BLADERF_CHANNEL_RX(ch_selected - 1);
break;
}
default:
print_usage(argv[0]);
return EXIT_FAILURE;
}
}
const unsigned int num_samples = 1*samp_rate; // 1s of samples
int8_t *samples = (int8_t *)malloc(num_samples * sizeof(int16_t));
double power = 0;
CHECK_STATUS(bladerf_open(&dev, NULL));
CHECK_STATUS(bladerf_set_frequency(dev, channel, freq));
printf("Channel: %d\n", (channel == BLADERF_CHANNEL_RX(0)) ? 1 : 2);
printf("Frequency: %.2f MHz\n", freq / 1e6);
CHECK_STATUS(bladerf_enable_feature(dev, BLADERF_FEATURE_OVERSAMPLE, true));
CHECK_STATUS(bladerf_sync_config(dev, BLADERF_RX_X1, BLADERF_FORMAT_SC8_Q7,
num_buffers, buffer_size, num_transfers, timeout_ms));
// Not only sets the sample rate, but also applies the oversample register configuration
CHECK_STATUS(bladerf_set_sample_rate(dev, channel, samp_rate, NULL));
printf("Sample Rate: %.2f MHz\n", samp_rate / 1e6);
// Collect samples
CHECK_STATUS(bladerf_enable_module(dev, channel, true));
CHECK_STATUS(clock_gettime(TIMING_CLOCK, &start));
CHECK_STATUS(bladerf_sync_rx(dev, samples, num_samples, NULL, 0));
CHECK_STATUS(clock_gettime(TIMING_CLOCK, &end));
CHECK_STATUS(bladerf_enable_module(dev, channel, false));
const double expected_sync_time = (double)num_samples / samp_rate;
double time_taken = (end.tv_sec - start.tv_sec) + (end.tv_nsec - start.tv_nsec) * 1e-9;
printf("Time taken: %f seconds\n", time_taken);
printf("Expected sync time: %f seconds\n", expected_sync_time);
printf("%% error: %f\n", (time_taken - expected_sync_time) / expected_sync_time * 100);
// Throw error if sync time is outside 5% error margin
double error_percent = (time_taken - expected_sync_time) / expected_sync_time * 100;
double tolerance = 1.0; // 1% tolerance
if (error_percent > tolerance || error_percent < -tolerance) {
printf(ANSI_COLOR_RED "Sync time error: %f%%" ANSI_COLOR_RESET "\n", error_percent);
status = 1;
}
// Calculate power
for (size_t i = 0; i < num_samples/2; i++) {
double i_sample = (double)samples[2*i];
double q_sample = (double)samples[2*i+1];
power += i_sample * i_sample + q_sample * q_sample;
}
double avg_power = power / num_samples;
const double MAX_POWER = (INT8_MAX * INT8_MAX) + (INT8_MAX * INT8_MAX);
double dBFS = 20 * log10(avg_power/MAX_POWER);
printf(ANSI_COLOR_GREEN "Avg Power: %fdBFS" ANSI_COLOR_RESET "\n" , dBFS);
size_t num_zero_samples = 0;
for (size_t i = 0; i < num_samples; i++) {
if (samples[i] == 0 && samples[i+1] == 0) {
num_zero_samples++;
}
}
if (num_zero_samples > num_samples * 0.40) {
printf(ANSI_COLOR_RED "%0.2f%% of samples are stuck at 0\n" ANSI_COLOR_RESET, num_zero_samples * 100.0 / num_samples);
status = 1;
}
error:
if (dev) bladerf_close(dev);
return (status == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

View file

@ -72,16 +72,6 @@ add_custom_target(test_synthesis
DEPENDS ${PROJECT_NAME} DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_target(prep_ci
COMMAND ${PROJECT_NAME} --gtest_filter="dump_tests.disk" --gtest_output="json"
DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_target(bitfile_ci
COMMAND ${PROJECT_NAME} --gtest_filter="bitfile_ci/synth_ci*" --gtest_output="json":bitfile_ci.json
DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}
libbladerf_shared libbladerf_shared

View file

@ -36,11 +36,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <fstream>
#define TEST_LIBBLADERF libbladeRF #define TEST_LIBBLADERF libbladeRF
#define TEST_XB200 xb200 #define TEST_XB200 xb200
#define BLADERF_QUARTUS_CI_DIR "bladeRF/hdl/quartus/"
#define BLADERF_QUARTUS_DIR "../../hdl/quartus/" #define BLADERF_QUARTUS_DIR "../../hdl/quartus/"
#define BLADERF_MODELSIM_DIR "../../hdl/fpga/platforms/bladerf-micro/modelsim/" #define BLADERF_MODELSIM_DIR "../../hdl/fpga/platforms/bladerf-micro/modelsim/"
#define NIOS2SHELL "~/intelFPGA_lite/20.1/nios2eds/nios2_command_shell.sh" #define NIOS2SHELL "~/intelFPGA_lite/20.1/nios2eds/nios2_command_shell.sh"
@ -476,20 +474,6 @@ const std::vector<std::tuple<std::string, std::string, std::string>> fpga_images
{"bladeRF-micro", "wlan", "A9"} {"bladeRF-micro", "wlan", "A9"}
}; };
const std::vector<std::tuple<std::string, std::string, std::string>> fpga_images_ci = {
{"bladeRF", "hosted", "40"},
{"bladeRF", "hosted", "115"},
{"bladeRF", "fsk_bridge", "40"},
{"bladeRF", "fsk_bridge", "115"},
{"bladeRF", "qpsk_tx", "40"},
{"bladeRF", "qpsk_tx", "115"},
{"bladeRF-micro", "hosted", "A4"},
{"bladeRF-micro", "hosted", "A9"},
{"bladeRF-micro", "foxhunt", "A4"},
{"bladeRF-micro", "foxhunt", "A9"},
{"bladeRF-micro", "wlan", "A9"}
};
class synth: public ::testing::TestWithParam<std::tuple<std::string, std::string, std::string>> { class synth: public ::testing::TestWithParam<std::tuple<std::string, std::string, std::string>> {
char build_dir[PATH_MAX]; char build_dir[PATH_MAX];
void SetUp() override { void SetUp() override {
@ -522,8 +506,6 @@ class synth: public ::testing::TestWithParam<std::tuple<std::string, std::string
} }
}; };
class synth_ci : public synth {};
TEST_P(synth, synthesis) { TEST_P(synth, synthesis) {
std::string board = std::get<0>(GetParam()); std::string board = std::get<0>(GetParam());
std::string revision = std::get<1>(GetParam()); std::string revision = std::get<1>(GetParam());
@ -539,130 +521,27 @@ TEST_P(synth, synthesis) {
EXPECT_EQ(status, 0); EXPECT_EQ(status, 0);
} }
TEST_P(synth_ci, synthesis) {
std::string board = std::get<0>(GetParam());
std::string revision = std::get<1>(GetParam());
std::string size = std::get<2>(GetParam());
std::string command = NIOS2SHELL;
command += " ./build_bladerf.sh ";
command += " -b " + board;
command += " -r " + revision;
command += " -s " + size;
command += " -D ";
status = std::system(command.c_str());
EXPECT_EQ(status, 0);
}
/**
* @brief Convert a tuple into a build output folder used by build_bladerf.sh
* This is only valid when -o is passed to build_bladerf.sh
*
* @param[in] row The tuple
*
* @return The output folder name
*/
std::string build_folder_name(const std::tuple<std::string, std::string, std::string>& row) {
std::string name = absl::StrCat(
std::get<1>(row), "x",
std::get<2>(row));
absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_');
return name;
}
/**
* @brief Convert a tuple into a test name.
*
* @param[in] row The tuple
*
* @return The name of the test
*/
std::string test_name(const std::tuple<std::string, std::string, std::string>& row) {
std::string name = absl::StrCat(
std::get<0>(row), "_",
std::get<1>(row), "_",
std::get<2>(row));
absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_');
return name;
}
/**
* @brief Convert a TestParamInfo into a test name.
*
* @param[in] row The TestParamInfo
*
* @return The name of the test
*/
std::string info_test_name(const testing::TestParamInfo<synth::ParamType>& info) {
return test_name(info.param);
}
INSTANTIATE_TEST_SUITE_P(synthesize_defaults, synth, INSTANTIATE_TEST_SUITE_P(synthesize_defaults, synth,
::testing::ValuesIn(fpga_images_defaults), ::testing::ValuesIn(fpga_images_defaults),
info_test_name); [](const testing::TestParamInfo<synth::ParamType>& info) {
std::string name = absl::StrCat(
std::get<0>(info.param), "_",
std::get<1>(info.param), "_",
std::get<2>(info.param));
absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_');
return name;
});
INSTANTIATE_TEST_SUITE_P(DISABLED_synthesize_all, synth, INSTANTIATE_TEST_SUITE_P(DISABLED_synthesize_all, synth,
::testing::ValuesIn(fpga_images_all), ::testing::ValuesIn(fpga_images_all),
info_test_name); [](const testing::TestParamInfo<synth::ParamType>& info) {
std::string name = absl::StrCat(
INSTANTIATE_TEST_SUITE_P(bitfile_ci, synth_ci, std::get<0>(info.param), "_",
::testing::ValuesIn(fpga_images_ci), std::get<1>(info.param), "_",
info_test_name); std::get<2>(info.param));
absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_');
/** return name;
* @brief Not a test, writes out an artifacts file to disk so CI can pick it up. });
*
*/
TEST(dump_tests, disk) {
std::vector<std::string> out;
for(const auto& row : fpga_images_ci) {
out.push_back(test_name(row));
out.push_back(std::string(BLADERF_QUARTUS_CI_DIR) + build_folder_name(row));
}
std::ofstream file("ci_artifacts.txt"); // Create an ofstream object and open "ci_artifacts.txt" for writing
if (!file.is_open()) {
std::cerr << "Failed to open file." << std::endl;
FAIL();
}
file << "[";
for(size_t i = 0; i < out.size(); ++i) {
file << "\"" << out[i] << "\"";
if (i < out.size() - 1) {
file << ", ";
}
}
file << "]" << std::endl;
file.close();
}
/**
* @brief Convert argc/argv into a vector, and filter out gtest_ args
*
* @param[in] argc The number of arguments
* @param[in] argv The arguments
*
* @return A vector of arguments
*/
std::vector<std::string> filter_gtest_args(int argc, char** argv) {
std::vector<std::string> args;
for (int i = 0; i < argc; ++i) {
std::string arg(argv[i]);
// skip all arguments that are for gtest
if (i == 0 || arg.find("--gtest_") != 0) {
std::cout << "adding " << arg << "\n";
args.push_back(arg);
}
}
return args;
}
#define OPTARG "v:h" #define OPTARG "v:h"
static struct option long_options[] = { static struct option long_options[] = {
@ -677,17 +556,8 @@ int main(int argc, char** argv) {
int opt_ind = 0; int opt_ind = 0;
bladerf_log_level log_level; bladerf_log_level log_level;
auto filtered = filter_gtest_args(argc, argv);
const int argc_filt = filtered.size();
const char* argv_filt[argc_filt];
// copy back into a c-style array for getopt_long
for (size_t i = 0; i < filtered.size(); ++i) {
argv_filt[i] = filtered[i].c_str();
}
while (opt != -1) { while (opt != -1) {
opt = getopt_long(argc_filt, const_cast<char* const*>(argv_filt), OPTARG, long_options, &opt_ind); opt = getopt_long(argc, argv, OPTARG, long_options, &opt_ind);
switch (opt) { switch (opt) {
case 'v': case 'v':
@ -709,7 +579,6 @@ int main(int argc, char** argv) {
printf(" Example filters: \"libbladeRF*\", \"hdl*\", \"synthesis*\"\n"); printf(" Example filters: \"libbladeRF*\", \"hdl*\", \"synthesis*\"\n");
printf(" --gtest_also_run_disabled_tests Run only the tests matching the filter.\n"); printf(" --gtest_also_run_disabled_tests Run only the tests matching the filter.\n");
printf(" --gtest_output=\"json\" Generates JSON report of test run.\n"); printf(" --gtest_output=\"json\" Generates JSON report of test run.\n");
printf(" --gtest_help View gtest specific help menu.\n");
printf("\n"); printf("\n");
return EXIT_SUCCESS; return EXIT_SUCCESS;

View file

@ -81,7 +81,7 @@ add_executable(libbladeRF_test_txrx_hwloop ${SRC})
target_link_libraries(libbladeRF_test_txrx_hwloop ${LIBS}) target_link_libraries(libbladeRF_test_txrx_hwloop ${LIBS})
configure_file(scripts/test_txrx_hwloop.py configure_file(scripts/test_txrx_hwloop.py
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libbladeRF_test_txrx_hwloop.py ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BIN_NAME}.py
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ
COPYONLY) COPYONLY)

View file

@ -26,10 +26,8 @@ import matplotlib.pyplot as plt
import numpy as np import numpy as np
import scipy.stats as st import scipy.stats as st
import os import os
import sys
import argparse import argparse
import subprocess import subprocess
import json
def close_figure(event): def close_figure(event):
if event.key == 'escape': if event.key == 'escape':
@ -73,8 +71,6 @@ devarg_tx = ""
devarg_rx = "" devarg_rx = ""
samp_rate_arg = "" samp_rate_arg = ""
devarg_verbosity = "" devarg_verbosity = ""
devarg_tx_gain = ""
devarg_rx_gain = ""
print_stats = False print_stats = False
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
@ -88,21 +84,11 @@ parser.add_argument('-sr', '--samprate', type=int, help='Sample Rate (Hz)', defa
parser.add_argument('-p', '--period', type=int, help='period length (in samples)') parser.add_argument('-p', '--period', type=int, help='period length (in samples)')
parser.add_argument('-i', '--iterations', type=int, help='number of pulses') parser.add_argument('-i', '--iterations', type=int, help='number of pulses')
parser.add_argument('-t', '--threshold', type=int, help='edge count power threshold') parser.add_argument('-t', '--threshold', type=int, help='edge count power threshold')
parser.add_argument('-ts', '--threshold-spread', type=int, help='threshold spread (rising = threshold + spread, falling = threshold - spread)', default=int(1e6))
parser.add_argument('-tx', '--txdev', type=str, help='TX device string') parser.add_argument('-tx', '--txdev', type=str, help='TX device string')
parser.add_argument('-rx', '--rxdev', type=str, help='RX device string') parser.add_argument('-rx', '--rxdev', type=str, help='RX device string')
parser.add_argument('-g', '--tx-gain', type=int, help='TX gain (unified gain mode)')
parser.add_argument('-G', '--rx-gain', type=int, help='RX gain (unified gain mode, MGC)')
parser.add_argument('-v', '--verbosity', type=str, help='bladeRF log level', default="info") parser.add_argument('-v', '--verbosity', type=str, help='bladeRF log level', default="info")
parser.add_argument('-c', '--compare', help='RF loopback compare', action="store_true", default=False) parser.add_argument('-c', '--compare', help='RF loopback compare', action="store_true", default=False)
parser.add_argument('-l', '--loop', help='Enable RX device', action="store_false", default=True, dest="just_tx")
parser.add_argument('-s', '--stats', help='print edge statistics', action="store_true", default=False) parser.add_argument('-s', '--stats', help='print edge statistics', action="store_true", default=False)
parser.add_argument('-o', '--output', type=str, help='output stats to the specified filename, in JSON format')
parser.add_argument('-ng', '--no-gui', help='No GUI', action="store_false", default=True, dest="gui")
parser.add_argument('-e', '--enforce', type=float, help='enforce results and exit code appropriately (in samples, lower is more strict, less than or equal)', default=False)
parser.add_argument('--save-png', type=str, help='Path to save the plot output as a PNG file. When set the gui will not be shown. Use --png-width and --png-height to control size.')
parser.add_argument('--png-width', type=int, help='Width of saved PNG in pixels (default: 800 for single plot, 1600 for dual plot)', default=None)
parser.add_argument('--png-height', type=int, help='Height of saved PNG in pixels (default: 600)', default=None)
args = parser.parse_args() args = parser.parse_args()
@ -128,20 +114,8 @@ if args.stats:
print_stats = True print_stats = True
if args.samprate: if args.samprate:
samp_rate_arg = f"-s {args.samprate}" samp_rate_arg = f"-s {args.samprate}"
if args.tx_gain:
devarg_tx_gain = f"-g {args.tx_gain}"
if args.rx_gain:
devarg_rx_gain = f"-G {args.rx_gain}"
plot_count = 2 if not args.just_tx and args.compare else 1 threshold_spread = 1e6
first_label = "TX" if args.just_tx else "RX"
first_file = "compare.csv" if args.just_tx else "samples.csv"
jout = {}
jout["settings"] = {}
jout["settings"]["python_args"] = " ".join(sys.argv[1:])
test_pass = True
threshold_spread = args.threshold_spread
rising_threshold = threshold + threshold_spread rising_threshold = threshold + threshold_spread
falling_threshold = threshold - threshold_spread falling_threshold = threshold - threshold_spread
@ -152,68 +126,39 @@ binary_file = 'libbladeRF_test_txrx_hwloop'
output_dir = os.path.dirname(os.path.abspath(__file__)) output_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(output_dir) os.chdir(output_dir)
proc = subprocess.run(f"./{binary_file} --fill {fill} --burst {burst} --period {period} " proc = subprocess.run(f"./{binary_file} --fill {fill} --burst {burst} --period {period} "
f"--iterations {iterations} {devarg_tx} {devarg_rx} {args.compare * '-c'} {(not args.just_tx) * '-l'} " f"--iterations {iterations} -l {devarg_tx} {devarg_rx} {args.compare * '-c'} "
f"{devarg_verbosity} {samp_rate_arg} {devarg_tx_gain} {devarg_rx_gain}", shell=True) f"{devarg_verbosity} {samp_rate_arg}", shell=True)
if proc.returncode != 0: if proc.returncode != 0:
print("Failed to run hwloop binary") print("Failed to run hwloop binary")
exit(1) exit(1)
if not args.compare and args.just_tx:
print("No output written for python to analyze. Please use a combination of -c and -l to display something useful.")
exit(1)
################################################################ ################################################################
# TX or RX Data Analysis # RX Data Analysis
################################################################ ################################################################
data = pd.read_csv(first_file) data = pd.read_csv('samples.csv')
I = data['I'].to_numpy() I = data['I'].to_numpy()
Q = data['Q'].to_numpy() Q = data['Q'].to_numpy()
power = I**2 + Q**2 power = I**2 + Q**2
num_samples = range(len(I)) num_samples = range(len(I))
# Calculate figure size for custom PNG dimensions or GUI display if args.compare == True:
if args.save_png: fig, ((ax1, ax3),
# For PNG output, calculate figsize based on desired pixel dimensions (ax2, ax4),
default_width = 1600 if plot_count == 2 else 800 (ax5, ax6)) = plt.subplots(nrows=3, ncols=2, figsize=(16, 6))
default_height = 600
png_width = args.png_width if args.png_width else default_width
png_height = args.png_height if args.png_height else default_height
# Use DPI of 100 to make calculations simple (pixels = inches * 100)
dpi = 100
figsize = (png_width/dpi, png_height/dpi)
else: else:
# For GUI display, use the original sizes fig, (ax1, ax2, ax5) = plt.subplots(nrows=3, ncols=1, figsize=(8, 6))
figsize = (16, 6) if plot_count == 2 else (8, 6)
dpi = 100
if args.gui or args.save_png: ax1.set_title('RX Board IQ')
if plot_count == 2: ax1.plot(I, label='I')
fig, ((ax1, ax3), ax1.plot(Q, label='Q')
(ax2, ax4), ax2.set_title('RX Board Power')
(ax5, ax6)) = plt.subplots(nrows=3, ncols=2, figsize=figsize, dpi=dpi) ax2.plot(power, label='Power', color='red')
else:
fig, (ax1, ax2, ax5) = plt.subplots(nrows=3, ncols=1, figsize=figsize, dpi=dpi)
ax1.set_title('%s Board IQ' % first_label)
ax1.plot(I, label='I')
ax1.plot(Q, label='Q')
ax2.set_title('%s Board Power' % first_label)
ax2.plot(power, label='Power', color='red')
# Add threshold lines
ax2.axhline(y=rising_threshold, color='green', linestyle='--', alpha=0.7, label=f'Rising Threshold ({rising_threshold:.0f})')
ax2.axhline(y=falling_threshold, color='orange', linestyle='--', alpha=0.7, label=f'Falling Threshold ({falling_threshold:.0f})')
positive_edge, negative_edge = edge_detector(power, rising_threshold, falling_threshold, cycles_to_debounce) positive_edge, negative_edge = edge_detector(power, rising_threshold, falling_threshold, cycles_to_debounce)
pos_edge_indexes = np.argwhere(positive_edge).flatten() pos_edge_indexes = np.argwhere(positive_edge).flatten()
for i in pos_edge_indexes:
if args.gui or args.save_png: ax2.plot(i, rising_threshold, 'g^', markersize=6)
for i in pos_edge_indexes:
ax2.plot(i, rising_threshold, 'g^', markersize=6)
time_delta_pos_edges = np.diff(pos_edge_indexes) time_delta_pos_edges = np.diff(pos_edge_indexes)
avg = np.average(time_delta_pos_edges) avg = np.average(time_delta_pos_edges)
@ -227,10 +172,8 @@ if print_stats:
print(f" Edge Count: {len(pos_edge_indexes)}") print(f" Edge Count: {len(pos_edge_indexes)}")
neg_edge_indexes = np.argwhere(negative_edge).flatten() neg_edge_indexes = np.argwhere(negative_edge).flatten()
for i in neg_edge_indexes:
if args.gui or args.save_png: ax2.plot(i, falling_threshold, 'yv', markersize=6)
for i in neg_edge_indexes:
ax2.plot(i, falling_threshold, 'yv', markersize=6)
time_delta_neg_edges = np.diff(neg_edge_indexes) time_delta_neg_edges = np.diff(neg_edge_indexes)
avg = np.average(time_delta_neg_edges) avg = np.average(time_delta_neg_edges)
@ -243,8 +186,8 @@ if print_stats:
print(f" Std.Dev: {dev:.2f}") print(f" Std.Dev: {dev:.2f}")
print(f" Edge Count: {len(neg_edge_indexes)}") print(f" Edge Count: {len(neg_edge_indexes)}")
print("\n%s Board" % first_label) print("\nRX Board")
print(f" Measured Timestamp: {(avg):.3f} samples, Error: {(avg-period):.3f} samples") print(f" Predicted Timestamp: {(avg):.3f} samples, Error: {(avg-period):.3f} samples")
try: try:
fill_expected = int(burst*fill/100) fill_expected = int(burst*fill/100)
@ -254,59 +197,38 @@ try:
dev = np.std(fill) dev = np.std(fill)
fill_vs_burst = 100 * avg/burst fill_vs_burst = 100 * avg/burst
except ValueError as err: except ValueError as err:
print(f"[Error] %s Board: Edge count imbalanced.\n{err}" % first_label) print(f"[Error] RX Board: Edge count imbalanced.\n{err}")
print(err) print(err)
fill = None fill = None
fill_vs_burst = -1 fill_vs_burst = -1
ax5.set_title("Fill Error")
ax5.set_xlabel("Error (samples)")
fill_error = fill - fill_expected
ax5.hist(fill_error, alpha=0.7, bins=30, color=('skyblue'))
if args.gui or args.save_png: print(f" Predicted Fill: {fill_vs_burst:.2f}%, Error: {(avg-fill_expected):.2f} samples")
ax5.set_title("Fill Error")
ax5.set_xlabel("Error (samples)")
fill_error = fill - fill_expected
ax5.hist(fill_error, alpha=0.7, bins=30, color=('skyblue'))
error_samples=(avg-fill_expected)
jout[first_label] = {
"measured_fill_percent": fill_vs_burst,
"error_samples": error_samples}
print(f" Measured Fill: {fill_vs_burst:.2f}%, Error: {error_samples:.2f} samples")
if args.enforce:
local_pass = abs(error_samples) <= args.enforce
test_pass = False if not local_pass else test_pass
print(f" Test threshold: {args.enforce}, Result: %s" % ("PASS" if local_pass else "FAIL"))
################################################################ ################################################################
# TX Loopback Compare # TX Loopback Compare
################################################################ ################################################################
if plot_count == 2: if args.compare == True:
data = pd.read_csv('compare.csv') data = pd.read_csv('compare.csv')
I = data['I'].to_numpy() I = data['I'].to_numpy()
Q = data['Q'].to_numpy() Q = data['Q'].to_numpy()
power = I**2 + Q**2 power = I**2 + Q**2
num_samples = range(len(I)) num_samples = range(len(I))
if args.gui or args.save_png: ax3.set_title('TX Loopback Compare IQ')
ax3.set_title('TX Loopback Compare IQ') ax3.plot(I, label='I')
ax3.plot(I, label='I') ax3.plot(Q, label='Q')
ax3.plot(Q, label='Q') ax4.set_title('TX Loopback Compare Power')
ax4.set_title('TX Loopback Compare Power') ax4.plot(power, label='Power', color='red')
ax4.plot(power, label='Power', color='red')
# Add threshold lines
ax4.axhline(y=rising_threshold, color='green', linestyle='--', alpha=0.7, label=f'Rising Threshold ({rising_threshold:.0f})')
ax4.axhline(y=falling_threshold, color='orange', linestyle='--', alpha=0.7, label=f'Falling Threshold ({falling_threshold:.0f})')
positive_edge, negative_edge = edge_detector(power, rising_threshold, falling_threshold, cycles_to_debounce) positive_edge, negative_edge = edge_detector(power, rising_threshold, falling_threshold, cycles_to_debounce)
pos_edge_indexes = np.argwhere(positive_edge).flatten() pos_edge_indexes = np.argwhere(positive_edge).flatten()
for i in pos_edge_indexes:
if args.gui or args.save_png: ax4.plot(i, rising_threshold, 'g^', markersize=6)
for i in pos_edge_indexes:
ax4.plot(i, rising_threshold, 'g^', markersize=6)
time_delta_pos_edges = np.diff(pos_edge_indexes) time_delta_pos_edges = np.diff(pos_edge_indexes)
avg = np.average(time_delta_pos_edges) avg = np.average(time_delta_pos_edges)
@ -320,10 +242,8 @@ if plot_count == 2:
print(f" Edge Count: {len(pos_edge_indexes)}") print(f" Edge Count: {len(pos_edge_indexes)}")
neg_edge_indexes = np.argwhere(negative_edge).flatten() neg_edge_indexes = np.argwhere(negative_edge).flatten()
for i in neg_edge_indexes:
if args.gui or args.save_png: ax4.plot(i, falling_threshold, 'yv', markersize=6)
for i in neg_edge_indexes:
ax4.plot(i, falling_threshold, 'yv', markersize=6)
time_delta_neg_edges = np.diff(neg_edge_indexes) time_delta_neg_edges = np.diff(neg_edge_indexes)
avg = np.average(time_delta_neg_edges) avg = np.average(time_delta_neg_edges)
@ -336,10 +256,8 @@ if plot_count == 2:
print(f" Std.Dev: {dev:.2f}") print(f" Std.Dev: {dev:.2f}")
print(f" Edge Count: {len(neg_edge_indexes)}") print(f" Edge Count: {len(neg_edge_indexes)}")
jout["TX"] = {"measured_timestamp": avg}
print("\nTX Board: loopback compare") print("\nTX Board: loopback compare")
print(f" Measured Timestamp: {(avg):.3f} samples") print(f" Predicted Timestamp: {(avg):.3f} samples")
try: try:
fill_compare = neg_edge_indexes - pos_edge_indexes fill_compare = neg_edge_indexes - pos_edge_indexes
@ -353,41 +271,20 @@ if plot_count == 2:
fill_compare = None fill_compare = None
fill_vs_burst_compare = -1 fill_vs_burst_compare = -1
error_samples=(avg-fill_expected) print(f" Predicted Fill: {fill_vs_burst_compare:.2f}%, Error: {(avg-fill_expected):.2f} samples")
jout["TX"]["measured_fill_percent"] = fill_vs_burst_compare
jout["TX"]["error_samples"] = error_samples
print(f" Measured Fill: {fill_vs_burst_compare:.2f}%, Error: {error_samples:.2f} samples")
if args.enforce:
local_pass = error_samples <= args.enforce
test_pass = False if not local_pass else test_pass
print(f" Test threshold: {args.enforce}, Result: %s" % ("PASS" if local_pass else "FAIL"))
print("") print("")
print(f"Fill Delta:") print(f"Fill Delta:")
fill_delta_avg = 100*(np.average(fill_compare) - np.average(fill))/burst fill_delta_avg = 100*(np.average(fill_compare) - np.average(fill))/burst
jout["TX"]["fill_delta_average"] = fill_delta_avg
print(f" Average: {fill_delta_avg:.2f}%") print(f" Average: {fill_delta_avg:.2f}%")
if args.gui or args.save_png: ax6.set_title("Fill Error")
ax6.set_title("Fill Error") ax6.set_xlabel("Error (samples)")
ax6.set_xlabel("Error (samples)") fill_error = fill_compare - fill_expected
fill_error = fill_compare - fill_expected ax6.hist(fill_error, alpha=0.7, bins=30, color=('skyblue'))
ax6.hist(fill_error, alpha=0.7, bins=30, color=('skyblue'))
# File Ops
if args.enforce:
jout["exit"] = 1 if not test_pass else 0
if args.output:
with open(args.output, 'w') as json_file:
json.dump(jout, json_file, indent=4)
# early exit, as the rest of the script is GUI stuff
if not args.gui and not args.save_png:
exit(1 if not test_pass else 0)
# General plot assignments # General plot assignments
if plot_count == 2: if args.compare == True:
axis = (ax1, ax2, ax3, ax4) axis = (ax1, ax2, ax3, ax4)
axis_iq = (ax1, ax3) axis_iq = (ax1, ax3)
axis_power = (ax2, ax4) axis_power = (ax2, ax4)
@ -406,13 +303,6 @@ for ax in axis_iq:
ax.set_ylim(bottom=-2500, top=2500) ax.set_ylim(bottom=-2500, top=2500)
fig.subplots_adjust(hspace=1) fig.subplots_adjust(hspace=1)
print(f"\nPress [Escape] to close figure")
if args.save_png: fig.canvas.mpl_connect('key_press_event', close_figure)
plt.savefig(args.save_png, dpi=dpi) plt.show()
print(f"Plot saved to {args.save_png} ({png_width}x{png_height} pixels)")
elif args.gui:
print(f"\nPress [Escape] to close figure")
fig.canvas.mpl_connect('key_press_event', close_figure)
plt.show()
exit(1 if not test_pass else 0)

View file

@ -64,12 +64,6 @@ static void init_app_params(struct app_params *p, struct test_case *tc) {
tc->init_ts_delay = 200000; tc->init_ts_delay = 200000;
tc->gain = 30; tc->gain = 30;
// Initialize gain parameters
tc->tx_gain_set = false;
tc->rx_gain_set = false;
tc->tx_gain = 0;
tc->rx_gain = 0;
memset(p, 0, sizeof(p[0])); memset(p, 0, sizeof(p[0]));
p->samplerate = 1e6; p->samplerate = 1e6;
p->prng_seed = 1; p->prng_seed = 1;
@ -170,24 +164,6 @@ int main(int argc, char *argv[]) {
} }
break; break;
case 'g':
test.tx_gain = str2uint(optarg, 0, UINT_MAX, &ok);
if (!ok) {
fprintf(stderr, "Invalid TX gain: %s\n", optarg);
return -1;
}
test.tx_gain_set = true;
break;
case 'G':
test.rx_gain = str2uint(optarg, 0, UINT_MAX, &ok);
if (!ok) {
fprintf(stderr, "Invalid RX gain: %s\n", optarg);
return -1;
}
test.rx_gain_set = true;
break;
case 'v': case 'v':
log_level = str2loglevel(optarg, &ok); log_level = str2loglevel(optarg, &ok);
if (!ok) { if (!ok) {
@ -293,18 +269,6 @@ int main(int argc, char *argv[]) {
buf += 2 * to_send; buf += 2 * to_send;
} }
// Wait for this burst to complete before scheduling the next one
if (status == 0 && i < (test.iterations - 1)) {
uint64_t burst_end_timestamp = meta.timestamp + test.burst_len;
int wait_status = wait_for_timestamp(dev_tx, BLADERF_MODULE_TX,
burst_end_timestamp, 1000);
if (wait_status != 0) {
fprintf(stderr, "Failed to wait for burst %u to complete: %s\n",
(unsigned int)i, bladerf_strerror(wait_status));
status = first_error(status, wait_status);
}
}
meta.timestamp += test.period; meta.timestamp += test.period;
} }

View file

@ -34,14 +34,7 @@ struct test_case {
unsigned int fill; unsigned int fill;
unsigned int init_ts_delay; unsigned int init_ts_delay;
bladerf_frequency frequency; bladerf_frequency frequency;
bladerf_gain gain; /* Legacy gain field - kept for compatibility */ bladerf_gain gain;
/* Separate TX and RX gain support */
bool tx_gain_set;
bool rx_gain_set;
bladerf_gain tx_gain;
bladerf_gain rx_gain;
char* dev_tx_str; char* dev_tx_str;
char* dev_rx_str; char* dev_rx_str;
bool just_tx; bool just_tx;
@ -58,8 +51,6 @@ static struct option const long_options[] = {
{ "fill", required_argument, NULL, 'f' }, { "fill", required_argument, NULL, 'f' },
{ "loop", no_argument, NULL, 'l' }, { "loop", no_argument, NULL, 'l' },
{ "iterations", required_argument, NULL, 'i' }, { "iterations", required_argument, NULL, 'i' },
{ "tx-gain", required_argument, NULL, 'g' },
{ "rx-gain", required_argument, NULL, 'G' },
{ "verbosity", required_argument, NULL, 'v' }, { "verbosity", required_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' }, { "help", no_argument, NULL, 'h' },
{ NULL, 0, NULL, 0 }, { NULL, 0, NULL, 0 },
@ -104,8 +95,6 @@ static void usage()
printf(" -p, --period <value> Length between timestamps in samples\n"); printf(" -p, --period <value> Length between timestamps in samples\n");
printf(" -f, --fill <value> %% of burst to fill with [2000,2000]\n"); printf(" -f, --fill <value> %% of burst to fill with [2000,2000]\n");
printf(" others set to [0,0]\n"); printf(" others set to [0,0]\n");
printf(" -g, --tx-gain <value> Set TX gain (unified gain mode)\n");
printf(" -G, --rx-gain <value> Set RX gain (unified gain mode, MGC)\n");
printf(" -l, --loop Enables RX device for TX capture\n"); printf(" -l, --loop Enables RX device for TX capture\n");
printf(" -c, --compare Outputs CSV RX capture from TX device\n"); printf(" -c, --compare Outputs CSV RX capture from TX device\n");
printf(" for multi-device fill comparison\n"); printf(" for multi-device fill comparison\n");
@ -119,7 +108,7 @@ static void usage()
printf("\n"); printf("\n");
printf("Loop setup:\n"); printf("Loop setup:\n");
printf(" A bladeRF device will TX into the other bladeRF device's\n" printf(" A bladeRF device will TX into the other bladeRF device’s\n"
" RX port over SMA and a 20dB attenuator. See the following\n" " RX port over SMA and a 20dB attenuator. See the following\n"
" tested config.\n\n"); " tested config.\n\n");
printf(" bladeRF micro 2.0 TX -> 20dB att. -> SMA -> RX bladeRF x115\n"); printf(" bladeRF micro 2.0 TX -> 20dB att. -> SMA -> RX bladeRF x115\n");
@ -166,27 +155,6 @@ int module_config_enable(struct bladerf *dev, bladerf_channel ch,
return status; return status;
} }
// Set gain if specified
if (BLADERF_CHANNEL_IS_TX(ch) && test->tx_gain_set) {
status = bladerf_set_gain(dev, ch, test->tx_gain);
if (status != 0) {
fprintf(stderr, "Failed to set TX gain: %s\n", bladerf_strerror(status));
return status;
}
} else if (!BLADERF_CHANNEL_IS_TX(ch) && test->rx_gain_set) {
status = bladerf_set_gain_mode(dev, ch, BLADERF_GAIN_MGC);
if (status != 0) {
fprintf(stderr, "Failed to set RX gain mode: %s\n", bladerf_strerror(status));
return status;
}
status = bladerf_set_gain(dev, ch, test->rx_gain);
if (status != 0) {
fprintf(stderr, "Failed to set RX gain: %s\n", bladerf_strerror(status));
return status;
}
}
status = bladerf_sync_config(dev, ch, sample_format, status = bladerf_sync_config(dev, ch, sample_format,
params->num_buffers, params->buf_size, params->num_buffers, params->buf_size,
params->num_xfers, params->timeout_ms); params->num_xfers, params->timeout_ms);
@ -226,7 +194,6 @@ int init_devices(struct bladerf** dev_tx, struct bladerf** dev_rx, struct app_pa
/** RX init */ /** RX init */
if (tc->just_tx == false && tc->compare == true) { if (tc->just_tx == false && tc->compare == true) {
// -l -c
printf("Mode: TX -> RX (+RF loopback)\n"); printf("Mode: TX -> RX (+RF loopback)\n");
printf(" +---------------+ +---------------+\n"); printf(" +---------------+ +---------------+\n");
printf(" | TX Device TX|---┬-->|RX RX Device |\n"); printf(" | TX Device TX|---┬-->|RX RX Device |\n");
@ -234,7 +201,6 @@ int init_devices(struct bladerf** dev_tx, struct bladerf** dev_rx, struct app_pa
printf(" | RX|<--┘ | |\n"); printf(" | RX|<--┘ | |\n");
printf(" +---------------+ +---------------+\n"); printf(" +---------------+ +---------------+\n");
} else if (tc->just_tx == true && tc->compare == true) { } else if (tc->just_tx == true && tc->compare == true) {
// -c
printf("Mode: TX -> TX\n"); printf("Mode: TX -> TX\n");
printf(" +---------------+ +---------------+\n"); printf(" +---------------+ +---------------+\n");
printf(" | TX Device TX|---┬ |RX RX Device |\n"); printf(" | TX Device TX|---┬ |RX RX Device |\n");
@ -242,15 +208,13 @@ int init_devices(struct bladerf** dev_tx, struct bladerf** dev_rx, struct app_pa
printf(" | RX|<--┘ | |\n"); printf(" | RX|<--┘ | |\n");
printf(" +---------------+ +---------------+\n"); printf(" +---------------+ +---------------+\n");
} else if (tc->just_tx == false && tc->compare == false) { } else if (tc->just_tx == false && tc->compare == false) {
// -l
printf("Mode: TX -> RX\n"); printf("Mode: TX -> RX\n");
printf(" +---------------+ +---------------+\n"); printf(" +---------------+ +---------------+\n");
printf(" | TX Device TX|------>|RX RX Device |\n"); printf(" | TX Device TX|------>|RX RX Device |\n");
printf(" | | | |\n"); printf(" | | | |\n");
printf(" | RX| | |\n"); printf(" | RX| | |\n");
printf(" +---------------+ +---------------+\n"); printf(" +---------------+ +---------------+\n");
} else {// tc->just_tx == true && tc->compare == false } else {
// defaults, no args
printf("Mode: TX Only\n"); printf("Mode: TX Only\n");
printf(" +---------------+ v +---------------+\n"); printf(" +---------------+ v +---------------+\n");
printf(" | TX Device TX|---┘ |RX RX Device |\n"); printf(" | TX Device TX|---┘ |RX RX Device |\n");
@ -284,9 +248,7 @@ int init_devices(struct bladerf** dev_tx, struct bladerf** dev_rx, struct app_pa
return -1; return -1;
} }
// Use new RX gain CLI argument if set status = bladerf_set_gain(*dev_tx, BLADERF_MODULE_RX, tc->gain);
bladerf_gain compare_gain = tc->rx_gain_set ? tc->rx_gain : tc->gain;
status = bladerf_set_gain(*dev_tx, BLADERF_MODULE_RX, compare_gain);
if (status != 0) { if (status != 0) {
fprintf(stderr, "Failed to set gain loopback compare RX gain: %s\n", bladerf_strerror(status)); fprintf(stderr, "Failed to set gain loopback compare RX gain: %s\n", bladerf_strerror(status));
return -1; return -1;

View file

@ -23,11 +23,14 @@
# This image is a cleaned version of the current working directory. # This image is a cleaned version of the current working directory.
# It is used to speed up the copy/clean process for later builds. # It is used to speed up the copy/clean process for later builds.
FROM alpine AS first FROM ubuntu AS first
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
RUN apk add --no-cache git RUN apt-get update \
&& apt-get install -y \
git \
&& apt-get clean
COPY . /root/bladeRF COPY . /root/bladeRF
ENV work="/root/bladeRF/hdl/quartus/work" ENV work="/root/bladeRF/hdl/quartus/work"

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
FROM archlinux:latest FROM archlinux/base
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2" LABEL version="0.0.2"

16
host/misc/docker/build.bash Executable file → Normal file
View file

@ -38,12 +38,8 @@ make_jobs_clangscan=4
# assuming the script is 3 levels down (host/misc/docker) # assuming the script is 3 levels down (host/misc/docker)
dfdir=$(dirname "${0}") dfdir=$(dirname "${0}")
dfdir=$(cd "${dfdir}" && pwd) # Convert to absolute path
basedir=${dfdir}/../../.. basedir=${dfdir}/../../..
# Always cd to the root. This script is a lot more reliable when we do this
cd $basedir
# globals # globals
success="" success=""
failure="" failure=""
@ -175,28 +171,18 @@ main () {
echo "RESULT:SUCCESS:${success}" echo "RESULT:SUCCESS:${success}"
echo "RESULT:FAILED:${failure}" echo "RESULT:FAILED:${failure}"
# this if structure is important, script was exiting 1 when it should be passing. bad version: [ -n "${failure}" ] && exit 1 [ -n "${failure}" ] && exit 1
if [ -n "${failure}" ]; then
exit 1
fi
} }
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
# We have an argument, so just build those images... # We have an argument, so just build those images...
base_only=true
for rootname in "$*"; do for rootname in "$*"; do
if [ "${rootname}" == "_base" ]; then if [ "${rootname}" == "_base" ]; then
do_base do_base
continue continue
fi fi
rels="${rels} ${rootname}" rels="${rels} ${rootname}"
base_only=false
done done
# If we only processed _base targets, exit successfully
if [ "$base_only" = true ] && [ -z "${rels}" ]; then
exit 0
fi
else else
# No argument, so build everything # No argument, so build everything
cd ${basedir} cd ${basedir}

View file

@ -0,0 +1,75 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM centos:7
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.3"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="CentOS"
LABEL com.nuand.ci.distribution.version="7"
# Install things
RUN yum groupinstall -y "Development Tools" \
&& yum install -y \
clang \
cmake \
doxygen \
help2man \
libedit \
libedit-devel \
libusbx \
libusbx-devel \
pandoc \
wget \
&& yum clean all \
&& rm -rf /var/cache/yum \
&& echo "/usr/local/lib" > /etc/ld.so.conf.d/locallib.conf \
&& echo "/usr/local/lib64" >> /etc/ld.so.conf.d/locallib.conf
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -21,14 +21,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
FROM ubuntu:noble FROM ubuntu:bionic
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2" LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project" LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu" LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="noble" LABEL com.nuand.ci.distribution.codename="bionic"
LABEL com.nuand.ci.distribution.version="24.04" LABEL com.nuand.ci.distribution.version="18.04"
# Install things # Install things
RUN apt-get update \ RUN apt-get update \
@ -39,9 +39,7 @@ RUN apt-get update \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl4-openssl-dev \ libtecla-dev \
libedit-dev \
libncurses5-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
pandoc \ pandoc \
pkg-config \ pkg-config \
@ -60,5 +58,5 @@ ARG parallel=1
RUN cd /root/bladeRF/host \ RUN cd /root/bladeRF/host \
&& mkdir -p build \ && mkdir -p build \
&& cd build \ && cd build \
&& scan-build cmake -DBUILD_DOCUMENTATION=ON ../ \ && cmake -DBUILD_DOCUMENTATION=ON -DCMAKE_C_COMPILER=/usr/share/clang/scan-build-6.0/libexec/ccc-analyzer ../ \
&& scan-build -analyze-headers -maxloop 100 -o ./report make -j${parallel} && /usr/share/clang/scan-build-6.0/bin/scan-build -analyze-headers -maxloop 100 -o ./report make -j${parallel}

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -21,34 +21,30 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
FROM rockylinux:8-minimal FROM i386/debian:jessie
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2" LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project" LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Rocky Linux" LABEL com.nuand.ci.distribution.name="Debian"
LABEL com.nuand.ci.distribution.codename="8" LABEL com.nuand.ci.distribution.codename="jessie-i386"
LABEL com.nuand.ci.distribution.version="8" LABEL com.nuand.ci.distribution.version="8"
# Install dnf first, then everything else # Install things
RUN microdnf install -y dnf \ RUN apt-get update \
&& dnf update -y \ && apt-get install -y \
&& dnf install -y epel-release \ build-essential \
&& dnf config-manager --set-enabled powertools \
&& dnf groupinstall -y "Development Tools" \
&& dnf install -y \
clang \ clang \
cmake \ cmake \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl-devel \ libtecla-dev \
libedit-devel \ libusb-1.0-0-dev \
ncurses-devel \
libusb1-devel \
pandoc \ pandoc \
pkg-config \
usbutils \ usbutils \
&& dnf clean all && apt-get clean
# Copy in our build context # Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM debian:jessie
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Debian"
LABEL com.nuand.ci.distribution.codename="jessie"
LABEL com.nuand.ci.distribution.version="8"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/debian:stretch
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Debian"
LABEL com.nuand.ci.distribution.codename="stretch-i386"
LABEL com.nuand.ci.distribution.version="9"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM debian:stretch
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Debian"
LABEL com.nuand.ci.distribution.codename="stretch"
LABEL com.nuand.ci.distribution.version="9"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -24,14 +24,14 @@
FROM fedora:latest FROM fedora:latest
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.4" LABEL version="0.0.3"
LABEL description="CI build environment for the bladeRF project" LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Fedora" LABEL com.nuand.ci.distribution.name="Fedora"
LABEL com.nuand.ci.distribution.version="latest" LABEL com.nuand.ci.distribution.version="latest"
# Install things # Install things
RUN dnf install -y @development-tools \ RUN yum groupinstall -y "Development Tools" \
&& dnf install -y \ && yum install -y \
clang \ clang \
cmake \ cmake \
doxygen \ doxygen \
@ -41,13 +41,10 @@ RUN dnf install -y @development-tools \
libedit-devel \ libedit-devel \
libusbx \ libusbx \
libusbx-devel \ libusbx-devel \
ncurses-devel \
curl-devel \
awk \
pandoc \ pandoc \
wget \ wget \
&& dnf clean all \ && yum clean all \
&& rm -rf /var/cache/dnf \ && rm -rf /var/cache/yum \
&& echo "/usr/local/lib" > /etc/ld.so.conf.d/locallib.conf \ && echo "/usr/local/lib" > /etc/ld.so.conf.d/locallib.conf \
&& echo "/usr/local/lib64" >> /etc/ld.so.conf.d/locallib.conf && echo "/usr/local/lib64" >> /etc/ld.so.conf.d/locallib.conf
@ -72,8 +69,8 @@ RUN cd /root/bladeRF/ \
-DCMAKE_BUILD_TYPE=${buildtype} \ -DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \ -DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \ -DENABLE_HOST_BUILD=ON \
-DTEST_REGRESSION=ON \ -DTAGGED_RELEASE=${taggedrelease} \
-DTAGGED_RELEASE=${taggedrelease} ../ \ ../ \
&& make -j${parallel} \ && make -j${parallel} \
&& make install \ && make install \
&& ldconfig && ldconfig

0
host/misc/docker/freshen.bash Executable file → Normal file
View file

View file

@ -1,81 +0,0 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2025 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM mageia:latest
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Mageia Linux"
# Install development tools and required packages using urpmi (Mageia's package manager)
RUN urpmi.update -a \
&& urpmi --auto \
task-c-devel \
task-c++-devel \
clang \
cmake \
doxygen \
git \
help2man \
lib64curl-devel \
lib64edit-devel \
lib64ncurses-devel \
lib64usb1.0-devel \
usbutils \
make \
gcc \
gcc-c++ \
&& urpme --auto-orphans
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTEST_REGRESSION=ON \
-DTAGGED_RELEASE=${taggedrelease} \
-DCURSES_INCLUDE_PATH=/usr/include \
-DCURSES_CURSES_LIBRARY=/usr/lib64/libcurses.so \
-DCURSES_NCURSES_LIBRARY=/usr/lib64/libncurses.so \
../ \
&& make -j${parallel} \
&& make install \
&& echo "/usr/local/lib64" > /etc/ld.so.conf.d/bladerf.conf \
&& ldconfig

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -35,15 +35,12 @@ RUN zypper --non-interactive install \
cmake \ cmake \
doxygen \ doxygen \
gcc \ gcc \
gcc-c++ \
git \ git \
help2man \ help2man \
libcurl-devel \
libedit \ libedit \
libedit-devel \ libedit-devel \
libusb \ libusb \
libusb-devel \ libusb-devel \
ncurses-devel \
pandoc \ pandoc \
wget wget

0
host/misc/docker/parallel.bash Executable file → Normal file
View file

View file

@ -1,80 +0,0 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2025 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM rockylinux:9-minimal
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Rocky Linux"
LABEL com.nuand.ci.distribution.codename="9"
LABEL com.nuand.ci.distribution.version="9"
# Install dnf first, then everything else
RUN microdnf install -y dnf \
&& dnf update -y \
&& dnf install -y epel-release \
&& dnf groupinstall -y "Development Tools" \
&& dnf config-manager --set-enabled crb \
&& dnf install -y \
clang \
cmake \
doxygen \
git \
help2man \
libcurl-devel \
libedit-devel \
ncurses-devel \
libusb1-devel \
pandoc \
usbutils \
&& dnf clean all
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTEST_REGRESSION=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& echo "/usr/local/lib64" > /etc/ld.so.conf.d/bladerf.conf \
&& ldconfig

0
host/misc/docker/test.bash Executable file → Normal file
View file

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2018-2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -21,16 +21,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
FROM ubuntu:noble FROM i386/ubuntu:bionic
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2" LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project" LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu" LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="noble" LABEL com.nuand.ci.distribution.codename="bionic-i386"
LABEL com.nuand.ci.distribution.version="24.04" LABEL com.nuand.ci.distribution.version="18.04"
ENV DEBIAN_FRONTEND=noninteractive
# Install things # Install things
RUN apt-get update \ RUN apt-get update \
@ -41,9 +39,7 @@ RUN apt-get update \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl4-openssl-dev \ libtecla-dev \
libedit-dev \
libncurses5-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
pandoc \ pandoc \
pkg-config \ pkg-config \
@ -71,7 +67,6 @@ RUN cd /root/bladeRF/ \
-DCMAKE_BUILD_TYPE=${buildtype} \ -DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \ -DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \ -DENABLE_HOST_BUILD=ON \
-DTEST_REGRESSION=ON \
-DTAGGED_RELEASE=${taggedrelease} \ -DTAGGED_RELEASE=${taggedrelease} \
../ \ ../ \
&& make -j${parallel} \ && make -j${parallel} \

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2018-2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -21,16 +21,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
FROM ubuntu:jammy FROM ubuntu:bionic
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2" LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project" LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu" LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="jammy" LABEL com.nuand.ci.distribution.codename="bionic"
LABEL com.nuand.ci.distribution.version="22.04" LABEL com.nuand.ci.distribution.version="18.04"
ENV DEBIAN_FRONTEND=noninteractive
# Install things # Install things
RUN apt-get update \ RUN apt-get update \
@ -41,9 +39,7 @@ RUN apt-get update \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl4-openssl-dev \ libtecla-dev \
libedit-dev \
libncurses5-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
pandoc \ pandoc \
pkg-config \ pkg-config \
@ -71,7 +67,6 @@ RUN cd /root/bladeRF/ \
-DCMAKE_BUILD_TYPE=${buildtype} \ -DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \ -DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \ -DENABLE_HOST_BUILD=ON \
-DTEST_REGRESSION=ON \
-DTAGGED_RELEASE=${taggedrelease} \ -DTAGGED_RELEASE=${taggedrelease} \
../ \ ../ \
&& make -j${parallel} \ && make -j${parallel} \

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2018-2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -21,16 +21,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
FROM ubuntu:latest FROM i386/ubuntu:cosmic
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>" LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2" LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project" LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu" LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="latest" LABEL com.nuand.ci.distribution.codename="cosmic-i386"
LABEL com.nuand.ci.distribution.version="latest" LABEL com.nuand.ci.distribution.version="18.10"
ENV DEBIAN_FRONTEND=noninteractive
# Install things # Install things
RUN apt-get update \ RUN apt-get update \
@ -41,9 +39,7 @@ RUN apt-get update \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl4-openssl-dev \ libtecla-dev \
libedit-dev \
libncurses5-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
pandoc \ pandoc \
pkg-config \ pkg-config \
@ -71,7 +67,6 @@ RUN cd /root/bladeRF/ \
-DCMAKE_BUILD_TYPE=${buildtype} \ -DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \ -DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \ -DENABLE_HOST_BUILD=ON \
-DTEST_REGRESSION=ON \
-DTAGGED_RELEASE=${taggedrelease} \ -DTAGGED_RELEASE=${taggedrelease} \
../ \ ../ \
&& make -j${parallel} \ && make -j${parallel} \

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM ubuntu:cosmic
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="cosmic"
LABEL com.nuand.ci.distribution.version="18.10"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2019 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/ubuntu:disco
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="disco-i386"
LABEL com.nuand.ci.distribution.version="19.04"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2019 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM ubuntu:disco
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="disco"
LABEL com.nuand.ci.distribution.version="19.04"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/ubuntu:eoan
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="eoan"
LABEL com.nuand.ci.distribution.version="19.10-i386"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM ubuntu:eoan
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="eoan"
LABEL com.nuand.ci.distribution.version="19.10"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/ubuntu:focal
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="focal"
LABEL com.nuand.ci.distribution.version="20.10-i386"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -30,8 +30,6 @@ LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="focal" LABEL com.nuand.ci.distribution.codename="focal"
LABEL com.nuand.ci.distribution.version="20.10" LABEL com.nuand.ci.distribution.version="20.10"
ENV DEBIAN_FRONTEND=noninteractive
# Install things # Install things
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y \ && apt-get install -y \
@ -41,9 +39,7 @@ RUN apt-get update \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl4-openssl-dev \ libtecla-dev \
libedit-dev \
libncurses5-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
pandoc \ pandoc \
pkg-config \ pkg-config \

View file

@ -1,112 +0,0 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2025 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/ubuntu:latest
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="latest"
LABEL com.nuand.ci.distribution.version="latest-i386"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
doxygen \
git \
help2man \
libcurl4-openssl-dev \
libedit-dev \
libncurses5-dev \
libncurses-dev \
libncursesw5-dev \
libssl-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
wget \
&& apt-get clean
# Custom compile cmake because the version provided in the i386 repos is too old for our cmake scripts
RUN version=3.28 \
&& build=1 \
&& mkdir ~/temp \
&& cd ~/temp \
&& wget -nv https://cmake.org/files/v$version/cmake-$version.$build.tar.gz \
&& tar -xzf cmake-$version.$build.tar.gz \
&& cd cmake-$version.$build/ \
&& ./bootstrap --parallel=$(nproc) --no-debugger \
&& make -j$(nproc) \
&& make install
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
RUN ${compiler} --version
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig
# Do an i686 build
RUN cd /root/bladeRF/ \
&& rm -rf build \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DCMAKE_C_FLAGS="-march=i686 -mtune=i686" \
-DCMAKE_CXX_FLAGS="-march=i686 -mtune=i686" \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/ubuntu:trusty
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="trusty-i386"
LABEL com.nuand.ci.distribution.version="14.04"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM ubuntu:trusty
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="trusty"
LABEL com.nuand.ci.distribution.version="14.04"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -0,0 +1,74 @@
# This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF
#
# Copyright (c) 2018 Nuand LLC.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
FROM i386/ubuntu:xenial
LABEL maintainer="Nuand LLC <bladeRF@nuand.com>"
LABEL version="0.0.2"
LABEL description="CI build environment for the bladeRF project"
LABEL com.nuand.ci.distribution.name="Ubuntu"
LABEL com.nuand.ci.distribution.codename="xenial-i386"
LABEL com.nuand.ci.distribution.version="16.04"
# Install things
RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
cmake \
doxygen \
git \
help2man \
libtecla-dev \
libusb-1.0-0-dev \
pandoc \
pkg-config \
usbutils \
&& apt-get clean
# Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
WORKDIR /root/bladeRF
# Build arguments
ARG compiler=gcc
ARG buildtype=Release
ARG taggedrelease=NO
ARG parallel=1
# Do the build!
RUN cd /root/bladeRF/ \
&& mkdir -p build \
&& cd build \
&& cmake \
-DBUILD_DOCUMENTATION=ON \
-DCMAKE_C_COMPILER=${compiler} \
-DCMAKE_BUILD_TYPE=${buildtype} \
-DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \
../ \
&& make -j${parallel} \
&& make install \
&& ldconfig

View file

@ -1,7 +1,7 @@
# This file is part of the bladeRF project: # This file is part of the bladeRF project:
# http://www.github.com/nuand/bladeRF # http://www.github.com/nuand/bladeRF
# #
# Copyright (c) 2025 Nuand LLC. # Copyright (c) 2018 Nuand LLC.
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -39,31 +39,13 @@ RUN apt-get update \
doxygen \ doxygen \
git \ git \
help2man \ help2man \
libcurl4-openssl-dev \ libtecla-dev \
libedit-dev \
libncurses5-dev \
libncurses-dev \
libncursesw5-dev \
libssl-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
pandoc \ pandoc \
pkg-config \ pkg-config \
usbutils \ usbutils \
wget \
&& apt-get clean && apt-get clean
# Custom compile cmake because the version provided in the xenial repos is too old for our cmake scripts
RUN version=3.28 \
&& build=1 \
&& mkdir ~/temp \
&& cd ~/temp \
&& wget -nv https://cmake.org/files/v$version/cmake-$version.$build.tar.gz \
&& tar -xzf cmake-$version.$build.tar.gz \
&& cd cmake-$version.$build/ \
&& ./bootstrap --parallel=$(nproc) --no-debugger \
&& make -j$(nproc) \
&& make install
# Copy in our build context # Copy in our build context
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config
@ -75,8 +57,6 @@ ARG buildtype=Release
ARG taggedrelease=NO ARG taggedrelease=NO
ARG parallel=1 ARG parallel=1
RUN ${compiler} --version
# Do the build! # Do the build!
RUN cd /root/bladeRF/ \ RUN cd /root/bladeRF/ \
&& mkdir -p build \ && mkdir -p build \
@ -88,8 +68,7 @@ RUN cd /root/bladeRF/ \
-DENABLE_FX3_BUILD=OFF \ -DENABLE_FX3_BUILD=OFF \
-DENABLE_HOST_BUILD=ON \ -DENABLE_HOST_BUILD=ON \
-DTAGGED_RELEASE=${taggedrelease} \ -DTAGGED_RELEASE=${taggedrelease} \
../ \ ../ \
&& make -j${parallel} \ && make -j${parallel} \
&& make install \ && make install \
&& ldconfig && ldconfig

View file

@ -1,36 +1,8 @@
cmake_minimum_required(VERSION 3.10...3.27) cmake_minimum_required(VERSION 3.10...3.27)
option(BUILD_BLADERF_FSK "Build bladeRF FSK" ON)
if(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bladeRF-fsk/c)
message(STATUS "bladeRF-fsk: Attempting to initialize missing submodule")
find_package(Git QUIET)
if(Git_FOUND)
execute_process(
COMMAND ${Git_EXECUTABLE} submodule init
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
execute_process(
COMMAND ${Git_EXECUTABLE} submodule update
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()
endif()
if(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bladeRF-fsk/c)
message(FATAL_ERROR "Directory ${CMAKE_CURRENT_SOURCE_DIR}/bladeRF-fsk was not found. "
"It appears that this submodule has not been properly "
"initialized. Please run 'git submodule init' and "
"'git submodule update', and then re-run cmake.")
endif()
add_subdirectory(bladeRF-cli) add_subdirectory(bladeRF-cli)
add_subdirectory(bladeRF-update) add_subdirectory(bladeRF-update)
if(NOT MSVC) if(NOT MSVC)
add_subdirectory(bladeRF-power) add_subdirectory(bladeRF-power)
if(BUILD_BLADERF_FSK) add_subdirectory(bladeRF-fsk/c)
add_subdirectory(bladeRF-fsk/c)
endif()
endif() endif()

View file

@ -5,17 +5,6 @@ For more detailed information, please see the git change log and issue tracker
hosted on GitHub: https://github.com/Nuand/bladeRF hosted on GitHub: https://github.com/Nuand/bladeRF
================================================================================ ================================================================================
v1.10.0 (2025-05-06)
--------------------------------
* Added sc16q11 packed format support
* Improved sample format tracking and replaced legacy bit_mode handling
* Migrated threading to unified libbladeRF thread macros
* Updated CMake minimum requirement to modernized syntax
* Fixed RX sample count overflow (issue #941)
* Return error code when no available devices detected (issue #844)
* Clarified K/M/G prefixes as powers of 1024 in documentation (issue #840)
* Updated documentation to reflect sample limit changes
v1.9.0 (2023-02-13) v1.9.0 (2023-02-13)
-------------------------------- --------------------------------
* Added 8-bit sample support for RX/TX, CSV and binary formats * Added 8-bit sample support for RX/TX, CSV and binary formats

View file

@ -6,7 +6,7 @@ project(bladeRF-cli C)
################################################################################ ################################################################################
set(VERSION_INFO_MAJOR 1) set(VERSION_INFO_MAJOR 1)
set(VERSION_INFO_MINOR 10) set(VERSION_INFO_MINOR 9)
set(VERSION_INFO_PATCH 0) set(VERSION_INFO_PATCH 0)
if(NOT DEFINED VERSION_INFO_EXTRA) if(NOT DEFINED VERSION_INFO_EXTRA)

View file

@ -20,11 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <histedit.h> #include <histedit.h>
#ifdef __FreeBSD__
#include <edit/readline/readline.h>
#else
#include <editline/readline.h> #include <editline/readline.h>
#endif
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include "input_impl.h" #include "input_impl.h"

@ -1 +1 @@
Subproject commit fb903684036217b9db9dcd6be8007548e12a377e Subproject commit b60b121377a5632cd48a03647028a0a45cff7d45

View file

@ -3,17 +3,6 @@ project(bladeRF-power LANGUAGES C)
set (CURSES_NEED_NCURSES TRUE) set (CURSES_NEED_NCURSES TRUE)
set (CURSES_NEED_WIDE TRUE) set (CURSES_NEED_WIDE TRUE)
if(APPLE)
if(EXISTS "/opt/homebrew/opt/ncurses")
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/ncurses")
elseif(EXISTS "/usr/local/opt/ncurses")
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/ncurses")
else()
message(WARNING "Homebrew ncurses not found. Install it if the build is failing: brew install ncurses")
endif()
endif()
find_package(Curses REQUIRED) find_package(Curses REQUIRED)
include_directories( include_directories(

View file

@ -94,7 +94,7 @@ int main(int argc, char *argv[])
case 't': case 't':
case 'r': case 'r':
if ((int)test.direction != DIRECTION_UNSET) { if (test.direction != DIRECTION_UNSET) {
fprintf(stderr, "Only one direction may be specified.\n"); fprintf(stderr, "Only one direction may be specified.\n");
test.direction = ask_direction(); test.direction = ask_direction();
break; break;
@ -145,7 +145,7 @@ int main(int argc, char *argv[])
CHECK(bladerf_get_devinfo(dev, &devinfo)); CHECK(bladerf_get_devinfo(dev, &devinfo));
printf("Device: %s\n", devinfo.serial); printf("Device: %s\n", devinfo.serial);
if ((int)test.direction == DIRECTION_UNSET) { if (test.direction == DIRECTION_UNSET) {
test.direction = ask_direction(); test.direction = ask_direction();
} }

View file

@ -1130,12 +1130,7 @@ void update_rbf_files(const UpdateInfo* update_info) {
if (file_exists(filepath)) { if (file_exists(filepath)) {
if (verify_file(filepath, latest_version->files[j].md5, latest_version->files[j].sha256, update_info)) { if (verify_file(filepath, latest_version->files[j].md5, latest_version->files[j].sha256, update_info)) {
rbf_up_to_date = true; rbf_up_to_date = true;
size_t copy_len = strlen(filepath); strncpy(existing_rbf_path, filepath, MAX_PATH_LENGTH - 1);
if (copy_len >= MAX_PATH_LENGTH) {
copy_len = MAX_PATH_LENGTH - 1;
}
memcpy(existing_rbf_path, filepath, copy_len);
existing_rbf_path[copy_len] = '\0';
printf("[+] Found up-to-date RBF at %s, skipping download\n", filepath); printf("[+] Found up-to-date RBF at %s, skipping download\n", filepath);
break; break;
} }
@ -1189,12 +1184,7 @@ void update_fw_files(const UpdateInfo* update_info) {
if (file_exists(filepath)) { if (file_exists(filepath)) {
if (verify_file(filepath, update_info->firmware.md5, update_info->firmware.sha256, update_info)) { if (verify_file(filepath, update_info->firmware.md5, update_info->firmware.sha256, update_info)) {
fw_up_to_date = true; fw_up_to_date = true;
size_t copy_len = strlen(filepath); strncpy(existing_fw_path, filepath, MAX_PATH_LENGTH - 1);
if (copy_len >= MAX_PATH_LENGTH) {
copy_len = MAX_PATH_LENGTH - 1;
}
memcpy(existing_fw_path, filepath, copy_len);
existing_fw_path[copy_len] = '\0';
printf("[+] Found up-to-date firmware at %s, skipping download\n", filepath); printf("[+] Found up-to-date firmware at %s, skipping download\n", filepath);
break; break;
} }

View file

@ -492,15 +492,6 @@ index 77ffa44..ff5d7c5 100644
/* Set the Enable State Machine (ENSM) mode. */ /* Set the Enable State Machine (ENSM) mode. */
int32_t ad9361_set_en_state_machine_mode (struct ad9361_rf_phy *phy, uint32_t mode); int32_t ad9361_set_en_state_machine_mode (struct ad9361_rf_phy *phy, uint32_t mode);
/* Get the Enable State Machine (ENSM) mode. */ /* Get the Enable State Machine (ENSM) mode. */
@@ -365,6 +381,8 @@
int32_t ad9361_set_rx_rf_gain (struct ad9361_rf_phy *phy, uint8_t ch, int32_t gain_db);
/* Get current receive RF gain for the selected channel. */
int32_t ad9361_get_rx_rf_gain (struct ad9361_rf_phy *phy, uint8_t ch, int32_t *gain_db);
+/* Get RFIC temperature */
+int32_t ad9361_get_temp(struct ad9361_rf_phy *phy);
/* Set the RX RF bandwidth. */
int32_t ad9361_set_rx_rf_bandwidth (struct ad9361_rf_phy *phy, uint32_t bandwidth_hz);
/* Get the RX RF bandwidth. */
diff --git a/ad9361/sw/ad9361_conv.c b/ad9361/sw/ad9361_conv.c diff --git a/ad9361/sw/ad9361_conv.c b/ad9361/sw/ad9361_conv.c
index b20cb71..0491f91 100644 index b20cb71..0491f91 100644
--- a/ad9361/sw/ad9361_conv.c --- a/ad9361/sw/ad9361_conv.c