Wiki

This version (18 Sep 2023 09:26) was approved by Darius B.The Previously approved version (13 Aug 2018 16:35) is available.Diff

AD9361 No-OS Software

The AD9361 is a high performance, highly integrated RF Agile Transceiver™. Its programmability and wideband capability make it ideal for a broad range of transceiver applications. The device combines an RF front end with a flexible mixed-signal baseband section and integrated frequency synthesizers, simplifying design-in by providing a configurable digital interface to a processor.

Supported Devices

Introduction

This document describes the No-OS software used to control the AD9361 part.

AD9361 No-OS API

An API is available to be used on systems without OS to interact with the AD9361 and provides all the necessary functions to control it.

Below is presented a short description of all the functions provided in the API:

Device Global Settings
struct ad9361_rf_phy *ad9361_init
(AD9361_InitParam *init_param)
Initializes the FMCOMMS2 board. Receives as parameter a structure that contains the AD9361 initial parameters. Returns a structure that contains the AD9361 current state in case of success, negative error code otherwise.
int32_t ad9361_set_en_state_machine_mode
(struct ad9361_rf_phy *phy, uint32_t mode)
Sets the Enable State Machine (ENSM) mode. Receives as parameters a structure that contains the AD9361 current state and the ENSM mode (SLEEP, ALERT, FDD, PINCTRL). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_en_state_machine_mode
(struct ad9361_rf_phy *phy, uint32_t *mode)
Gets the Enable State Machine (ENSM) mode. Receives as parameters a structure that contains the AD9361 current state and a variable to store the selected ENSM mode. Returns 0 in case of success, negative error code otherwise.
Receive Chain Settings
int32_t ad9361_set_rx_rf_gain
(struct ad9361_rf_phy *phy, uint8_t ch, int32_t gain_db)
Sets the receive RF gain for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel number (0, 1) and the RF gain. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_rf_gain
(struct ad9361_rf_phy *phy, uint8_t ch, int32_t *gain_db)
Gets current receive RF gain for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel (0, 1) and a variable to store the RF gain. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_rf_bandwidth
(struct ad9361_rf_phy *phy, uint32_t bandwidth_hz)
Sets the RF bandwidth. Receives as parameters a structure that contains the AD9361 current state and the desired bandwidth in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_rf_bandwidth
(struct ad9361_rf_phy *phy, uint32_t *bandwidth_hz)
Gets current RF bandwidth. Receives as parameters a structure that contains the AD9361 current state and a variable to store the bandwidth value in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_sampling_freq
(struct ad9361_rf_phy *phy, uint32_t sampling_freq_hz)
Sets the sampling frequency. Receives as parameters a structure that contains the AD9361 current state and the desired sampling frequency in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_sampling_freq
(struct ad9361_rf_phy *phy, uint32_t *sampling_freq_hz)
Gets current sampling frequency. Receives as parameters a structure that contains the AD9361 current state and a variable to store the sampling frequency value in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_lo_freq
(struct ad9361_rf_phy *phy, uint64_t lo_freq_hz)
Sets the LO frequency. Receives as parameters a structure that contains the AD9361 current state and the desired LO frequency in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_lo_freq
(struct ad9361_rf_phy *phy, uint64_t *lo_freq_hz)
Gets current LO frequency. Receives as parameters a structure that contains the AD9361 current state and a variable to store the LO frequency value in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_lo_int_ext(struct ad9361_rf_phy *phy, uint8_t int_ext)
Switches between internal and external LO. Receives as parameters a structure that contains the AD9361 current state and the desired option (INT_LO, EXT_LO). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_rssi
(struct ad9361_rf_phy *phy, uint8_t ch, struct rf_rssi *rssi)
Gets the RSSI for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel (0, 1) and a variable to store the RSSI. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_gain_control_mode
(struct ad9361_rf_phy *phy, uint8_t ch, uint8_t gc_mode)
Sets the gain control mode for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel (0, 1) and the gain control mode (GAIN_MGC, GAIN_FASTATTACK_AGC, GAIN_SLOWATTACK_AGC, GAIN_HYBRID_AGC). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_gain_control_mode
(struct ad9361_rf_phy *phy, uint8_t ch, uint8_t *gc_mode)
Gets the gain control mode for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel (0, 1) and a variable to store the gain control mode. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_fir_config
(struct ad9361_rf_phy *phy, AD9361_RXFIRConfig fir_cfg)
Sets the FIR filter configuration. Receives as parameters a structure that contains the AD9361 current state and the FIR filter configuration. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_fir_config(struct ad9361_rf_phy *phy, uint8_t rx_ch, AD9361_RXFIRConfig *fir_cfg)
Gets the RX FIR filter configuration. Receives as parameters a structure that contains the AD9361 current state, the desired channel (RX1, RX2) and the location for storing the FIR filter configuration. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_fir_en_dis
(struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the FIR filter. Receives as parameters a structure that contains the AD9361 current state and the option (ENABLE, DISABLE). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_fir_en_dis
(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Gets the status of the FIR filter. Receives as parameters a structure that contains the AD9361 current state and the enable/disable status buffer. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_rfdc_track_en_dis
(struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the RX RFDC Tracking. Receives as parameters a structure that contains the AD9361 current state and the option (ENABLE, DISABLE).Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_rfdc_track_en_dis
(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Gets the status of the RX RFDC Tracking. Receives as parameters a structure that contains the AD9361 current state and the enable/disable status buffer.Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_bbdc_track_en_dis
(struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the RX BasebandDC Tracking. Receives as parameters a structure that contains the AD9361 current state and the option (ENABLE, DISABLE).Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_bbdc_track_en_dis
(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Gets the status of the RX BasebandDC Tracking. Receives as parameters a structure that contains the AD9361 current state and the enable/disable status buffer.Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_quad_track_en_dis
(struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the RX Quadrature Tracking. Receives as parameters a structure that contains the AD9361 current state and the option (ENABLE, DISABLE).Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_quad_track_en_dis
(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Gets the status of the RX Quadrature Tracking. Receives as parameters a structure that contains the AD9361 current state and the enable/disable status buffer.Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_rx_rf_port_input (struct ad9361_rf_phy *phy,uint32_t mode)
Sets the RX RF input port. Receives as parameters a structure that contains the AD9361 current state and the desired port (A_BALANCED, B_BALANCED, C_BALANCED, A_N, A_P, B_N, B_P, C_N, C_P, TX_MON1, TX_MON2, TX_MON1_2). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_rf_port_input (struct ad9361_rf_phy *phy,uint32_t *mode)
Gets the selected RX RF input port. Receives as parameters a structure that contains the AD9361 current state and the location to store the selected port value. Returns 0 in case of success, negative error code otherwise. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_rx_fastlock_store(struct ad9361_rf_phy *phy, uint32_t profile)
Stores RX fastlock profile. To create a profile tune the synthesizer (ad9361_set_rx_lo_freq()) and then call this function specifying the target profile number. Receives as parameters a structure that contains the AD9361 current state and the profile number (0 - 7). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_rx_fastlock_recall(struct ad9361_rf_phy *phy, uint32_t profile)
Recalls specified RX fastlock profile. When in fastlock pin select mode (init_param→rx_fastlock_pincontrol_enable), the function needs to be called before then the pin-control can be used. Receives as parameters a structure that contains the AD9361 current state and the profile number (0 - 7). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_rx_fastlock_load(struct ad9361_rf_phy *phy, uint32_t profile, uint8_t *values)
Recalls specified RX fastlock profile. When in fastlock pin select mode (init_param→rx_fastlock_pincontrol_enable), the function needs to be called before then the pin-control can be used. Receives as parameters a structure that contains the AD9361 current state, the profile number (0 - 7) and the Fastlock profile program data (val0,val1,val2,…,val15). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_rx_fastlock_save(struct ad9361_rf_phy *phy, uint32_t profile, uint8_t *values)
Saves RX fastlock profile. In order to use more than 8 Profiles, an existing profile can be read back and stored by the user application. Receives as parameters a structure that contains the AD9361 current state, the profile number (0 - 7) and the location for storing the profile data. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_rx_lo_powerdown(struct ad9361_rf_phy *phy, uint8_t option)
Powers down the RX Local Oscillator. Receives as parameters a structure that contains the AD9361 current state and the option (ON, OFF). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_rx_lo_power(struct ad9361_rf_phy *phy, uint8_t *option)
Gets the RX Local Oscillator power status. Receives as parameters a structure that contains the AD9361 current state and the location to store the selected option. Returns 0 in case of success, negative error code otherwise.
Transmit Chain Settings
int32_t ad9361_set_tx_attenuation
(struct ad9361_rf_phy *phy,
 uint8_t ch,
 uint32_t attenuation_mdb)
Sets the transmit attenuation for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel number (0, 1) and the attenuation in dB. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_attenuation
(struct ad9361_rf_phy *phy,
 uint8_t ch,
 uint32_t *attenuation_mdb)
Gets current transmit attenuation for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel (0, 1) and a variable to store the attenuation value in dB. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_rf_bandwidth
(struct ad9361_rf_phy *phy, uint32_t  bandwidth_hz)
Sets the RF bandwidth. Receives as parameters a structure that contains the AD9361 current state and the desired bandwidth in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_rf_bandwidth
(struct ad9361_rf_phy *phy, uint32_t *bandwidth_hz)
Gets current RF bandwidth. Receives as parameters a structure that contains the AD9361 current state and a variable to store the bandwidth value in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_sampling_freq
(struct ad9361_rf_phy *phy, uint32_t sampling_freq_hz)
Sets the sampling frequency. Receives as parameters a structure that contains the AD9361 current state and the desired sampling frequency in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_sampling_freq
(struct ad9361_rf_phy *phy, uint32_t *sampling_freq_hz)
Gets current sampling frequency. Receives as parameters a structure that contains the AD9361 current state and a variable to store the sampling frequency value in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_lo_freq
(struct ad9361_rf_phy *phy, uint64_t lo_freq_hz)
Sets the LO frequency. Receives as parameters a structure that contains the AD9361 current state and the desired LO frequency in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_lo_freq
(struct ad9361_rf_phy *phy, uint64_t *lo_freq_hz)
Gets current LO frequency. Receives as parameters a structure that contains the AD9361 current state and a variable to store the LO frequency value in Hz. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_lo_int_ext(struct ad9361_rf_phy *phy, uint8_t int_ext)
Switches between internal and external LO. Receives as parameters a structure that contains the AD9361 current state and the desired option (INT_LO, EXT_LO). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_fir_config
(struct ad9361_rf_phy *phy, AD9361_TXFIRConfig fir_cfg)
Sets the FIR filter configuration. Receives as parameters a structure that contains the AD9361 current state and the FIR filter configuration. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_fir_config(struct ad9361_rf_phy *phy, uint8_t tx_ch, AD9361_TXFIRConfig *fir_cfg)
Gets the TX FIR filter configuration. Receives as parameters a structure that contains the AD9361 current state and the location to store the FIR filter configuration. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_fir_en_dis
(struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the FIR filter. Receives as parameters a structure that contains the AD9361 current state and the option (ENABLE, DISABLE). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_fir_en_dis
(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Gets the status of the FIR filter. Receives as parameters a structure that contains the AD9361 current state and the enable/disable status buffer. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_rssi
(struct ad9361_rf_phy *phy,
 uint8_t ch,
 uint32_t *rssi_db_x_1000)
Gets the TX RSSI for the selected channel. Receives as parameters a structure that contains the AD9361 current state, the desired channel (0, 1) and a variable to store the RSSI. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_rf_port_output (struct ad9361_rf_phy *phy, uint32_t mode)
Sets the TX RF output port. Receives as parameters a structure that contains the AD9361 current state and the desired port (TXA, TXB). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_rf_port_output (struct ad9361_rf_phy *phy, uint32_t *mode)
Gets the selected TX RF output port. Receives as parameters a structure that contains the AD9361 current state and the location for storing the selected port. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_tx_auto_cal_en_dis (struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the auto calibration. Receives as parameters a structure that contains the AD9361 current state and the desired mode (ENABLE, DISABLE). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_auto_cal_en_dis (struct ad9361_rf_phy *phy, uint8_t *en_dis)
Gets the status of the auto calibration flag. Receives as parameters a structure that contains the AD9361 current state and the location for storing the selected mode. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_tx_fastlock_store(struct ad9361_rf_phy *phy, uint32_t profile)
Stores TX fastlock profile. Receives as parameters a structure that contains the AD9361 current state and the profile number (0 - 7). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_tx_fastlock_recall(struct ad9361_rf_phy *phy, uint32_t profile)
Recalls specified TX fastlock profile. Receives as parameters a structure that contains the AD9361 current state and the profile number (0 - 7). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_tx_fastlock_load(struct ad9361_rf_phy *phy, uint32_t profile, uint8_t *values)
Loads TX fastlock profile. A previously saved profile can be loaded in any of the 8 available slots. Receives as parameters a structure that contains the AD9361 current state, the profile number (0 - 7) and the Fastlock profile program data (val0,val1,val2,…,val15). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_tx_fastlock_save(struct ad9361_rf_phy *phy, uint32_t profile, uint8_t *values)
Saves TX fastlock profile. In order to use more than 8 Profiles, an existing profile can be read back and stored by the user application. Receives as parameters a structure that contains the AD9361 current state, the profile number (0 - 7) and the location for storing the profile data. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_tx_lo_powerdown(struct ad9361_rf_phy *phy, uint8_t option)
Powers down the TX Local Oscillator. Receives as parameters a structure that contains the AD9361 current state and the desired option (ON, OFF). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_tx_lo_power(struct ad9361_rf_phy *phy, uint8_t *option)
Gets the TX Local Oscillator power status. Receives as parameters a structure that contains the AD9361 current state and the location to store the selected option. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_trx_path_clks
(struct ad9361_rf_phy *phy,
 uint32_t *rx_path_clks,
 uint32_t *tx_path_clks)
Sets the RX and TX path rates. Receives as parameters a structure that contains the AD9361 current state, the RX and the TX clocks. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_trx_path_clks
(struct ad9361_rf_phy *phy,
 uint32_t *rx_path_clks,
 uint32_t *tx_path_clks)
Gets the RX and TX path rates. Receives as parameters a structure that contains the AD9361 current state, the RX and the TX buffers to store the clock frequencies. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_no_ch_mode
(struct ad9361_rf_phy *phy, uint8_t no_ch_mode)
Set the number of channels mode. Receives as parameters a structure that contains the AD9361 current state and the number of channels mode (1 - 1×1; 2 - 2×2). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_do_mcs(struct ad9361_rf_phy *phy_master, struct ad9361_rf_phy *phy_slave)
Do multi chip synchronization. Receives as parameters a structure that contains the AD9361 master current state and a structure that contains the AD9361 slave current state. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_trx_fir_en_dis (struct ad9361_rf_phy *phy, uint8_t en_dis)
Enables/disables the TRX FIR filters. Receives as parameters a structure that contains the AD9361 current state and the desired option (ENABLE, DISABLE). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_set_trx_rate_gov (struct ad9361_rf_phy *phy, uint32_t rate_gov)
Set the OSR rate governor. Receives as parameters a structure that contains the AD9361 current state and the desired OSR rate governor (HIGHEST_OSR, NOMINAL_OSR). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_trx_rate_gov (struct ad9361_rf_phy *phy, uint32_t *rate_gov)
Gets the OSR rate governor. Receives as parameters a structure that contains the AD9361 master current state and the location for storing the OSR rate governor. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_do_calib(struct ad9361_rf_phy *phy, uint32_t cal, int32_t arg)
Performs the selected calibration. Receives as parameters a structure that contains the AD9361 current state, the desired calibration (TX_QUAD_CAL, RFDC_CAL) and for TX_QUAD_CAL, the optional RX phase value overwrite (set to zero). Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_trx_load_enable_fir(struct ad9361_rf_phy *phy, AD9361_RXFIRConfig rx_fir_cfg, AD9361_TXFIRConfig tx_fir_cfg)
Loads and enables TRX FIR filters configurations. Receives as parameters a structure that contains the AD9361 current state, the RX FIR filter configuration and the TX FIR filter configuration. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_do_dcxo_tune_coarse(struct ad9361_rf_phy *phy, uint32_t coarse)
Does DCXO coarse tuning. Receives as parameters a structure that contains the AD9361 current state and the DCXO coarse tuning value. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_do_dcxo_tune_fine(struct ad9361_rf_phy *phy, uint32_t fine)
Does DCXO fine tuning. Receives as parameters a structure that contains the AD9361 current state and the DCXO fine tuning value. Returns 0 in case of success, negative error code otherwise.
int32_t ad9361_get_temperature(struct ad9361_rf_phy *phy, int32_t *temp)
Gets the temperature. Receives as parameters a structure that contains the AD9361 current state and the location for storing the current temperature (degrees C * 1000). Returns 0 in case of success, negative error code otherwise.

Notes: 1. Below is defined the AD9361_ParamInit structure used by the ad9361_init() function:

For more details on each of the struct members please see here: AD9361 Device Driver Customization

typedef struct
{
	/* Device selection */
	enum dev_id	dev_sel;
	/* Identification number */
	uint8_t		id_no;
	/* Reference Clock */
	uint32_t	reference_clk_rate;
	/* Base Configuration */
	uint8_t		two_rx_two_tx_mode_enable;	/* adi,2rx-2tx-mode-enable */
	uint8_t		one_rx_one_tx_mode_use_rx_num;	/* adi,1rx-1tx-mode-use-rx-num */
	uint8_t		one_rx_one_tx_mode_use_tx_num;	/* adi,1rx-1tx-mode-use-tx-num */
	uint8_t		frequency_division_duplex_mode_enable;	/* adi,frequency-division-duplex-mode-enable */
	uint8_t		frequency_division_duplex_independent_mode_enable;	/* adi,frequency-division-duplex-independent-mode-enable */
	uint8_t		tdd_use_dual_synth_mode_enable;	/* adi,tdd-use-dual-synth-mode-enable */
	uint8_t		tdd_skip_vco_cal_enable;		/* adi,tdd-skip-vco-cal-enable */
	uint32_t	tx_fastlock_delay_ns;	/* adi,tx-fastlock-delay-ns */
	uint32_t	rx_fastlock_delay_ns;	/* adi,rx-fastlock-delay-ns */
	uint8_t		rx_fastlock_pincontrol_enable;	/* adi,rx-fastlock-pincontrol-enable */
	uint8_t		tx_fastlock_pincontrol_enable;	/* adi,tx-fastlock-pincontrol-enable */
	uint8_t		external_rx_lo_enable;	/* adi,external-rx-lo-enable */
	uint8_t		external_tx_lo_enable;	/* adi,external-tx-lo-enable */
	uint8_t		dc_offset_tracking_update_event_mask;	/* adi,dc-offset-tracking-update-event-mask */
	uint8_t		dc_offset_attenuation_high_range;	/* adi,dc-offset-attenuation-high-range */
	uint8_t		dc_offset_attenuation_low_range;	/* adi,dc-offset-attenuation-low-range */
	uint8_t		dc_offset_count_high_range;			/* adi,dc-offset-count-high-range */
	uint8_t		dc_offset_count_low_range;			/* adi,dc-offset-count-low-range */
	uint8_t		split_gain_table_mode_enable;	/* adi,split-gain-table-mode-enable */
	uint32_t	trx_synthesizer_target_fref_overwrite_hz;	/* adi,trx-synthesizer-target-fref-overwrite-hz */
	uint8_t		qec_tracking_slow_mode_enable;	/* adi,qec-tracking-slow-mode-enable */
	/* ENSM Control */
	uint8_t		ensm_enable_pin_pulse_mode_enable;	/* adi,ensm-enable-pin-pulse-mode-enable */
	uint8_t		ensm_enable_txnrx_control_enable;	/* adi,ensm-enable-txnrx-control-enable */
	/* LO Control */
	uint64_t	rx_synthesizer_frequency_hz;	/* adi,rx-synthesizer-frequency-hz */
	uint64_t	tx_synthesizer_frequency_hz;	/* adi,tx-synthesizer-frequency-hz */
	uint8_t		tx_lo_powerdown_managed_enable;	/* adi,tx-lo-powerdown-managed-enable */
	/* Rate & BW Control */
	uint32_t	rx_path_clock_frequencies[6];	/* adi,rx-path-clock-frequencies */
	uint32_t	tx_path_clock_frequencies[6];	/* adi,tx-path-clock-frequencies */
	uint32_t	rf_rx_bandwidth_hz;	/* adi,rf-rx-bandwidth-hz */
	uint32_t	rf_tx_bandwidth_hz;	/* adi,rf-tx-bandwidth-hz */
	/* RF Port Control */
	uint32_t	rx_rf_port_input_select;	/* adi,rx-rf-port-input-select */
	uint32_t	tx_rf_port_input_select;	/* adi,tx-rf-port-input-select */
	/* TX Attenuation Control */
	int32_t		tx_attenuation_mdB;	/* adi,tx-attenuation-mdB */
	uint8_t		update_tx_gain_in_alert_enable;	/* adi,update-tx-gain-in-alert-enable */
	/* Reference Clock Control */
	uint8_t		xo_disable_use_ext_refclk_enable;	/* adi,xo-disable-use-ext-refclk-enable */
	uint32_t	dcxo_coarse_and_fine_tune[2];	/* adi,dcxo-coarse-and-fine-tune */
	uint32_t	clk_output_mode_select;		/* adi,clk-output-mode-select */
	/* Gain Control */
	uint8_t		gc_rx1_mode;	/* adi,gc-rx1-mode */
	uint8_t		gc_rx2_mode;	/* adi,gc-rx2-mode */
	uint8_t		gc_adc_large_overload_thresh;	/* adi,gc-adc-large-overload-thresh */
	uint8_t		gc_adc_ovr_sample_size;	/* adi,gc-adc-ovr-sample-size */
	uint8_t		gc_adc_small_overload_thresh;	/* adi,gc-adc-small-overload-thresh */
	uint16_t	gc_dec_pow_measurement_duration;	/* adi,gc-dec-pow-measurement-duration */
	uint8_t		gc_dig_gain_enable;	/* adi,gc-dig-gain-enable */
	uint16_t	gc_lmt_overload_high_thresh;	/* adi,gc-lmt-overload-high-thresh */
	uint16_t	gc_lmt_overload_low_thresh;	/* adi,gc-lmt-overload-low-thresh */
	uint8_t		gc_low_power_thresh;	/* adi,gc-low-power-thresh */
	uint8_t		gc_max_dig_gain;	/* adi,gc-max-dig-gain */
	/* Gain MGC Control */
	uint8_t		mgc_dec_gain_step;	/* adi,mgc-dec-gain-step */
	uint8_t		mgc_inc_gain_step;	/* adi,mgc-inc-gain-step */
	uint8_t		mgc_rx1_ctrl_inp_enable;	/* adi,mgc-rx1-ctrl-inp-enable */
	uint8_t		mgc_rx2_ctrl_inp_enable;	/* adi,mgc-rx2-ctrl-inp-enable */
	uint8_t		mgc_split_table_ctrl_inp_gain_mode;	/* adi,mgc-split-table-ctrl-inp-gain-mode */
	/* Gain AGC Control */
	uint8_t		agc_adc_large_overload_exceed_counter;	/* adi,agc-adc-large-overload-exceed-counter */
	uint8_t		agc_adc_large_overload_inc_steps;	/* adi,agc-adc-large-overload-inc-steps */
	uint8_t		agc_adc_lmt_small_overload_prevent_gain_inc_enable;	/* adi,agc-adc-lmt-small-overload-prevent-gain-inc-enable */
	uint8_t		agc_adc_small_overload_exceed_counter;	/* adi,agc-adc-small-overload-exceed-counter */
	uint8_t		agc_dig_gain_step_size;	/* adi,agc-dig-gain-step-size */
	uint8_t		agc_dig_saturation_exceed_counter;	/* adi,agc-dig-saturation-exceed-counter */
	uint32_t	agc_gain_update_interval_us; /* adi,agc-gain-update-interval-us */
	uint8_t		agc_immed_gain_change_if_large_adc_overload_enable;	/* adi,agc-immed-gain-change-if-large-adc-overload-enable */
	uint8_t		agc_immed_gain_change_if_large_lmt_overload_enable;	/* adi,agc-immed-gain-change-if-large-lmt-overload-enable */
	uint8_t		agc_inner_thresh_high;	/* adi,agc-inner-thresh-high */
	uint8_t		agc_inner_thresh_high_dec_steps;	/* adi,agc-inner-thresh-high-dec-steps */
	uint8_t		agc_inner_thresh_low;	/* adi,agc-inner-thresh-low */
	uint8_t		agc_inner_thresh_low_inc_steps;	/* adi,agc-inner-thresh-low-inc-steps */
	uint8_t		agc_lmt_overload_large_exceed_counter;	/* adi,agc-lmt-overload-large-exceed-counter */
	uint8_t		agc_lmt_overload_large_inc_steps;	/* adi,agc-lmt-overload-large-inc-steps */
	uint8_t		agc_lmt_overload_small_exceed_counter;	/* adi,agc-lmt-overload-small-exceed-counter */
	uint8_t		agc_outer_thresh_high;	/* adi,agc-outer-thresh-high */
	uint8_t		agc_outer_thresh_high_dec_steps;	/* adi,agc-outer-thresh-high-dec-steps */
	uint8_t		agc_outer_thresh_low;	/* adi,agc-outer-thresh-low */
	uint8_t		agc_outer_thresh_low_inc_steps;	/* adi,agc-outer-thresh-low-inc-steps */
	uint32_t	agc_attack_delay_extra_margin_us;	/* adi,agc-attack-delay-extra-margin-us */
	uint8_t		agc_sync_for_gain_counter_enable;	/* adi,agc-sync-for-gain-counter-enable */
	/* Fast AGC */
	uint32_t	fagc_dec_pow_measuremnt_duration;	/* adi,fagc-dec-pow-measurement-duration */
	uint32_t	fagc_state_wait_time_ns;	/* adi,fagc-state-wait-time-ns */
	/* Fast AGC - Low Power */
	uint8_t		fagc_allow_agc_gain_increase;	/* adi,fagc-allow-agc-gain-increase-enable */
	uint32_t	fagc_lp_thresh_increment_time;	/* adi,fagc-lp-thresh-increment-time */
	uint32_t	fagc_lp_thresh_increment_steps;	/* adi,fagc-lp-thresh-increment-steps */
	/* Fast AGC - Lock Level (Lock Level is set via slow AGC inner high threshold) */
	uint8_t		fagc_lock_level_lmt_gain_increase_en;	/* adi,fagc-lock-level-lmt-gain-increase-enable */
	uint32_t	fagc_lock_level_gain_increase_upper_limit;	/* adi,fagc-lock-level-gain-increase-upper-limit */
	/* Fast AGC - Peak Detectors and Final Settling */
	uint32_t	fagc_lpf_final_settling_steps;	/* adi,fagc-lpf-final-settling-steps */
	uint32_t	fagc_lmt_final_settling_steps;	/* adi,fagc-lmt-final-settling-steps */
	uint32_t	fagc_final_overrange_count;	/* adi,fagc-final-overrange-count */
	/* Fast AGC - Final Power Test */
	uint8_t		fagc_gain_increase_after_gain_lock_en;	/* adi,fagc-gain-increase-after-gain-lock-enable */
	/* Fast AGC - Unlocking the Gain */
	uint32_t	fagc_gain_index_type_after_exit_rx_mode;	/* adi,fagc-gain-index-type-after-exit-rx-mode */
	uint8_t		fagc_use_last_lock_level_for_set_gain_en;	/* adi,fagc-use-last-lock-level-for-set-gain-enable */
	uint8_t		fagc_rst_gla_stronger_sig_thresh_exceeded_en;	/* adi,fagc-rst-gla-stronger-sig-thresh-exceeded-enable */
	uint32_t	fagc_optimized_gain_offset;	/* adi,fagc-optimized-gain-offset */
	uint32_t	fagc_rst_gla_stronger_sig_thresh_above_ll;	/* adi,fagc-rst-gla-stronger-sig-thresh-above-ll */
	uint8_t		fagc_rst_gla_engergy_lost_sig_thresh_exceeded_en;	/* adi,fagc-rst-gla-engergy-lost-sig-thresh-exceeded-enable */
	uint8_t		fagc_rst_gla_engergy_lost_goto_optim_gain_en;	/* adi,fagc-rst-gla-engergy-lost-goto-optim-gain-enable */
	uint32_t	fagc_rst_gla_engergy_lost_sig_thresh_below_ll;	/* adi,fagc-rst-gla-engergy-lost-sig-thresh-below-ll */
	uint32_t	fagc_energy_lost_stronger_sig_gain_lock_exit_cnt;	/* adi,fagc-energy-lost-stronger-sig-gain-lock-exit-cnt */
	uint8_t		fagc_rst_gla_large_adc_overload_en;	/* adi,fagc-rst-gla-large-adc-overload-enable */
	uint8_t		fagc_rst_gla_large_lmt_overload_en;	/* adi,fagc-rst-gla-large-lmt-overload-enable */
	uint8_t		fagc_rst_gla_en_agc_pulled_high_en;	/* adi,fagc-rst-gla-en-agc-pulled-high-enable */
	uint32_t	fagc_rst_gla_if_en_agc_pulled_high_mode;	/* adi,fagc-rst-gla-if-en-agc-pulled-high-mode */
	uint32_t	fagc_power_measurement_duration_in_state5;	/* adi,fagc-power-measurement-duration-in-state5 */
	/* RSSI Control */
	uint32_t	rssi_delay;	/* adi,rssi-delay */
	uint32_t	rssi_duration;	/* adi,rssi-duration */
	uint8_t		rssi_restart_mode;	/* adi,rssi-restart-mode */
	uint8_t		rssi_unit_is_rx_samples_enable;	/* adi,rssi-unit-is-rx-samples-enable */
	uint32_t	rssi_wait;	/* adi,rssi-wait */
	/* Aux ADC Control */
	uint32_t	aux_adc_decimation;	/* adi,aux-adc-decimation */
	uint32_t	aux_adc_rate;	/* adi,aux-adc-rate */
	/* AuxDAC Control */
	uint8_t		aux_dac_manual_mode_enable;	/* adi,aux-dac-manual-mode-enable */
	uint32_t	aux_dac1_default_value_mV;	/* adi,aux-dac1-default-value-mV */
	uint8_t		aux_dac1_active_in_rx_enable;	/* adi,aux-dac1-active-in-rx-enable */
	uint8_t		aux_dac1_active_in_tx_enable;	/* adi,aux-dac1-active-in-tx-enable */
	uint8_t		aux_dac1_active_in_alert_enable;	/* adi,aux-dac1-active-in-alert-enable */
	uint32_t	aux_dac1_rx_delay_us;	/* adi,aux-dac1-rx-delay-us */
	uint32_t	aux_dac1_tx_delay_us;	/* adi,aux-dac1-tx-delay-us */
	uint32_t	aux_dac2_default_value_mV;	/* adi,aux-dac2-default-value-mV */
	uint8_t		aux_dac2_active_in_rx_enable;	/* adi,aux-dac2-active-in-rx-enable */
	uint8_t		aux_dac2_active_in_tx_enable;	/* adi,aux-dac2-active-in-tx-enable */
	uint8_t		aux_dac2_active_in_alert_enable;	/* adi,aux-dac2-active-in-alert-enable */
	uint32_t	aux_dac2_rx_delay_us;	/* adi,aux-dac2-rx-delay-us */
	uint32_t	aux_dac2_tx_delay_us;	/* adi,aux-dac2-tx-delay-us */
	/* Temperature Sensor Control */
	uint32_t	temp_sense_decimation;	/* adi,temp-sense-decimation */
	uint16_t	temp_sense_measurement_interval_ms;	/* adi,temp-sense-measurement-interval-ms */
	int8_t		temp_sense_offset_signed;	/* adi,temp-sense-offset-signed */
	uint8_t		temp_sense_periodic_measurement_enable;	/* adi,temp-sense-periodic-measurement-enable */
	/* Control Out Setup */
	uint8_t		ctrl_outs_enable_mask;	/* adi,ctrl-outs-enable-mask */
	uint8_t		ctrl_outs_index;	/* adi,ctrl-outs-index */
	/* External LNA Control */
	uint32_t	elna_settling_delay_ns;	/* adi,elna-settling-delay-ns */
	uint32_t	elna_gain_mdB;	/* adi,elna-gain-mdB */
	uint32_t	elna_bypass_loss_mdB;	/* adi,elna-bypass-loss-mdB */
	uint8_t		elna_rx1_gpo0_control_enable;	/* adi,elna-rx1-gpo0-control-enable */
	uint8_t		elna_rx2_gpo1_control_enable;	/* adi,elna-rx2-gpo1-control-enable */
	uint8_t		elna_gaintable_all_index_enable;	/* adi,elna-gaintable-all-index-enable */
	/* Digital Interface Control */
	uint8_t		digital_interface_tune_skip_mode;	/* adi,digital-interface-tune-skip-mode */
	uint8_t		digital_interface_tune_fir_disable;	/* adi,digital-interface-tune-fir-disable */
	uint8_t		pp_tx_swap_enable;	/* adi,pp-tx-swap-enable */
	uint8_t		pp_rx_swap_enable;	/* adi,pp-rx-swap-enable */
	uint8_t		tx_channel_swap_enable;	/* adi,tx-channel-swap-enable */
	uint8_t		rx_channel_swap_enable;	/* adi,rx-channel-swap-enable */
	uint8_t		rx_frame_pulse_mode_enable;	/* adi,rx-frame-pulse-mode-enable */
	uint8_t		two_t_two_r_timing_enable;	/* adi,2t2r-timing-enable */
	uint8_t		invert_data_bus_enable;	/* adi,invert-data-bus-enable */
	uint8_t		invert_data_clk_enable;	/* adi,invert-data-clk-enable */
	uint8_t		fdd_alt_word_order_enable;	/* adi,fdd-alt-word-order-enable */
	uint8_t		invert_rx_frame_enable;	/* adi,invert-rx-frame-enable */
	uint8_t		fdd_rx_rate_2tx_enable;	/* adi,fdd-rx-rate-2tx-enable */
	uint8_t		swap_ports_enable;	/* adi,swap-ports-enable */
	uint8_t		single_data_rate_enable;	/* adi,single-data-rate-enable */
	uint8_t		lvds_mode_enable;	/* adi,lvds-mode-enable */
	uint8_t		half_duplex_mode_enable;	/* adi,half-duplex-mode-enable */
	uint8_t		single_port_mode_enable;	/* adi,single-port-mode-enable */
	uint8_t		full_port_enable;	/* adi,full-port-enable */
	uint8_t		full_duplex_swap_bits_enable;	/* adi,full-duplex-swap-bits-enable */
	uint32_t	delay_rx_data;	/* adi,delay-rx-data */
	uint32_t	rx_data_clock_delay;	/* adi,rx-data-clock-delay */
	uint32_t	rx_data_delay;	/* adi,rx-data-delay */
	uint32_t	tx_fb_clock_delay;	/* adi,tx-fb-clock-delay */
	uint32_t	tx_data_delay;	/* adi,tx-data-delay */
	uint32_t	lvds_bias_mV;	/* adi,lvds-bias-mV */
	uint8_t		lvds_rx_onchip_termination_enable;	/* adi,lvds-rx-onchip-termination-enable */
	uint8_t		rx1rx2_phase_inversion_en;	/* adi,rx1-rx2-phase-inversion-enable */
	uint8_t		lvds_invert1_control;	/* adi,lvds-invert1-control */
	uint8_t		lvds_invert2_control;	/* adi,lvds-invert2-control */
	/* GPO Control */
	uint8_t		gpo0_inactive_state_high_enable;	/* adi,gpo0-inactive-state-high-enable */
	uint8_t		gpo1_inactive_state_high_enable;	/* adi,gpo1-inactive-state-high-enable */
	uint8_t		gpo2_inactive_state_high_enable;	/* adi,gpo2-inactive-state-high-enable */
	uint8_t		gpo3_inactive_state_high_enable;	/* adi,gpo3-inactive-state-high-enable */
	uint8_t		gpo0_slave_rx_enable;	/* adi,gpo0-slave-rx-enable */
	uint8_t		gpo0_slave_tx_enable;	/* adi,gpo0-slave-tx-enable */
	uint8_t		gpo1_slave_rx_enable;	/* adi,gpo1-slave-rx-enable */
	uint8_t		gpo1_slave_tx_enable;	/* adi,gpo1-slave-tx-enable */
	uint8_t		gpo2_slave_rx_enable;	/* adi,gpo2-slave-rx-enable */
	uint8_t		gpo2_slave_tx_enable;	/* adi,gpo2-slave-tx-enable */
	uint8_t		gpo3_slave_rx_enable;	/* adi,gpo3-slave-rx-enable */
	uint8_t		gpo3_slave_tx_enable;	/* adi,gpo3-slave-tx-enable */
	uint8_t		gpo0_rx_delay_us;	/* adi,gpo0-rx-delay-us */
	uint8_t		gpo0_tx_delay_us;	/* adi,gpo0-tx-delay-us */
	uint8_t		gpo1_rx_delay_us;	/* adi,gpo1-rx-delay-us */
	uint8_t		gpo1_tx_delay_us;	/* adi,gpo1-tx-delay-us */
	uint8_t		gpo2_rx_delay_us;	/* adi,gpo2-rx-delay-us */
	uint8_t		gpo2_tx_delay_us;	/* adi,gpo2-tx-delay-us */
	uint8_t		gpo3_rx_delay_us;	/* adi,gpo3-rx-delay-us */
	uint8_t		gpo3_tx_delay_us;	/* adi,gpo3-tx-delay-us */
	/* Tx Monitor Control */
	uint32_t	low_high_gain_threshold_mdB;	/* adi,txmon-low-high-thresh */
	uint32_t	low_gain_dB;	/* adi,txmon-low-gain */
	uint32_t	high_gain_dB;	/* adi,txmon-high-gain */
	uint8_t		tx_mon_track_en;	/* adi,txmon-dc-tracking-enable */
	uint8_t		one_shot_mode_en;	/* adi,txmon-one-shot-mode-enable */
	uint32_t	tx_mon_delay;	/* adi,txmon-delay */
	uint32_t	tx_mon_duration;	/* adi,txmon-duration */
	uint32_t	tx1_mon_front_end_gain;	/* adi,txmon-1-front-end-gain */
	uint32_t	tx2_mon_front_end_gain;	/* adi,txmon-2-front-end-gain */
	uint32_t	tx1_mon_lo_cm;	/* adi,txmon-1-lo-cm */
	uint32_t	tx2_mon_lo_cm;	/* adi,txmon-2-lo-cm */
	/* GPIO definitions */
	int32_t		gpio_resetb;	/* reset-gpios */
	/* MCS Sync */
	int32_t		gpio_sync;		/* sync-gpios */
	int32_t		gpio_cal_sw1;	/* cal-sw1-gpios */
	int32_t		gpio_cal_sw2;	/* cal-sw2-gpios */
	/* External LO clocks */
	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;

2. Below is defined the rf_rssi structure used by the ad9361_get_rx_rssi() function:

	struct rf_rssi {
		u32 ant;	// Antenna number for which RSSI is reported
		u32 symbol;	// Runtime RSSI
		u32 preamble;	// Initial RSSI
		s32 multiplier;	// Multiplier to convert reported RSSI
		u8 duration;	// Duration to be considered for measuring
	};

3. Below is defined the AD9361_RXFIRConfig structure used by the ad9361_set_rx_fir_config() function:

	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[64];
	}AD9361_RXFIRConfig;

4. Below is defined the AD9361_TXFIRConfig structure used by the ad9361_set_tx_fir_config() function:

	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[64];
	}AD9361_TXFIRConfig;

AD9361 Doxygen Documentation

Generic Platform

The AD9361 No-OS Software together with the Generic Platform Driver can be used as a base for any microprocessor platform.

The Platform Driver implements the communication with the device and hides the actual details of the communication protocol to the AD9361 driver. When the desired type of processor is chosen, the specific communication functions have to be implemented.

Code Size Information

The following information was obtained compiling the AD9361 project (with the Generic Platform Driver integrated) using the gcc v4.7.2 and the Optimize for size (-Os) option enabled.

 text	   data	    bss	    dec	    hex	filename
45159	   1624	     24	  46807	   b6d7	ad9361_generic

Note: The source code from the GitHub SHA 13c1ba56164f4b63844f63e5dd596286b6faf8b3 was used for calculating the code size information (https://github.com/analogdevicesinc/no-OS/tree/13c1ba56164f4b63844f63e5dd596286b6faf8b3/ad9361/sw).

Xilinx Platform

This guide provides some quick instructions on how to setup the AD-FMCOMMS2-EBZ on either:


The ML605 XPS project remain on this website only for legacy purposes. The support for XPS projects has been discontinued.

Required Software

No-OS Build Guide

NOTE: This build guide is valid for the projects found in the no-OS/projects folder. If your project resides elsewhere under the no-OS repository tree, it is a legacy project. A build guide for legacy projects can be found Build no-OS with GNU make.

Clone NO-OS with the --recursive flag:

git clone --recursive https://github.com/analogdevicesinc/no-OS

If however you've already cloned NO-OS without the --recursive flag, you may initialize all the submodules in an existing NO-OS clone with:

git submodule update --recursive --init
Build Prerequisites

Prior to building a no-OS project, it is required to set up some environment variables so that the build process may find the necessary tools (compiler, linker, SDK etc.).

Use the following commands to prepare your environment for building no-OS projects:

Linux (Click to expand)

Linux (Click to expand)

Make sure the GNU Make version you are using is >= 4.2.

Intel (Click to expand)

Intel (Click to expand)

Assuming the SDK is installed at this path:

/path/to/intel
└── intelFPGA
    └── 18.1

Run:

$ source no-OS/tools/scripts/platform/intel/environment.sh /path/to/intel/intelFPGA 18.1

Xilinx (Click to expand)

Xilinx (Click to expand)

Assuming the Vitis 2022.2 is installed at this path:

/path/to/xilinx
├── DocNav
├── Downloads
└── Vitis
    └── 2022.2

Run:

$ source /path/to/xilinx/Vitis/2022.2/settings64.sh

STM32 (Click to expand)

STM32 (Click to expand)

  • Install stm32cubeide to default location /opt/stm32cubeide. If you'd rather install it at a different location, run export STM32CUBEIDE=/path/to/your/stm32cubeide in the terminal used for building.
  • Install stm32cubemx to default location /opt/stm32cubemx. If you'd rather install it at a different location, run export STM32CUBEMX=/path/to/your/stm32cubemx in the terminal used for building.
  • Currently we are testing projects with CubeMx Version 6.5.0, but other versions should work as well.
  • Install java (openjdk-17), sed and head (if not already present, they normally are).
  • Install python (if not already present) and make sure python command executes Python3 (not Python2). This can be easily achieved by running the following command sudo apt install python-is-python3.

Maxim (Click to expand)

Maxim (Click to expand)

  • Install the Maxim Micros SDK.
  • Set the MAXIM_LIBRARIES environment variable to the MaximSDK/Libraries path (the default should be ~/MaximSDK/Libraries).
  • For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

Mbed (Click to expand)

Mbed (Click to expand)

  • Install Mbed CLI 1 as per guide here: https://os.mbed.com/docs/mbed-os/v6.15/build-tools/install-and-set-up.html .Usually the following steps should be sufficient: sudo apt install python3 python3-pip git mercurial gcc-arm-none-eabi and sudo python3 -m pip install mbed-cli pyelftools==0.29.
  • Configure the compiler location with Mbed CLI. This can be carried out by running the “mbed config -G GCC_ARM_PATH “path-to-your-gcc-compiler”” in Command Prompt.

Pico (Click to expand)

Pico (Click to expand)

  • Set the PICO_SDK_PATH environment variable to the pico-sdk cloned repository path.
  • Install the J-Link software
  • Set the JLINK_SERVER_PATH environment variable to the JLinkGDBServerCLExe path (the default path should be /opt/SEGGER/JLink/JLinkGDBServerCLExe).
  • For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

Please install all the necessary packs locally and then manually import them in CrossCore

Common Issues with environment setup:

  • Makefiles searches for the CCES_HOME in its default installation directory. It may happen that multiple version are installed and may not work. To select a CCES_HOME run export CCES_HOME=/opt/analog/cces/2.10.0

Windows (Click to expand)

Windows (Click to expand)

Open up a Git Bash as Administrator once and run the tools/scripts/git-bash.sh script. Close the window. You only need to do this once per Git Bash installation.
Use Git Bash (unelevated) for the rest of your development.

Xilinx (Click to expand)

Xilinx (Click to expand)

Assuming the Vitis 2022.2 is installed at this path:

C:\Xilinx
├── DocNav
├── Downloads
└── Vitis
    └── 2022.2

Run:

$ export PATH=/c/Xilinx/Vitis/2022.2/bin:/c/Xilinx/Vitis/2022.2/gnu/aarch64/nt/aarch64-none/bin/:$PATH

Maxim (Click to expand)

Maxim (Click to expand)

  • Install the Maxim Micros SDK to a path without whitespaces like C:\MaximSDK.
  • Set the MAXIM_LIBRARIES environment variable by running: export MAXIM_LIBRARIES=/c/MaximSDK/Libraries.
  • (Optional) For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

Building a project

Go in the project directory that should be built.

Linux (Click to expand)

Linux (Click to expand)

$ cd no-OS/projects/project_name/
$ tree
.
├── builds.json
├── Makefile
├── src
└── src.mk

Intel (Click to expand)

Intel (Click to expand)

Copy the .sof and .sopcinfo to the project folder.

$ ls
Makefile  profiles  src  src.mk  system_bd.sopcinfo  adrv9009_a10gx.sof	
$ make

# Alternatively you may select a .sopcinfo file explicitly by:
$ make HARDWARE=path/to/system_bd.sopcinfo

Xilinx (Click to expand)

Xilinx (Click to expand)

Copy the .xsa in the project folder.

$ ls
Makefile  profiles  src  src.mk system_top.xsa
$ make

# Alternatively you may select an .xsa file explicitly by:
$ make HARDWARE=path/to/file.xsa

Maxim (Click to expand)

Maxim (Click to expand)

To build a project, type:

make PLATFORM=maxim TARGET=...

The TARGET specifies the chip for which the project is built. If it is missing, max32660 will be used. At the moment, the available targets are: max32650, max32655, max32660, max32665, max32670, max32690 and max78000.

Mbed (Click to expand)

Mbed (Click to expand)

To build a project, type:

make PLATFORM=mbed

Pico (Click to expand)

Pico (Click to expand)

To build a project, type:

make PLATFORM=pico

STM32 (Click to expand)

STM32 (Click to expand)

Make sure you have the .ioc file in the project directory, then type:

$ make PLATFORM=stm32

If during the project generation you get a dialog saying that you are using an .ioc file generated with an old CubeMX version, click Continue. Migrate is also a valid option but only if you know what you are doing.

If you're trying to use an .ioc file generated with a newer CubeMX than the one installed on your machine, you will get a prompt that asks you to upgrade your installation to the new version, there is no other choice than to click OK and then manually upgrade.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

The ADuCM3029 projects also contain a pinmux_config.c file which contains pin configuration instructions.

# build an ADuCM3029-only project
$ make

# if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM
$ make PLATFORM=aducm3029

Windows (Click to expand)

Windows (Click to expand)

Use Git Bash to run these commands.
$ cd no-OS/projects/project_name

It should contain make-related files and source files:

./no-OS/projects/project_name
├── builds.json
├── Makefile
├── src
└── src.mk

Xilinx (Click to expand)

Xilinx (Click to expand)

Copy the .xsa to the project folder and run:

./no-OS/projects/adrv9009
├── Makefile
├── profiles
├── src
├── src.mk
└── system_top.xsa

$ make

Maxim (Click to expand)

Maxim (Click to expand)

To build a project, type:

$ make PLATFORM=maxim TARGET=...

The TARGET specifies the chip for which the project is built. If it is missing, max32660 will be used. At the moment, the available targets are: max32650, max32655, max32660, max32665, max32670, max32690 and max78000.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

$ export PLATFORM=aducm3029
$ make

The build process creates a build directory in the project folder:

build
├── app
├── bsp
├── obj
├── project_name.elf
└── tmp
Running/Debugging

Once the .elf, .hex or .bin file has been generated, make sure the board is powered on, JTAG cable connected and use the following commands to upload the program to the board or debug.

Uploading the binary to target is generically achieved with:

$ make run

Xilinx (Click to expand)

Xilinx (Click to expand)

For Xilinx project you can flash the board connected to a remote host. On the remote host make sure to start `hw_server`. On your development environment run

$ export XSCT_REMOTE_HOST=<remote host ip>
$ export XSCT_REMOTE_PORT=<remote host hw_server port>
$ make run

By default the `hw_server` port should be 3121.

Use the following command to launch the SDK associated to the used platform in order to be able to debug graphically by clicking the debug button:

$ make sdkopen

Fore more details about the available make rules, check out this page.

Running/Debugging in WSL

17 Mar 2021 10:27 · Darius B

Console Commands Driver

The Console Commands Driver is optional for the project. It was created in addition to the AD9361 driver to control the part using some console commands.

AD9361 Reference Project Serial Commands

The following commands were implemented for controlling the AD9361:

Command Description
help? Displays all available commands.
register? Gets the specified register value.
tx_lo_freq? Gets current TX LO frequency [MHz].
tx_lo_freq= Sets the TX LO frequency [MHz].
tx_samp_freq? Gets current TX sampling frequency [Hz].
tx_samp_freq= Sets the TX sampling frequency [Hz].
tx_rf_bandwidth? Gets current TX RF bandwidth [Hz].
tx_rf_bandwidth= Sets the TX RF bandwidth [Hz].
tx1_attenuation? Gets current TX1 attenuation [mdB].
tx1_attenuation= Sets the TX1 attenuation [mdB].
tx2_attenuation? Gets current TX2 attenuation [mdB].
tx2_attenuation= Sets the TX2 attenuation [mdB].
tx_fir_en? Gets current TX FIR state.
tx_fir_en= Sets the TX FIR state.
rx_lo_freq? Gets current RX LO frequency [MHz].
rx_lo_freq= Sets the RX LO frequency [MHz].
rx_samp_freq? Gets current RX sampling frequency [Hz].
rx_samp_freq= Sets the RX sampling frequency [Hz].
rx_rf_bandwidth? Gets current RX RF bandwidth [Hz].
rx_rf_bandwidth= Sets the RX RF bandwidth [Hz].
rx1_gc_mode? Gets current RX1 GC mode.
rx1_gc_mode= Sets the RX1 GC mode.
rx2_gc_mode? Gets current RX2 GC mode.
rx2_gc_mode= Sets the RX2 GC mode.
rx1_rf_gain? Gets current RX1 RF gain.
rx1_rf_gain= Sets the RX1 RF gain.
rx2_rf_gain? Gets current RX2 RF gain.
rx2_rf_gain= Sets the RX2 RF gain.
rx_fir_en? Gets current RX FIR state.
rx_fir_en= Sets the RX FIR state.
dds_tx1_f1_freq? Gets current DDS TX1 F1 frequency [MHz].
dds_tx1_f1_freq= Sets the DDS TX1 F1 frequency [MHz].
dds_tx1_f2_freq? Gets current DDS TX1 F2 frequency [MHz].
dds_tx1_f2_freq= Sets the DDS TX1 F2 frequency [MHz].
dds_tx1_f1_phase? Gets current DDS TX1 F1 phase [degrees].
dds_tx1_f1_phase= Sets the DDS TX1 F1 phase [degrees].
dds_tx1_f2_phase? Gets current DDS TX1 F2 phase [degrees].
dds_tx1_f2_phase= Sets the DDS TX1 F2 phase [degrees].
dds_tx1_f1_scale? Gets current DDS TX1 F1 scale.
dds_tx1_f1_scale= Sets the DDS TX1 F1 scale.
dds_tx1_f2_scale? Gets current DDS TX1 F2 scale.
dds_tx1_f2_scale= Sets the DDS TX1 F2 scale.
dds_tx2_f1_freq? Gets current DDS TX2 F1 frequency [MHz].
dds_tx2_f1_freq= Sets the DDS TX2 F1 frequency [MHz].
dds_tx2_f2_freq? Gets current DDS TX2 F2 frequency [MHz].
dds_tx2_f2_freq= Sets the DDS TX2 F2 frequency [MHz].
dds_tx2_f1_phase? Gets current DDS TX2 F1 phase [degrees].
dds_tx2_f1_phase= Sets the DDS TX2 F1 phase [degrees].
dds_tx2_f2_phase? Gets current DDS TX2 F2 phase [degrees].
dds_tx2_f2_phase= Sets the DDS TX2 F2 phase [degrees].
dds_tx2_f1_scale? Gets current DDS TX2 F1 scale.
dds_tx2_f1_scale= Sets the DDS TX2 F1 scale.
dds_tx2_f2_scale? Gets current DDS TX2 F2 scale.
dds_tx2_f2_scale= Sets the DDS TX2 F2 scale.
Executing a Command Example

Commands can be executed using a serial terminal connected to the UART peripheral of the development board.

The following image shows an example of how the TX LO frequency can be set to 2.4 GHz using the corresponding command.

 UART

Downloads

The source code of the no-OS software and the scripts can be downloaded from the Analog Devices github.

no-OS Software

HDL Reference Designs for FMCOMMS2

HDL Reference Designs for FMCOMMS5

More Information

resources/eval/user-guides/ad-fmcomms2-ebz/software/baremetal.txt · Last modified: 18 Sep 2023 09:26 by Darius B