diff --git a/.gitignore b/.gitignore index c060d006..3eb0b22f 100644 --- a/.gitignore +++ b/.gitignore @@ -57,8 +57,5 @@ host/misc/windows/scripts/work env/ venv/ ENV/ -__pycache__/ -*.py[cod] -*$py.class .vscode/ diff --git a/debian/bladerf-firmware-fx3.postinst b/debian/bladerf-firmware-fx3.postinst index 9a204660..26f2bf49 100644 --- a/debian/bladerf-firmware-fx3.postinst +++ b/debian/bladerf-firmware-fx3.postinst @@ -1,7 +1,7 @@ #!/bin/sh -e -UPSTREAM='https://www.nuand.com/fx3/bladeRF_fw_v2.6.0.img' -CHECKSUM='7cc51b4eedebf54dd01be83745d1c59f' +UPSTREAM='https://www.nuand.com/fx3/bladeRF_fw_v2.4.0.img' +CHECKSUM='337f570f2e3fdb26abde0f0765196d92' DATAFILE='/usr/share/Nuand/bladeRF/bladeRF_fw.img' DESCRIPT='firmware' MYNAMEIS='bladerf-firmware-fx3' diff --git a/debian/bladerf-fpga-hostedx115.postinst b/debian/bladerf-fpga-hostedx115.postinst index 9f473b9b..447c7e5f 100644 --- a/debian/bladerf-fpga-hostedx115.postinst +++ b/debian/bladerf-fpga-hostedx115.postinst @@ -1,7 +1,7 @@ #!/bin/sh -e -UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedx115.rbf' -CHECKSUM='a7f25be8abdab3835e734599eb846ea4' +UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedx115.rbf' +CHECKSUM='94ee5c7f68abe5c3392202246789fedd' DATAFILE='/usr/share/Nuand/bladeRF/hostedx115.rbf' DESCRIPT='FPGA bitstream' MYNAMEIS='bladerf-fpga-hostedx115' diff --git a/debian/bladerf-fpga-hostedx40.postinst b/debian/bladerf-fpga-hostedx40.postinst index d11baad6..1512dbda 100644 --- a/debian/bladerf-fpga-hostedx40.postinst +++ b/debian/bladerf-fpga-hostedx40.postinst @@ -1,7 +1,7 @@ #!/bin/sh -e -UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedx40.rbf' -CHECKSUM='f3d0e55aa4cae485df6d3c20004b7742' +UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedx40.rbf' +CHECKSUM='25f402b3734c9aa0d37db9531f93335c' DATAFILE='/usr/share/Nuand/bladeRF/hostedx40.rbf' DESCRIPT='FPGA bitstream' MYNAMEIS='bladerf-fpga-hostedx40' diff --git a/debian/bladerf-fpga-hostedxa4.postinst b/debian/bladerf-fpga-hostedxa4.postinst index 46845c2f..94a42bd2 100644 --- a/debian/bladerf-fpga-hostedxa4.postinst +++ b/debian/bladerf-fpga-hostedxa4.postinst @@ -1,7 +1,7 @@ #!/bin/sh -e -UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedxA4.rbf' -CHECKSUM='276a74b748d699a9fc348babd34af19c' +UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedxA4.rbf' +CHECKSUM='c24af70cf56b13123295125a22d5e921' DATAFILE='/usr/share/Nuand/bladeRF/hostedxA4.rbf' DESCRIPT='FPGA bitstream' MYNAMEIS='bladerf-fpga-hostedxa4' diff --git a/debian/bladerf-fpga-hostedxa5.postinst b/debian/bladerf-fpga-hostedxa5.postinst index 1ad7a1cd..86e1b43b 100644 --- a/debian/bladerf-fpga-hostedxa5.postinst +++ b/debian/bladerf-fpga-hostedxa5.postinst @@ -1,7 +1,7 @@ #!/bin/sh -e -UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedxA5.rbf' -CHECKSUM='be0909dc27b48a08c54db33675130f27' +UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedxA5.rbf' +CHECKSUM='ae6391cc3fd467bbb07868450612ce17' DATAFILE='/usr/share/Nuand/bladeRF/hostedxA5.rbf' DESCRIPT='FPGA bitstream' MYNAMEIS='bladerf-fpga-hostedxa5' diff --git a/debian/bladerf-fpga-hostedxa9.postinst b/debian/bladerf-fpga-hostedxa9.postinst index 50938bb6..25100b42 100644 --- a/debian/bladerf-fpga-hostedxa9.postinst +++ b/debian/bladerf-fpga-hostedxa9.postinst @@ -1,7 +1,7 @@ #!/bin/sh -e -UPSTREAM='https://www.nuand.com/fpga/v0.16.0/hostedxA9.rbf' -CHECKSUM='1ab3bc8bdcf16a5f0ddf3fcdbaa6556b' +UPSTREAM='https://www.nuand.com/fpga/v0.14.0/hostedxA9.rbf' +CHECKSUM='7dfe8c32f260d43a14b9583375a1a6eb' DATAFILE='/usr/share/Nuand/bladeRF/hostedxA9.rbf' DESCRIPT='FPGA bitstream' MYNAMEIS='bladerf-fpga-hostedxa9' diff --git a/debian/control b/debian/control index fc13d01a..75c93b81 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,8 @@ Source: bladerf Priority: optional Maintainer: Nuand LLC Build-Depends: debhelper (>=9), cmake (>= 2.8.5), pkg-config, doxygen, - libusb-1.0-0-dev (>= 1.0.12), libedit-dev, libncurses5-dev, - git, help2man, pandoc, libcurl4-openssl-dev + libusb-1.0-0-dev (>= 1.0.12), libtecla-dev | libtecla1-dev, libncurses5-dev, + git, help2man, pandoc Standards-Version: 4.1.4 Section: comm Homepage: https://www.nuand.com/bladeRF diff --git a/fpga_common/include/ad936x.h b/fpga_common/include/ad936x.h index 38d0ea9a..5fd43e73 100644 --- a/fpga_common/include/ad936x.h +++ b/fpga_common/include/ad936x.h @@ -29,8 +29,6 @@ #include #include -#include - /** * The purpose of this header file is to allow the use of libad9361 without * including all of the unnecessary defines, etc, used during compilation. @@ -48,6 +46,15 @@ * 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_GAIN_CORR 0x08F #define AD936X_REG_TX2_OUT_1_PHASE_CORR 0x090 @@ -91,6 +98,681 @@ #define AD936X_CNT(x) ((((x)-1) & 0x7) << 12) #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_B_BALANCED 1 #define AD936X_C_BALANCED 2 @@ -107,5 +789,70 @@ #define AD936X_TXA 0 #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_ diff --git a/fx3_firmware/CHANGELOG b/fx3_firmware/CHANGELOG index 50699054..e3185b3b 100644 --- a/fx3_firmware/CHANGELOG +++ b/fx3_firmware/CHANGELOG @@ -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 ================================================================================ -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) -------------------------------- * Bumped GPIF DMA buffer size to 8192 bytes diff --git a/fx3_firmware/CMakeLists.txt b/fx3_firmware/CMakeLists.txt index 278592d2..fcd98074 100644 --- a/fx3_firmware/CMakeLists.txt +++ b/fx3_firmware/CMakeLists.txt @@ -33,7 +33,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../host/cmake/modules) # Update these definitions when updating the firmware version set(VERSION_INFO_MAJOR 2) -set(VERSION_INFO_MINOR 6) +set(VERSION_INFO_MINOR 5) set(VERSION_INFO_PATCH 0) if(NOT DEFINED VERSION_INFO_EXTRA) diff --git a/hdl/CHANGELOG b/hdl/CHANGELOG index 6ecc518d..013661d7 100644 --- a/hdl/CHANGELOG +++ b/hdl/CHANGELOG @@ -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 ================================================================================ --------------------------------- -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) -------------------------------- diff --git a/hdl/fpga/platforms/bladerf-micro/software/bladeRF_nios/Makefile b/hdl/fpga/platforms/bladerf-micro/software/bladeRF_nios/Makefile index b25c273e..ac99213a 100644 --- a/hdl/fpga/platforms/bladerf-micro/software/bladeRF_nios/Makefile +++ b/hdl/fpga/platforms/bladerf-micro/software/bladeRF_nios/Makefile @@ -36,9 +36,7 @@ LIBAD936X_DIR := ../../../../fpga/ip/analogdevicesinc/no_OS INC_DIRS += $(LIBAD936X_BUILDDIR) \ ../$(LIBAD936X_DIR)/include \ - ../../../../../../host/common/include \ - ../../../../../../host/build/common/thirdparty/ad936x/ \ - ../../../../../../thirdparty/analogdevicesinc/no-OS_local/platform_bladerf2/ + ../../../../../../host/common/include LIB_DIRS += $(LIBAD936X_BUILDDIR) LDDEPS += $(LIBAD936X_BUILDDIR)/libad936x.a @@ -82,6 +80,3 @@ $(LIBAD936X_BUILDDIR)/Makefile: $(LIBAD936X_MAKE_DEP) $(LIBAD936X_BUILDDIR)/libad936x.a: $(LIBAD936X_BUILD_DEP) @$(ECHO) Info: Building libad936x @$(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 diff --git a/hdl/fpga/platforms/bladerf-micro/software/foxhunt/Makefile b/hdl/fpga/platforms/bladerf-micro/software/foxhunt/Makefile index 4b39a35f..cb8a9e85 100644 --- a/hdl/fpga/platforms/bladerf-micro/software/foxhunt/Makefile +++ b/hdl/fpga/platforms/bladerf-micro/software/foxhunt/Makefile @@ -38,8 +38,7 @@ LIBAD936X_DIR := ../../../../fpga/ip/analogdevicesinc/no_OS INC_DIRS += $(LIBAD936X_BUILDDIR) \ ../$(LIBAD936X_DIR)/include \ - ../../../../../../host/common/include \ - ../../../../../../thirdparty/analogdevicesinc/no-OS_local/platform_bladerf2/ + ../../../../../../host/common/include LIB_DIRS += $(LIBAD936X_BUILDDIR) LDDEPS += $(LIBAD936X_BUILDDIR)/libad936x.a diff --git a/hdl/quartus/build_bladerf.sh b/hdl/quartus/build_bladerf.sh index 09d52ff4..f6e7419e 100755 --- a/hdl/quartus/build_bladerf.sh +++ b/hdl/quartus/build_bladerf.sh @@ -3,41 +3,6 @@ # 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() { echo "Supported boards:" for i in ../fpga/platforms/*/build/platform.conf ; do @@ -80,7 +45,6 @@ function usage() echo " synth Synthesize the design" echo " full (default) Fit the design and create programming files" echo " -S Fitter seed setting (default: 1)" - echo " -D Output directory name won't contain the date" echo " -h Show this text" echo "" @@ -162,9 +126,8 @@ fi nios_rev="Tiny" flow="full" 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 c) clear_work_dir=1 @@ -208,10 +171,6 @@ while getopts ":cb:r:s:a:fn:l:S:DhH" opt; do seed=$OPTARG ;; - D) - omit_date=true - ;; - h) usage exit 0 @@ -233,31 +192,22 @@ if [ "$build_hosted" == "1" ]; then mkdir -p build_logs 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 read -r board size <<< "$config" - log_file="build_logs/$board-hosted-$size.log" - $0 -b "$board" -r hosted -s "$size" > "$log_file" 2>&1 & + echo "Starting build for $board hosted $size..." + $0 -b "$board" -r hosted -s "$size" > "build_logs/$board-hosted-$size.log" 2>&1 & build_pids+=($!) - echo " → $board $size (PID: ${build_pids[-1]})" 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 if ! wait "$pid"; then - failed=1 + echo "Build failed. Check build_logs directory for details." + exit 1 fi 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!" exit 0 fi @@ -525,11 +475,7 @@ if [[ ${flow} == "full" ]]; then BUILD_TIME_DONE=$(date -d"$BUILD_TIME_DONE" '+%F_%H.%M.%S') BUILD_NAME="$rev"x"$size" - if [ "$omit_date" = false ]; then - BUILD_OUTPUT_DIR="$BUILD_NAME"-"$BUILD_TIME_DONE" - else - BUILD_OUTPUT_DIR="$BUILD_NAME" - fi + BUILD_OUTPUT_DIR="$BUILD_NAME"-"$BUILD_TIME_DONE" RBF=$BUILD_NAME.rbf mkdir -p "$BUILD_OUTPUT_DIR" diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 69aded1c..f76cb32d 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -4,7 +4,6 @@ project(bladeRF C) ################################################################################ # Project configuration ################################################################################ -add_compile_definitions(NUAND_MODIFICATIONS=1) # All build output lands in this directory: set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output) diff --git a/host/common/include/host_config.h.in b/host/common/include/host_config.h.in index fc94a777..844946dd 100644 --- a/host/common/include/host_config.h.in +++ b/host/common/include/host_config.h.in @@ -316,9 +316,7 @@ /******************************************************************************* * Miscellaneous utility macros ******************************************************************************/ -#ifndef ARRAY_SIZE #define ARRAY_SIZE(n) (sizeof(n) / sizeof(n[0])) -#endif /** * GCC 7+ warns on implicit fallthroughs in switch statements diff --git a/host/common/include/osx/clock_gettime.h b/host/common/include/osx/clock_gettime.h index db4a0094..f2ee0cea 100644 --- a/host/common/include/osx/clock_gettime.h +++ b/host/common/include/osx/clock_gettime.h @@ -39,9 +39,7 @@ extern "C" { #endif // __MACH__ typedef int clockid_t; -#ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 -#endif int clock_gettime(clockid_t clk_id, struct timespec *tp); diff --git a/host/common/include/thread.h b/host/common/include/thread.h index 9f68ba6f..bc6f7d26 100644 --- a/host/common/include/thread.h +++ b/host/common/include/thread.h @@ -51,9 +51,7 @@ #include #include #include -#ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 -#endif #define THREAD pthread_t #define MUTEX pthread_mutex_t diff --git a/host/common/include/windows/clock_gettime.h b/host/common/include/windows/clock_gettime.h index d9ccd932..f720a4db 100644 --- a/host/common/include/windows/clock_gettime.h +++ b/host/common/include/windows/clock_gettime.h @@ -36,9 +36,7 @@ extern "C" { #endif typedef int clockid_t; -#ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 -#endif int clock_gettime(clockid_t clk_id, struct timespec *tp); diff --git a/host/libraries/libbladeRF/CHANGELOG b/host/libraries/libbladeRF/CHANGELOG index 13cec6ad..6b841dee 100644 --- a/host/libraries/libbladeRF/CHANGELOG +++ b/host/libraries/libbladeRF/CHANGELOG @@ -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 ================================================================================ -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) -------------------------------- diff --git a/host/libraries/libbladeRF/doc/examples/freq_range_sweep.c b/host/libraries/libbladeRF/doc/examples/freq_range_sweep.c index 5f4675d5..f969ce6f 100644 --- a/host/libraries/libbladeRF/doc/examples/freq_range_sweep.c +++ b/host/libraries/libbladeRF/doc/examples/freq_range_sweep.c @@ -2,7 +2,6 @@ #include #include #include -#include #define FREQ_HOP_SPACING (bladerf_frequency)40e6 #define ITERATIONS 10000 @@ -79,16 +78,16 @@ int main(int argc, char *argv[]) for (i = 0; i < num_frequencies; i++) { status = bladerf_set_frequency(dev, ch, frequencies[i]); 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)); return status; } 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]); 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)); return status; } diff --git a/host/libraries/libbladeRF/src/bladerf.c b/host/libraries/libbladeRF/src/bladerf.c index d68595f4..02df2b58 100644 --- a/host/libraries/libbladeRF/src/bladerf.c +++ b/host/libraries/libbladeRF/src/bladerf.c @@ -2165,7 +2165,7 @@ int bladerf_set_oversample_register_config(struct bladerf *dev) { 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 */ bladerf_set_rfic_register(dev,0x02,0xc0); // TX Enable and Filter Control diff --git a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c index 8d885676..8a30f767 100644 --- a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c +++ b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c @@ -1369,18 +1369,6 @@ static int bladerf1_enable_module(struct bladerf *dev, } 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( dev, BLADERF_CHANNEL_IS_TX(ch) ? BLADERF_TX : BLADERF_RX, enable); diff --git a/host/libraries/libbladeRF/src/board/bladerf1/compatibility.c b/host/libraries/libbladeRF/src/board/bladerf1/compatibility.c index 25e58a4b..a5276fb8 100644 --- a/host/libraries/libbladeRF/src/board/bladerf1/compatibility.c +++ b/host/libraries/libbladeRF/src/board/bladerf1/compatibility.c @@ -13,7 +13,6 @@ static const struct compat fw_compat[] = { /* Firmware requires >= FPGA */ - { VERSION(2, 6, 0), VERSION(0, 16, 0) }, { VERSION(2, 5, 0), VERSION(0, 16, 0) }, { VERSION(2, 4, 0), VERSION(0, 6, 0) }, { 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[] = { /* FPGA requires >= Firmware */ - { VERSION(0, 16, 0), VERSION(2, 6, 0) }, { VERSION(0, 16, 0), VERSION(2, 5, 0) }, { VERSION(0, 15, 3), VERSION(2, 4, 0) }, { VERSION(0, 15, 1), VERSION(2, 4, 0) }, diff --git a/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c b/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c index 5a77ff83..9fd7ee55 100644 --- a/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c +++ b/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c @@ -2471,9 +2471,8 @@ static int bladerf2_set_loopback(struct bladerf *dev, bladerf_loopback mode) IF_COMMAND_MODE(dev, RFIC_COMMAND_FPGA, { if (BLADERF_LB_RFIC_BIST == mode) { - log_error( - "%s: RFIC BIST requires HOST tuning mode (currently FPGA). " - "Check BLADERF_DEFAULT_TUNING_MODE env var.\n", + log_debug( + "%s: BLADERF_LB_RFIC_BIST not supported in FPGA command mode\n", __FUNCTION__); return BLADERF_ERR_UNSUPPORTED; } diff --git a/host/libraries/libbladeRF/src/board/bladerf2/common.c b/host/libraries/libbladeRF/src/board/bladerf2/common.c index 37bd86ba..60a02699 100644 --- a/host/libraries/libbladeRF/src/board/bladerf2/common.c +++ b/host/libraries/libbladeRF/src/board/bladerf2/common.c @@ -312,8 +312,7 @@ bool check_total_sample_rate(struct bladerf *dev) bladerf_sample_rate rate_accum = 0; size_t active_channels = 0; - const bladerf_sample_rate MAX_SAMPLE_THROUGHPUT = - (dev->feature == BLADERF_FEATURE_OVERSAMPLE) ? 160000000 : 80000000; + const bladerf_sample_rate MAX_SAMPLE_THROUGHPUT = 80000000; /* Read RFFE control register */ status = dev->backend->rffe_control_read(dev, ®); diff --git a/host/libraries/libbladeRF/src/board/bladerf2/compatibility.c b/host/libraries/libbladeRF/src/board/bladerf2/compatibility.c index e67d5b67..8801d174 100644 --- a/host/libraries/libbladeRF/src/board/bladerf2/compatibility.c +++ b/host/libraries/libbladeRF/src/board/bladerf2/compatibility.c @@ -13,7 +13,6 @@ static const struct compat fw_compat[] = { /* Firmware requires >= FPGA */ - { VERSION(2, 6, 0), VERSION(0, 16, 0) }, { VERSION(2, 5, 0), VERSION(0, 16, 0) }, { VERSION(2, 4, 0), 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[] = { /* FPGA requires >= Firmware */ - { VERSION(0, 16, 0), VERSION(2, 6, 0) }, { VERSION(0, 16, 0), VERSION(2, 5, 0) }, { VERSION(0, 15, 3), VERSION(2, 4, 0) }, { VERSION(0, 15, 2), VERSION(2, 4, 0) }, diff --git a/host/libraries/libbladeRF/src/board/bladerf2/rfic_fpga.c b/host/libraries/libbladeRF/src/board/bladerf2/rfic_fpga.c index f7590d90..089a8cb1 100644 --- a/host/libraries/libbladeRF/src/board/bladerf2/rfic_fpga.c +++ b/host/libraries/libbladeRF/src/board/bladerf2/rfic_fpga.c @@ -319,14 +319,6 @@ static int _rfic_fpga_enable_module(struct bladerf *dev, /* Perform backend 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)); } diff --git a/host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c b/host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c index 56ed4dd1..202f3a33 100644 --- a/host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c +++ b/host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c @@ -337,14 +337,6 @@ static int _rfic_host_enable_module(struct bladerf *dev, } 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)); } } diff --git a/host/libraries/libbladeRF/src/streaming/sync.c b/host/libraries/libbladeRF/src/streaming/sync.c index 6af3ff08..2162b227 100644 --- a/host/libraries/libbladeRF/src/streaming/sync.c +++ b/host/libraries/libbladeRF/src/streaming/sync.c @@ -271,22 +271,6 @@ int sync_init(struct bladerf_sync *sync, 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) { case BLADERF_RX: /* 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_flags = 0; - sync_reset_sequence_tracking(&sync->buf_mgmt, num_transfers); - break; case BLADERF_TX: @@ -350,21 +332,13 @@ void sync_deinit(struct bladerf_sync *sync) sync_worker_deinit(sync->worker, &sync->buf_mgmt.lock, &sync->buf_mgmt.buf_ready); + if (sync->buf_mgmt.actual_lengths) { + free(sync->buf_mgmt.actual_lengths); + } /* De-allocate our buffer management resources */ if (sync->buf_mgmt.status) { MUTEX_DESTROY(&sync->buf_mgmt.lock); 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); @@ -405,43 +379,6 @@ static int wait_for_buffer(struct buffer_mgmt *b, # define SYNC_WORKER_START_TIMEOUT_MS 250 #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 */ static inline unsigned int ts_remaining(struct bladerf_sync *s) { diff --git a/host/libraries/libbladeRF/src/streaming/sync.h b/host/libraries/libbladeRF/src/streaming/sync.h index 99e10f0f..e28d0938 100644 --- a/host/libraries/libbladeRF/src/streaming/sync.h +++ b/host/libraries/libbladeRF/src/streaming/sync.h @@ -23,7 +23,6 @@ #define STREAMING_SYNC_H_ #include -#include #include @@ -48,16 +47,6 @@ typedef enum { SYNC_BUFFER_IN_FLIGHT, /**< Currently being transferred */ } 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 { SYNC_META_STATE_HEADER, /**< Extract the metadata header */ SYNC_META_STATE_SAMPLES, /**< Process samples */ @@ -96,68 +85,12 @@ struct buffer_mgmt { * submitting full buffers to the underlying async system */ 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; COND buf_ready; /**< Buffer produced by RX callback, or * 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 */ typedef enum { 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); -int sync_prime_stream(struct bladerf_sync *sync, unsigned int timeout_ms); - #endif diff --git a/host/libraries/libbladeRF/src/streaming/sync_worker.c b/host/libraries/libbladeRF/src/streaming/sync_worker.c index ede1ec23..cb7911a7 100644 --- a/host/libraries/libbladeRF/src/streaming/sync_worker.c +++ b/host/libraries/libbladeRF/src/streaming/sync_worker.c @@ -17,7 +17,6 @@ */ #include -#include #include #include @@ -44,75 +43,6 @@ 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, struct bladerf_stream *stream, struct bladerf_metadata *meta, @@ -150,81 +80,28 @@ static void *rx_callback(struct bladerf *dev, if (b->resubmit_count == 0) { if (b->status[b->prod_i] == SYNC_BUFFER_EMPTY) { - bool release_now = true; - uint32_t seq = 0; - - if (b->buffer_seq) { - 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); - } + /* This buffer is now ready for the consumer */ + b->status[samples_idx] = SYNC_BUFFER_FULL; + b->actual_lengths[samples_idx] = num_samples; + COND_SIGNAL(&b->buf_ready); /* Update the state of the buffer being submitted next */ next_idx = b->prod_i; 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]; /* Advance to the next buffer for the next callback */ b->prod_i = (next_idx + 1) % b->num_buffers; - if (release_now) { - log_verbose("%s worker: buf[%u] now in_flight\n", - worker2str(s), next_idx); - } + log_verbose("%s worker: buf[%u] = full, buf[%u] = in_flight\n", + worker2str(s), samples_idx, next_idx); } else { - if (b->reorder_len > 0) { - /* We're holding buffers to restore order. Skip submitting a - * 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); + /* TODO propagate back the RX Overrun to the sync_rx() caller */ + log_debug("RX overrun @ buffer %u\r\n", samples_idx); - next_buf = samples; - b->resubmit_count = s->stream_config.num_xfers - 1; - } + next_buf = samples; + b->resubmit_count = s->stream_config.num_xfers - 1; } } else { /* 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; } } - - sync_reset_sequence_tracking(&s->buf_mgmt, - s->stream_config.num_xfers); } MUTEX_UNLOCK(&s->buf_mgmt.lock); diff --git a/host/libraries/libbladeRF_test/CMakeLists.txt b/host/libraries/libbladeRF_test/CMakeLists.txt index 0121c424..fc3d90e1 100644 --- a/host/libraries/libbladeRF_test/CMakeLists.txt +++ b/host/libraries/libbladeRF_test/CMakeLists.txt @@ -10,7 +10,6 @@ add_subdirectory(test_ctrl) add_subdirectory(test_freq_hop) add_subdirectory(test_fw_check) add_subdirectory(test_open) -add_subdirectory(test_oversample) add_subdirectory(test_packet) add_subdirectory(test_parse) add_subdirectory(test_peripheral_timing) diff --git a/host/libraries/libbladeRF_test/requirements.txt b/host/libraries/libbladeRF_test/requirements.txt index 7f5123fa..875171b7 100644 --- a/host/libraries/libbladeRF_test/requirements.txt +++ b/host/libraries/libbladeRF_test/requirements.txt @@ -1,15 +1,14 @@ -contourpy>=1.1.1 +contourpy==1.3.1 cycler==0.12.1 fonttools==4.56.0 -kiwisolver>=1.4.7 -matplotlib>=3.7.5 -numpy>=1.24.4 +kiwisolver==1.4.8 +matplotlib==3.10.0 +numpy==2.2.3 packaging==24.2 -pandas>=2.0.3 -pillow>=10.4.0 -pyparsing>=3.1.4 +pandas==2.2.3 +pillow==11.1.0 +pyparsing==3.2.1 python-dateutil==2.9.0.post0 pytz==2025.1 -scipy>=1.8.0 six==1.17.0 tzdata==2025.1 diff --git a/host/libraries/libbladeRF_test/test_gain_compare/requirements.txt b/host/libraries/libbladeRF_test/test_gain_compare/requirements.txt index 1c587673..2cc080d4 100644 --- a/host/libraries/libbladeRF_test/test_gain_compare/requirements.txt +++ b/host/libraries/libbladeRF_test/test_gain_compare/requirements.txt @@ -5,7 +5,7 @@ kiwisolver==1.4.5 matplotlib==3.8.0 numpy==1.26.0 packaging==23.2 -Pillow==11.3.0 +Pillow==10.0.1 pyparsing==3.1.1 python-dateutil==2.8.2 six==1.16.0 diff --git a/host/libraries/libbladeRF_test/test_oversample/CMakeLists.txt b/host/libraries/libbladeRF_test/test_oversample/CMakeLists.txt deleted file mode 100644 index 8b9cf347..00000000 --- a/host/libraries/libbladeRF_test/test_oversample/CMakeLists.txt +++ /dev/null @@ -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}) diff --git a/host/libraries/libbladeRF_test/test_oversample/src/main.c b/host/libraries/libbladeRF_test/test_oversample/src/main.c deleted file mode 100644 index 19a94d4f..00000000 --- a/host/libraries/libbladeRF_test/test_oversample/src/main.c +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#if !defined(_WIN32) -#include // for getopt -#else -#include -#include -#endif -#include -#include -#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; -} diff --git a/host/libraries/libbladeRF_test/test_regression/CMakeLists.txt b/host/libraries/libbladeRF_test/test_regression/CMakeLists.txt index 5747d519..78f09b88 100644 --- a/host/libraries/libbladeRF_test/test_regression/CMakeLists.txt +++ b/host/libraries/libbladeRF_test/test_regression/CMakeLists.txt @@ -72,16 +72,6 @@ add_custom_target(test_synthesis DEPENDS ${PROJECT_NAME} 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( ${PROJECT_NAME} libbladerf_shared diff --git a/host/libraries/libbladeRF_test/test_regression/src/main.cxx b/host/libraries/libbladeRF_test/test_regression/src/main.cxx index 5813c603..3d95ba07 100644 --- a/host/libraries/libbladeRF_test/test_regression/src/main.cxx +++ b/host/libraries/libbladeRF_test/test_regression/src/main.cxx @@ -36,11 +36,9 @@ #include #include #include -#include #define TEST_LIBBLADERF libbladeRF #define TEST_XB200 xb200 -#define BLADERF_QUARTUS_CI_DIR "bladeRF/hdl/quartus/" #define BLADERF_QUARTUS_DIR "../../hdl/quartus/" #define BLADERF_MODELSIM_DIR "../../hdl/fpga/platforms/bladerf-micro/modelsim/" #define NIOS2SHELL "~/intelFPGA_lite/20.1/nios2eds/nios2_command_shell.sh" @@ -476,20 +474,6 @@ const std::vector> fpga_images {"bladeRF-micro", "wlan", "A9"} }; -const std::vector> 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> { char build_dir[PATH_MAX]; void SetUp() override { @@ -522,8 +506,6 @@ class synth: public ::testing::TestWithParam(GetParam()); std::string revision = std::get<1>(GetParam()); @@ -539,130 +521,27 @@ TEST_P(synth, synthesis) { 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& 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& 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& info) { - return test_name(info.param); -} - INSTANTIATE_TEST_SUITE_P(synthesize_defaults, synth, ::testing::ValuesIn(fpga_images_defaults), - info_test_name); + [](const testing::TestParamInfo& 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, ::testing::ValuesIn(fpga_images_all), - info_test_name); - -INSTANTIATE_TEST_SUITE_P(bitfile_ci, synth_ci, - ::testing::ValuesIn(fpga_images_ci), - info_test_name); - -/** - * @brief Not a test, writes out an artifacts file to disk so CI can pick it up. - * - */ -TEST(dump_tests, disk) { - std::vector 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 filter_gtest_args(int argc, char** argv) { - std::vector 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; -} + [](const testing::TestParamInfo& 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; + }); #define OPTARG "v:h" static struct option long_options[] = { @@ -677,17 +556,8 @@ int main(int argc, char** argv) { int opt_ind = 0; 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) { - opt = getopt_long(argc_filt, const_cast(argv_filt), OPTARG, long_options, &opt_ind); + opt = getopt_long(argc, argv, OPTARG, long_options, &opt_ind); switch (opt) { case 'v': @@ -709,7 +579,6 @@ int main(int argc, char** argv) { printf(" Example filters: \"libbladeRF*\", \"hdl*\", \"synthesis*\"\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_help View gtest specific help menu.\n"); printf("\n"); return EXIT_SUCCESS; diff --git a/host/libraries/libbladeRF_test/test_timestamps/CMakeLists.txt b/host/libraries/libbladeRF_test/test_timestamps/CMakeLists.txt index 455aba83..34b40751 100644 --- a/host/libraries/libbladeRF_test/test_timestamps/CMakeLists.txt +++ b/host/libraries/libbladeRF_test/test_timestamps/CMakeLists.txt @@ -81,7 +81,7 @@ add_executable(libbladeRF_test_txrx_hwloop ${SRC}) target_link_libraries(libbladeRF_test_txrx_hwloop ${LIBS}) 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 COPYONLY) diff --git a/host/libraries/libbladeRF_test/test_timestamps/scripts/test_txrx_hwloop.py b/host/libraries/libbladeRF_test/test_timestamps/scripts/test_txrx_hwloop.py index bf9e00f3..9a832d82 100644 --- a/host/libraries/libbladeRF_test/test_timestamps/scripts/test_txrx_hwloop.py +++ b/host/libraries/libbladeRF_test/test_timestamps/scripts/test_txrx_hwloop.py @@ -26,10 +26,8 @@ import matplotlib.pyplot as plt import numpy as np import scipy.stats as st import os -import sys import argparse import subprocess -import json def close_figure(event): if event.key == 'escape': @@ -73,8 +71,6 @@ devarg_tx = "" devarg_rx = "" samp_rate_arg = "" devarg_verbosity = "" -devarg_tx_gain = "" -devarg_rx_gain = "" print_stats = False 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('-i', '--iterations', type=int, help='number of pulses') 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('-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('-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('-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() @@ -128,20 +114,8 @@ if args.stats: print_stats = True if 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 -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 +threshold_spread = 1e6 rising_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__)) os.chdir(output_dir) 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"{devarg_verbosity} {samp_rate_arg} {devarg_tx_gain} {devarg_rx_gain}", shell=True) + f"--iterations {iterations} -l {devarg_tx} {devarg_rx} {args.compare * '-c'} " + f"{devarg_verbosity} {samp_rate_arg}", shell=True) if proc.returncode != 0: print("Failed to run hwloop binary") 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() Q = data['Q'].to_numpy() power = I**2 + Q**2 num_samples = range(len(I)) -# Calculate figure size for custom PNG dimensions or GUI display -if args.save_png: - # For PNG output, calculate figsize based on desired pixel dimensions - default_width = 1600 if plot_count == 2 else 800 - 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) +if args.compare == True: + fig, ((ax1, ax3), + (ax2, ax4), + (ax5, ax6)) = plt.subplots(nrows=3, ncols=2, figsize=(16, 6)) else: - # For GUI display, use the original sizes - figsize = (16, 6) if plot_count == 2 else (8, 6) - dpi = 100 + fig, (ax1, ax2, ax5) = plt.subplots(nrows=3, ncols=1, figsize=(8, 6)) -if args.gui or args.save_png: - if plot_count == 2: - fig, ((ax1, ax3), - (ax2, ax4), - (ax5, ax6)) = plt.subplots(nrows=3, ncols=2, figsize=figsize, dpi=dpi) - 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})') +ax1.set_title('RX Board IQ') +ax1.plot(I, label='I') +ax1.plot(Q, label='Q') +ax2.set_title('RX Board Power') +ax2.plot(power, label='Power', color='red') positive_edge, negative_edge = edge_detector(power, rising_threshold, falling_threshold, cycles_to_debounce) pos_edge_indexes = np.argwhere(positive_edge).flatten() - -if args.gui or args.save_png: - for i in pos_edge_indexes: - 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) avg = np.average(time_delta_pos_edges) @@ -227,10 +172,8 @@ if print_stats: print(f" Edge Count: {len(pos_edge_indexes)}") neg_edge_indexes = np.argwhere(negative_edge).flatten() - -if args.gui or args.save_png: - for i in neg_edge_indexes: - 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) avg = np.average(time_delta_neg_edges) @@ -243,8 +186,8 @@ if print_stats: print(f" Std.Dev: {dev:.2f}") print(f" Edge Count: {len(neg_edge_indexes)}") -print("\n%s Board" % first_label) -print(f" Measured Timestamp: {(avg):.3f} samples, Error: {(avg-period):.3f} samples") +print("\nRX Board") +print(f" Predicted Timestamp: {(avg):.3f} samples, Error: {(avg-period):.3f} samples") try: fill_expected = int(burst*fill/100) @@ -254,59 +197,38 @@ try: dev = np.std(fill) fill_vs_burst = 100 * avg/burst 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) fill = None 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: - 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")) - +print(f" Predicted Fill: {fill_vs_burst:.2f}%, Error: {(avg-fill_expected):.2f} samples") ################################################################ # TX Loopback Compare ################################################################ -if plot_count == 2: +if args.compare == True: data = pd.read_csv('compare.csv') I = data['I'].to_numpy() Q = data['Q'].to_numpy() power = I**2 + Q**2 num_samples = range(len(I)) - if args.gui or args.save_png: - ax3.set_title('TX Loopback Compare IQ') - ax3.plot(I, label='I') - ax3.plot(Q, label='Q') - ax4.set_title('TX Loopback Compare Power') - 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})') + ax3.set_title('TX Loopback Compare IQ') + ax3.plot(I, label='I') + ax3.plot(Q, label='Q') + ax4.set_title('TX Loopback Compare Power') + ax4.plot(power, label='Power', color='red') positive_edge, negative_edge = edge_detector(power, rising_threshold, falling_threshold, cycles_to_debounce) pos_edge_indexes = np.argwhere(positive_edge).flatten() - - if args.gui or args.save_png: - for i in pos_edge_indexes: - 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) avg = np.average(time_delta_pos_edges) @@ -320,10 +242,8 @@ if plot_count == 2: print(f" Edge Count: {len(pos_edge_indexes)}") neg_edge_indexes = np.argwhere(negative_edge).flatten() - - if args.gui or args.save_png: - for i in neg_edge_indexes: - 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) avg = np.average(time_delta_neg_edges) @@ -336,10 +256,8 @@ if plot_count == 2: print(f" Std.Dev: {dev:.2f}") print(f" Edge Count: {len(neg_edge_indexes)}") - - jout["TX"] = {"measured_timestamp": avg} print("\nTX Board: loopback compare") - print(f" Measured Timestamp: {(avg):.3f} samples") + print(f" Predicted Timestamp: {(avg):.3f} samples") try: fill_compare = neg_edge_indexes - pos_edge_indexes @@ -353,41 +271,20 @@ if plot_count == 2: fill_compare = None fill_vs_burst_compare = -1 - error_samples=(avg-fill_expected) - 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(f" Predicted Fill: {fill_vs_burst_compare:.2f}%, Error: {(avg-fill_expected):.2f} samples") print("") print(f"Fill Delta:") 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}%") - if args.gui or args.save_png: - ax6.set_title("Fill Error") - ax6.set_xlabel("Error (samples)") - fill_error = fill_compare - fill_expected - 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) + ax6.set_title("Fill Error") + ax6.set_xlabel("Error (samples)") + fill_error = fill_compare - fill_expected + ax6.hist(fill_error, alpha=0.7, bins=30, color=('skyblue')) # General plot assignments -if plot_count == 2: +if args.compare == True: axis = (ax1, ax2, ax3, ax4) axis_iq = (ax1, ax3) axis_power = (ax2, ax4) @@ -406,13 +303,6 @@ for ax in axis_iq: ax.set_ylim(bottom=-2500, top=2500) fig.subplots_adjust(hspace=1) - -if args.save_png: - plt.savefig(args.save_png, dpi=dpi) - 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) +print(f"\nPress [Escape] to close figure") +fig.canvas.mpl_connect('key_press_event', close_figure) +plt.show() diff --git a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c index 0a1eb41d..f37b9116 100644 --- a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c +++ b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c @@ -63,12 +63,6 @@ static void init_app_params(struct app_params *p, struct test_case *tc) { tc->fill = 50; //percent tc->init_ts_delay = 200000; 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])); p->samplerate = 1e6; @@ -170,24 +164,6 @@ int main(int argc, char *argv[]) { } 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': log_level = str2loglevel(optarg, &ok); if (!ok) { @@ -293,18 +269,6 @@ int main(int argc, char *argv[]) { 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; } diff --git a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h index add16f7c..f30de91f 100644 --- a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h +++ b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h @@ -34,14 +34,7 @@ struct test_case { unsigned int fill; unsigned int init_ts_delay; bladerf_frequency frequency; - bladerf_gain gain; /* Legacy gain field - kept for compatibility */ - - /* Separate TX and RX gain support */ - bool tx_gain_set; - bool rx_gain_set; - bladerf_gain tx_gain; - bladerf_gain rx_gain; - + bladerf_gain gain; char* dev_tx_str; char* dev_rx_str; bool just_tx; @@ -58,8 +51,6 @@ static struct option const long_options[] = { { "fill", required_argument, NULL, 'f' }, { "loop", no_argument, NULL, 'l' }, { "iterations", required_argument, NULL, 'i' }, - { "tx-gain", required_argument, NULL, 'g' }, - { "rx-gain", required_argument, NULL, 'G' }, { "verbosity", required_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { NULL, 0, NULL, 0 }, @@ -104,8 +95,6 @@ static void usage() printf(" -p, --period Length between timestamps in samples\n"); printf(" -f, --fill %% of burst to fill with [2000,2000]\n"); printf(" others set to [0,0]\n"); - printf(" -g, --tx-gain Set TX gain (unified gain mode)\n"); - printf(" -G, --rx-gain Set RX gain (unified gain mode, MGC)\n"); printf(" -l, --loop Enables RX device for TX capture\n"); printf(" -c, --compare Outputs CSV RX capture from TX device\n"); printf(" for multi-device fill comparison\n"); @@ -119,7 +108,7 @@ static void usage() printf("\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" " tested config.\n\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; } - // 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, params->num_buffers, params->buf_size, 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 */ if (tc->just_tx == false && tc->compare == true) { - // -l -c printf("Mode: TX -> RX (+RF loopback)\n"); printf(" +---------------+ +---------------+\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(" +---------------+ +---------------+\n"); } else if (tc->just_tx == true && tc->compare == true) { - // -c printf("Mode: TX -> TX\n"); printf(" +---------------+ +---------------+\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(" +---------------+ +---------------+\n"); } else if (tc->just_tx == false && tc->compare == false) { - // -l printf("Mode: TX -> RX\n"); printf(" +---------------+ +---------------+\n"); printf(" | TX Device TX|------>|RX RX Device |\n"); printf(" | | | |\n"); printf(" | RX| | |\n"); printf(" +---------------+ +---------------+\n"); - } else {// tc->just_tx == true && tc->compare == false - // defaults, no args + } else { printf("Mode: TX Only\n"); printf(" +---------------+ v +---------------+\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; } - // Use new RX gain CLI argument if set - bladerf_gain compare_gain = tc->rx_gain_set ? tc->rx_gain : tc->gain; - status = bladerf_set_gain(*dev_tx, BLADERF_MODULE_RX, compare_gain); + status = bladerf_set_gain(*dev_tx, BLADERF_MODULE_RX, tc->gain); if (status != 0) { fprintf(stderr, "Failed to set gain loopback compare RX gain: %s\n", bladerf_strerror(status)); return -1; diff --git a/host/misc/docker/_base.Dockerfile b/host/misc/docker/_base.Dockerfile index f6544118..c1b91f93 100644 --- a/host/misc/docker/_base.Dockerfile +++ b/host/misc/docker/_base.Dockerfile @@ -23,11 +23,14 @@ # This image is a cleaned version of the current working directory. # 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 " -RUN apk add --no-cache git +RUN apt-get update \ + && apt-get install -y \ + git \ + && apt-get clean COPY . /root/bladeRF ENV work="/root/bladeRF/hdl/quartus/work" diff --git a/host/misc/docker/archlinux.Dockerfile b/host/misc/docker/archlinux.Dockerfile index 89651bf3..c769763f 100644 --- a/host/misc/docker/archlinux.Dockerfile +++ b/host/misc/docker/archlinux.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # 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 # THE SOFTWARE. -FROM archlinux:latest +FROM archlinux/base LABEL maintainer="Nuand LLC " LABEL version="0.0.2" diff --git a/host/misc/docker/build.bash b/host/misc/docker/build.bash old mode 100755 new mode 100644 index 6c7fb545..056152eb --- a/host/misc/docker/build.bash +++ b/host/misc/docker/build.bash @@ -38,12 +38,8 @@ make_jobs_clangscan=4 # assuming the script is 3 levels down (host/misc/docker) dfdir=$(dirname "${0}") -dfdir=$(cd "${dfdir}" && pwd) # Convert to absolute path basedir=${dfdir}/../../.. -# Always cd to the root. This script is a lot more reliable when we do this -cd $basedir - # globals success="" failure="" @@ -175,28 +171,18 @@ main () { echo "RESULT:SUCCESS:${success}" echo "RESULT:FAILED:${failure}" - # this if structure is important, script was exiting 1 when it should be passing. bad version: [ -n "${failure}" ] && exit 1 - if [ -n "${failure}" ]; then - exit 1 - fi + [ -n "${failure}" ] && exit 1 } if [ $# -gt 0 ]; then # We have an argument, so just build those images... - base_only=true for rootname in "$*"; do if [ "${rootname}" == "_base" ]; then do_base continue fi rels="${rels} ${rootname}" - base_only=false done - - # If we only processed _base targets, exit successfully - if [ "$base_only" = true ] && [ -z "${rels}" ]; then - exit 0 - fi else # No argument, so build everything cd ${basedir} diff --git a/host/misc/docker/centos-7.Dockerfile b/host/misc/docker/centos-7.Dockerfile new file mode 100644 index 00000000..578bcd13 --- /dev/null +++ b/host/misc/docker/centos-7.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/clang-scan.Dockerfile b/host/misc/docker/clang-scan.Dockerfile index 2fbb554f..d9dfd083 100644 --- a/host/misc/docker/clang-scan.Dockerfile +++ b/host/misc/docker/clang-scan.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # 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 # THE SOFTWARE. -FROM ubuntu:noble +FROM ubuntu:bionic LABEL maintainer="Nuand LLC " 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="noble" -LABEL com.nuand.ci.distribution.version="24.04" +LABEL com.nuand.ci.distribution.codename="bionic" +LABEL com.nuand.ci.distribution.version="18.04" # Install things RUN apt-get update \ @@ -39,9 +39,7 @@ RUN apt-get update \ doxygen \ git \ help2man \ - libcurl4-openssl-dev \ - libedit-dev \ - libncurses5-dev \ + libtecla-dev \ libusb-1.0-0-dev \ pandoc \ pkg-config \ @@ -60,5 +58,5 @@ ARG parallel=1 RUN cd /root/bladeRF/host \ && mkdir -p build \ && cd build \ - && scan-build cmake -DBUILD_DOCUMENTATION=ON ../ \ - && scan-build -analyze-headers -maxloop 100 -o ./report make -j${parallel} + && cmake -DBUILD_DOCUMENTATION=ON -DCMAKE_C_COMPILER=/usr/share/clang/scan-build-6.0/libexec/ccc-analyzer ../ \ + && /usr/share/clang/scan-build-6.0/bin/scan-build -analyze-headers -maxloop 100 -o ./report make -j${parallel} diff --git a/host/misc/docker/rocky-8.Dockerfile b/host/misc/docker/debian-jessie-i386.Dockerfile similarity index 80% rename from host/misc/docker/rocky-8.Dockerfile rename to host/misc/docker/debian-jessie-i386.Dockerfile index b599605d..39030a2b 100644 --- a/host/misc/docker/rocky-8.Dockerfile +++ b/host/misc/docker/debian-jessie-i386.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # 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 # THE SOFTWARE. -FROM rockylinux:8-minimal +FROM i386/debian:jessie LABEL maintainer="Nuand LLC " 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="8" +LABEL com.nuand.ci.distribution.name="Debian" +LABEL com.nuand.ci.distribution.codename="jessie-i386" LABEL com.nuand.ci.distribution.version="8" -# Install dnf first, then everything else -RUN microdnf install -y dnf \ - && dnf update -y \ - && dnf install -y epel-release \ - && dnf config-manager --set-enabled powertools \ - && dnf groupinstall -y "Development Tools" \ - && dnf install -y \ +# Install things +RUN apt-get update \ + && apt-get install -y \ + build-essential \ clang \ cmake \ doxygen \ git \ help2man \ - libcurl-devel \ - libedit-devel \ - ncurses-devel \ - libusb1-devel \ + libtecla-dev \ + libusb-1.0-0-dev \ pandoc \ + pkg-config \ usbutils \ - && dnf clean all + && apt-get clean # Copy in our build context COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF @@ -75,4 +71,4 @@ RUN cd /root/bladeRF/ \ ../ \ && make -j${parallel} \ && make install \ - && ldconfig \ No newline at end of file + && ldconfig diff --git a/host/misc/docker/debian-jessie.Dockerfile b/host/misc/docker/debian-jessie.Dockerfile new file mode 100644 index 00000000..d31914d1 --- /dev/null +++ b/host/misc/docker/debian-jessie.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/debian-stretch-i386.Dockerfile b/host/misc/docker/debian-stretch-i386.Dockerfile new file mode 100644 index 00000000..389220c7 --- /dev/null +++ b/host/misc/docker/debian-stretch-i386.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/debian-stretch.Dockerfile b/host/misc/docker/debian-stretch.Dockerfile new file mode 100644 index 00000000..97007161 --- /dev/null +++ b/host/misc/docker/debian-stretch.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/fedora-latest.Dockerfile b/host/misc/docker/fedora-latest.Dockerfile index 35af359e..9b00c988 100644 --- a/host/misc/docker/fedora-latest.Dockerfile +++ b/host/misc/docker/fedora-latest.Dockerfile @@ -24,14 +24,14 @@ FROM fedora:latest LABEL maintainer="Nuand LLC " -LABEL version="0.0.4" +LABEL version="0.0.3" LABEL description="CI build environment for the bladeRF project" LABEL com.nuand.ci.distribution.name="Fedora" LABEL com.nuand.ci.distribution.version="latest" # Install things -RUN dnf install -y @development-tools \ - && dnf install -y \ +RUN yum groupinstall -y "Development Tools" \ + && yum install -y \ clang \ cmake \ doxygen \ @@ -41,13 +41,10 @@ RUN dnf install -y @development-tools \ libedit-devel \ libusbx \ libusbx-devel \ - ncurses-devel \ - curl-devel \ - awk \ pandoc \ wget \ - && dnf clean all \ - && rm -rf /var/cache/dnf \ + && 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 @@ -72,8 +69,8 @@ RUN cd /root/bladeRF/ \ -DCMAKE_BUILD_TYPE=${buildtype} \ -DENABLE_FX3_BUILD=OFF \ -DENABLE_HOST_BUILD=ON \ - -DTEST_REGRESSION=ON \ - -DTAGGED_RELEASE=${taggedrelease} ../ \ + -DTAGGED_RELEASE=${taggedrelease} \ + ../ \ && make -j${parallel} \ && make install \ && ldconfig diff --git a/host/misc/docker/freshen.bash b/host/misc/docker/freshen.bash old mode 100755 new mode 100644 diff --git a/host/misc/docker/mageia-latest.Dockerfile b/host/misc/docker/mageia-latest.Dockerfile deleted file mode 100644 index c9d1e81e..00000000 --- a/host/misc/docker/mageia-latest.Dockerfile +++ /dev/null @@ -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 " -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 diff --git a/host/misc/docker/opensuse-latest.Dockerfile b/host/misc/docker/opensuse-latest.Dockerfile index c0c67436..dfdacf35 100644 --- a/host/misc/docker/opensuse-latest.Dockerfile +++ b/host/misc/docker/opensuse-latest.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # of this software and associated documentation files (the "Software"), to deal @@ -35,15 +35,12 @@ RUN zypper --non-interactive install \ cmake \ doxygen \ gcc \ - gcc-c++ \ git \ help2man \ - libcurl-devel \ libedit \ libedit-devel \ libusb \ libusb-devel \ - ncurses-devel \ pandoc \ wget diff --git a/host/misc/docker/parallel.bash b/host/misc/docker/parallel.bash old mode 100755 new mode 100644 diff --git a/host/misc/docker/rocky-9.Dockerfile b/host/misc/docker/rocky-9.Dockerfile deleted file mode 100644 index a5042502..00000000 --- a/host/misc/docker/rocky-9.Dockerfile +++ /dev/null @@ -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 " -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 \ No newline at end of file diff --git a/host/misc/docker/test.bash b/host/misc/docker/test.bash old mode 100755 new mode 100644 diff --git a/host/misc/docker/ubuntu-noble.Dockerfile b/host/misc/docker/ubuntu-bionic-i386.Dockerfile similarity index 88% rename from host/misc/docker/ubuntu-noble.Dockerfile rename to host/misc/docker/ubuntu-bionic-i386.Dockerfile index 8887d05e..bd9cef91 100644 --- a/host/misc/docker/ubuntu-noble.Dockerfile +++ b/host/misc/docker/ubuntu-bionic-i386.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # 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 # THE SOFTWARE. -FROM ubuntu:noble +FROM i386/ubuntu:bionic LABEL maintainer="Nuand LLC " 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="noble" -LABEL com.nuand.ci.distribution.version="24.04" - -ENV DEBIAN_FRONTEND=noninteractive +LABEL com.nuand.ci.distribution.codename="bionic-i386" +LABEL com.nuand.ci.distribution.version="18.04" # Install things RUN apt-get update \ @@ -41,9 +39,7 @@ RUN apt-get update \ doxygen \ git \ help2man \ - libcurl4-openssl-dev \ - libedit-dev \ - libncurses5-dev \ + libtecla-dev \ libusb-1.0-0-dev \ pandoc \ pkg-config \ @@ -71,7 +67,6 @@ RUN cd /root/bladeRF/ \ -DCMAKE_BUILD_TYPE=${buildtype} \ -DENABLE_FX3_BUILD=OFF \ -DENABLE_HOST_BUILD=ON \ - -DTEST_REGRESSION=ON \ -DTAGGED_RELEASE=${taggedrelease} \ ../ \ && make -j${parallel} \ diff --git a/host/misc/docker/ubuntu-jammy.Dockerfile b/host/misc/docker/ubuntu-bionic.Dockerfile similarity index 87% rename from host/misc/docker/ubuntu-jammy.Dockerfile rename to host/misc/docker/ubuntu-bionic.Dockerfile index 883668d4..98959c31 100644 --- a/host/misc/docker/ubuntu-jammy.Dockerfile +++ b/host/misc/docker/ubuntu-bionic.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # 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 # THE SOFTWARE. -FROM ubuntu:jammy +FROM ubuntu:bionic LABEL maintainer="Nuand LLC " 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="jammy" -LABEL com.nuand.ci.distribution.version="22.04" - -ENV DEBIAN_FRONTEND=noninteractive +LABEL com.nuand.ci.distribution.codename="bionic" +LABEL com.nuand.ci.distribution.version="18.04" # Install things RUN apt-get update \ @@ -41,9 +39,7 @@ RUN apt-get update \ doxygen \ git \ help2man \ - libcurl4-openssl-dev \ - libedit-dev \ - libncurses5-dev \ + libtecla-dev \ libusb-1.0-0-dev \ pandoc \ pkg-config \ @@ -71,9 +67,8 @@ RUN cd /root/bladeRF/ \ -DCMAKE_BUILD_TYPE=${buildtype} \ -DENABLE_FX3_BUILD=OFF \ -DENABLE_HOST_BUILD=ON \ - -DTEST_REGRESSION=ON \ -DTAGGED_RELEASE=${taggedrelease} \ ../ \ && make -j${parallel} \ && make install \ - && ldconfig \ No newline at end of file + && ldconfig diff --git a/host/misc/docker/ubuntu-latest.Dockerfile b/host/misc/docker/ubuntu-cosmic-i386.Dockerfile similarity index 87% rename from host/misc/docker/ubuntu-latest.Dockerfile rename to host/misc/docker/ubuntu-cosmic-i386.Dockerfile index 1a191cbf..a9ba599f 100644 --- a/host/misc/docker/ubuntu-latest.Dockerfile +++ b/host/misc/docker/ubuntu-cosmic-i386.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # 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 # THE SOFTWARE. -FROM ubuntu:latest +FROM i386/ubuntu:cosmic LABEL maintainer="Nuand LLC " 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" - -ENV DEBIAN_FRONTEND=noninteractive +LABEL com.nuand.ci.distribution.codename="cosmic-i386" +LABEL com.nuand.ci.distribution.version="18.10" # Install things RUN apt-get update \ @@ -41,9 +39,7 @@ RUN apt-get update \ doxygen \ git \ help2man \ - libcurl4-openssl-dev \ - libedit-dev \ - libncurses5-dev \ + libtecla-dev \ libusb-1.0-0-dev \ pandoc \ pkg-config \ @@ -71,9 +67,8 @@ RUN cd /root/bladeRF/ \ -DCMAKE_BUILD_TYPE=${buildtype} \ -DENABLE_FX3_BUILD=OFF \ -DENABLE_HOST_BUILD=ON \ - -DTEST_REGRESSION=ON \ -DTAGGED_RELEASE=${taggedrelease} \ ../ \ && make -j${parallel} \ && make install \ - && ldconfig \ No newline at end of file + && ldconfig diff --git a/host/misc/docker/ubuntu-cosmic.Dockerfile b/host/misc/docker/ubuntu-cosmic.Dockerfile new file mode 100644 index 00000000..9f4f3974 --- /dev/null +++ b/host/misc/docker/ubuntu-cosmic.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-disco-i386.Dockerfile b/host/misc/docker/ubuntu-disco-i386.Dockerfile new file mode 100644 index 00000000..c7aa8511 --- /dev/null +++ b/host/misc/docker/ubuntu-disco-i386.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-disco.Dockerfile b/host/misc/docker/ubuntu-disco.Dockerfile new file mode 100644 index 00000000..c2507084 --- /dev/null +++ b/host/misc/docker/ubuntu-disco.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-eoan-i386.Dockerfile b/host/misc/docker/ubuntu-eoan-i386.Dockerfile new file mode 100644 index 00000000..fdbd0489 --- /dev/null +++ b/host/misc/docker/ubuntu-eoan-i386.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-eoan.Dockerfile b/host/misc/docker/ubuntu-eoan.Dockerfile new file mode 100644 index 00000000..eeb8ea85 --- /dev/null +++ b/host/misc/docker/ubuntu-eoan.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-focal-i386.Dockerfile b/host/misc/docker/ubuntu-focal-i386.Dockerfile new file mode 100644 index 00000000..ee00b17d --- /dev/null +++ b/host/misc/docker/ubuntu-focal-i386.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-focal.Dockerfile b/host/misc/docker/ubuntu-focal.Dockerfile index 9c98409b..fba4d52f 100644 --- a/host/misc/docker/ubuntu-focal.Dockerfile +++ b/host/misc/docker/ubuntu-focal.Dockerfile @@ -30,8 +30,6 @@ LABEL com.nuand.ci.distribution.name="Ubuntu" LABEL com.nuand.ci.distribution.codename="focal" LABEL com.nuand.ci.distribution.version="20.10" -ENV DEBIAN_FRONTEND=noninteractive - # Install things RUN apt-get update \ && apt-get install -y \ @@ -41,9 +39,7 @@ RUN apt-get update \ doxygen \ git \ help2man \ - libcurl4-openssl-dev \ - libedit-dev \ - libncurses5-dev \ + libtecla-dev \ libusb-1.0-0-dev \ pandoc \ pkg-config \ diff --git a/host/misc/docker/ubuntu-latest-i386.Dockerfile b/host/misc/docker/ubuntu-latest-i386.Dockerfile deleted file mode 100644 index 38bac0ea..00000000 --- a/host/misc/docker/ubuntu-latest-i386.Dockerfile +++ /dev/null @@ -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 " -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 \ No newline at end of file diff --git a/host/misc/docker/ubuntu-trusty-i386.Dockerfile b/host/misc/docker/ubuntu-trusty-i386.Dockerfile new file mode 100644 index 00000000..c739630a --- /dev/null +++ b/host/misc/docker/ubuntu-trusty-i386.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-trusty.Dockerfile b/host/misc/docker/ubuntu-trusty.Dockerfile new file mode 100644 index 00000000..ac0d4d2f --- /dev/null +++ b/host/misc/docker/ubuntu-trusty.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-xenial-i386.Dockerfile b/host/misc/docker/ubuntu-xenial-i386.Dockerfile new file mode 100644 index 00000000..60d2d940 --- /dev/null +++ b/host/misc/docker/ubuntu-xenial-i386.Dockerfile @@ -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 " +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 diff --git a/host/misc/docker/ubuntu-xenial.Dockerfile b/host/misc/docker/ubuntu-xenial.Dockerfile index 75f2844e..c0953b10 100644 --- a/host/misc/docker/ubuntu-xenial.Dockerfile +++ b/host/misc/docker/ubuntu-xenial.Dockerfile @@ -1,7 +1,7 @@ # This file is part of the bladeRF project: # 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 # of this software and associated documentation files (the "Software"), to deal @@ -39,31 +39,13 @@ RUN apt-get update \ doxygen \ git \ help2man \ - libcurl4-openssl-dev \ - libedit-dev \ - libncurses5-dev \ - libncurses-dev \ - libncursesw5-dev \ - libssl-dev \ + libtecla-dev \ libusb-1.0-0-dev \ pandoc \ pkg-config \ usbutils \ - wget \ && 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 --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config @@ -75,8 +57,6 @@ ARG buildtype=Release ARG taggedrelease=NO ARG parallel=1 -RUN ${compiler} --version - # Do the build! RUN cd /root/bladeRF/ \ && mkdir -p build \ @@ -88,8 +68,7 @@ RUN cd /root/bladeRF/ \ -DENABLE_FX3_BUILD=OFF \ -DENABLE_HOST_BUILD=ON \ -DTAGGED_RELEASE=${taggedrelease} \ - ../ \ + ../ \ && make -j${parallel} \ && make install \ && ldconfig - \ No newline at end of file diff --git a/host/utilities/CMakeLists.txt b/host/utilities/CMakeLists.txt index 00abd4c6..dec80c68 100644 --- a/host/utilities/CMakeLists.txt +++ b/host/utilities/CMakeLists.txt @@ -1,36 +1,8 @@ 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-update) if(NOT MSVC) add_subdirectory(bladeRF-power) - if(BUILD_BLADERF_FSK) - add_subdirectory(bladeRF-fsk/c) - endif() + add_subdirectory(bladeRF-fsk/c) endif() diff --git a/host/utilities/bladeRF-cli/CHANGELOG b/host/utilities/bladeRF-cli/CHANGELOG index 3687d321..79444a95 100644 --- a/host/utilities/bladeRF-cli/CHANGELOG +++ b/host/utilities/bladeRF-cli/CHANGELOG @@ -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 ================================================================================ -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) -------------------------------- * Added 8-bit sample support for RX/TX, CSV and binary formats diff --git a/host/utilities/bladeRF-cli/CMakeLists.txt b/host/utilities/bladeRF-cli/CMakeLists.txt index 79cd1822..378d2faa 100644 --- a/host/utilities/bladeRF-cli/CMakeLists.txt +++ b/host/utilities/bladeRF-cli/CMakeLists.txt @@ -6,7 +6,7 @@ project(bladeRF-cli C) ################################################################################ set(VERSION_INFO_MAJOR 1) -set(VERSION_INFO_MINOR 10) +set(VERSION_INFO_MINOR 9) set(VERSION_INFO_PATCH 0) if(NOT DEFINED VERSION_INFO_EXTRA) diff --git a/host/utilities/bladeRF-cli/src/input/editline.c b/host/utilities/bladeRF-cli/src/input/editline.c index 893bd83d..a832c45b 100644 --- a/host/utilities/bladeRF-cli/src/input/editline.c +++ b/host/utilities/bladeRF-cli/src/input/editline.c @@ -20,11 +20,7 @@ #include #include #include -#ifdef __FreeBSD__ -#include -#else #include -#endif #include #include #include "input_impl.h" diff --git a/host/utilities/bladeRF-fsk b/host/utilities/bladeRF-fsk index fb903684..b60b1213 160000 --- a/host/utilities/bladeRF-fsk +++ b/host/utilities/bladeRF-fsk @@ -1 +1 @@ -Subproject commit fb903684036217b9db9dcd6be8007548e12a377e +Subproject commit b60b121377a5632cd48a03647028a0a45cff7d45 diff --git a/host/utilities/bladeRF-power/CMakeLists.txt b/host/utilities/bladeRF-power/CMakeLists.txt index 0a6ba1cf..f2b25c58 100644 --- a/host/utilities/bladeRF-power/CMakeLists.txt +++ b/host/utilities/bladeRF-power/CMakeLists.txt @@ -3,17 +3,6 @@ project(bladeRF-power LANGUAGES C) set (CURSES_NEED_NCURSES 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) include_directories( diff --git a/host/utilities/bladeRF-power/src/main.c b/host/utilities/bladeRF-power/src/main.c index 086ee14c..58baba3f 100644 --- a/host/utilities/bladeRF-power/src/main.c +++ b/host/utilities/bladeRF-power/src/main.c @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) case 't': case 'r': - if ((int)test.direction != DIRECTION_UNSET) { + if (test.direction != DIRECTION_UNSET) { fprintf(stderr, "Only one direction may be specified.\n"); test.direction = ask_direction(); break; @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) CHECK(bladerf_get_devinfo(dev, &devinfo)); printf("Device: %s\n", devinfo.serial); - if ((int)test.direction == DIRECTION_UNSET) { + if (test.direction == DIRECTION_UNSET) { test.direction = ask_direction(); } diff --git a/host/utilities/bladeRF-update/bladeRF-update.c b/host/utilities/bladeRF-update/bladeRF-update.c index 6d20a4e6..efe77288 100644 --- a/host/utilities/bladeRF-update/bladeRF-update.c +++ b/host/utilities/bladeRF-update/bladeRF-update.c @@ -1130,12 +1130,7 @@ void update_rbf_files(const UpdateInfo* update_info) { if (file_exists(filepath)) { if (verify_file(filepath, latest_version->files[j].md5, latest_version->files[j].sha256, update_info)) { rbf_up_to_date = true; - size_t copy_len = strlen(filepath); - 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'; + strncpy(existing_rbf_path, filepath, MAX_PATH_LENGTH - 1); printf("[+] Found up-to-date RBF at %s, skipping download\n", filepath); break; } @@ -1189,12 +1184,7 @@ void update_fw_files(const UpdateInfo* update_info) { if (file_exists(filepath)) { if (verify_file(filepath, update_info->firmware.md5, update_info->firmware.sha256, update_info)) { fw_up_to_date = true; - size_t copy_len = strlen(filepath); - 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'; + strncpy(existing_fw_path, filepath, MAX_PATH_LENGTH - 1); printf("[+] Found up-to-date firmware at %s, skipping download\n", filepath); break; } diff --git a/thirdparty/analogdevicesinc/no-OS_local/patches/0001-0bba46e-nuand-modifications.patch b/thirdparty/analogdevicesinc/no-OS_local/patches/0001-0bba46e-nuand-modifications.patch index bd81e2f5..78ef06ee 100644 --- a/thirdparty/analogdevicesinc/no-OS_local/patches/0001-0bba46e-nuand-modifications.patch +++ b/thirdparty/analogdevicesinc/no-OS_local/patches/0001-0bba46e-nuand-modifications.patch @@ -492,15 +492,6 @@ index 77ffa44..ff5d7c5 100644 /* Set the Enable State Machine (ENSM) mode. */ int32_t ad9361_set_en_state_machine_mode (struct ad9361_rf_phy *phy, uint32_t 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 index b20cb71..0491f91 100644 --- a/ad9361/sw/ad9361_conv.c