AnsweredAssumed Answered

[ad9361-iiostream.c] Unable to set channel attributes!

Question asked by ferdem on Sep 2, 2015
Latest reply on Sep 15, 2015 by ferdem

Hi, I'm studying on the example ad9361_iiostream.c. My setup is FMCOMMS5+ZC706 with latest Linaro version.

I could not succeed to make it write to "hardwaregain" and "gain_control_mode" attributes.

I tried for hardwaregain first.

Returned error message:  Error -22 writing to channel "hardwaregain" value may not be supported.

I guess that attribute names are correct but the value seems to be in incorrect format, type etc.


I have also observed that some of the attributes do not change although the related commands executed without an error.

The bandwidth, local oscillator, sampling rate and RF port attributes are intended to be set in the code. However, only the LO frequency and port selection are set after the execution. The other attributes(rf_bandwidth, sampling_frequency) are not updated. I check the values by using "Reload Settings" in the osc after I run the ad9361_iiostream.o. The bandwidth and samling rate do not change.
I want to be able to set all attributes via the source code ad9361_iiostream.c.


Below codes shows some of my efforts to set hardwaregain:


struct stream_cfg {
long long bw_hz; // Analog banwidth in Hz
long long fs_hz; // Baseband sample rate in Hz
long long lo_hz; // Local oscillator frequency in Hz

const char* rfport; // Port name

long long hw_gain;

//long hw_gain;

//const char* hw_gain



wr_ch_str(chn, "rf_port_select", cfg->rfport);

wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz);

wr_ch_lli(chn, "hardwaregain", cfg->bw_hz);

//wr_ch_str(chn, "hardwaregain", cfg->bw_hz);


rxcfg.lo_hz = GHZ(2.5); // 2.5 GHz rf frequency

rxcfg.rfport = "A_BALANCED"; // port A (select for rf freq.)

rxcfg.hardwaregain = 20;