AD9361 Fastlock Profile not storing correct frequency

It seems the frequencies are not correctly saving to the fastlock profiles. Consulted the fastlock section of the manual (https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9361#fastlock_mode) and initialized each of the profiles -- however no matter which profile # I recall, the out_altvoltage0_RX_LO_frequency/out_altvoltage1_TX_LO_frequency remains at the last value specified by the echo command. For example, I ran the file provided at https://github.com/analogdevicesinc/linux_image_ADI-scripts/blob/master/test_tx_fastlock_pinctrl.sh, which sets up 8 profiles, but afterwards if I attempt to switch to any profile the TX frequency remains at 2470000000 Mhz (the last frequency set via echo in line 36).

Found the following answer here and copied the steps:

https://ez.analog.com/linux-software-drivers/f/q-a/87329/understanding-ad9361-iiostream-c-example/150206#150206

This is what I got from running the commands myself:

# pwd

/sys/bus/iio/devices/iio:device1

# cat out_altvoltage0_RX_LO_frequency

2400000000

# echo 1 > out_altvoltage0_RX_LO_fastlock_store
# cat out_altvoltage0_RX_LO_fastlock_store

0

# echo 2500000000 > out_altvoltage0_RX_LO_frequency
# cat out_altvoltage0_RX_LO_frequency

2500000000

# echo 2 > out_altvoltage0_RX_LO_fastlock_store
# cat out_altvoltage0_RX_LO_fastlock_store

0

# echo 1 > out_altvoltage0_RX_LO_fastlock_recall
# cat out_altvoltage0_RX_LO_frequency

2500000000 (<<<< should be 2400000000)

# echo 2 > out_altvoltage0_RX_LO_fastlock_recall
# cat out_altvoltage0_RX_LO_frequency

2500000000



As seen above, even when switching fastlock profiles the frequency remains at 2500000000. Is there a step I'm missing?



specified board
[edited by: bpol at 7:02 PM (GMT -4) on 26 Oct 2021]
  • First you have to set the LO frequency, then you have to store the profile number and then you have to recall the profile number for recalling the frequency.

    Follow the steps given in the below link:

    https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9361#fastlock_mode

  • I followed the instructions outlined in the link and received the following output --

    Setting the LO frequency:

    > root@analog:/sys/bus/iio/devices/iio:device1# cat out_altvoltage0_RX_LO_frequency
    2400000000
    > root@analog:/sys/bus/iio/devices/iio:device1# echo 4242000000 > out_altvoltage0_RX_LO_frequency
    > root@analog:/sys/bus/iio/devices/iio:device1# cat out_altvoltage0_RX_LO_frequency
    4242000000

    Storing the profile number:

    > root@analog:/sys/bus/iio/devices/iio:device1# echo 0 > out_altvoltage0_RX_LO_fastlock_store

    Resetting the LO frequency:

    > root@analog:/sys/bus/iio/devices/iio:device1# echo 2400000000 > out_altvoltage0_RX_LO_frequency
    > root@analog:/sys/bus/iio/devices/iio:device1# cat out_altvoltage0_RX_LO_frequency
    2400000000

    Recalling the profile number:

    > root@analog:/sys/bus/iio/devices/iio:device1# echo 0 > out_altvoltage0_RX_LO_fastlock_recall
    > root@analog:/sys/bus/iio/devices/iio:device1# cat out_altvoltage0_RX_LO_frequency
    2400000000

    I recalled profile 0, however the frequency didn't change. It remained at 2400000000, the frequency I set manually, instead of 4242000000 which I had stored in the profile.

    Alternately, referring to line 41 of test_tx_fastlock_pinctrl.sh, I tried:

    > root@analog:/sys/bus/iio/devices/iio:device1# iio_attr -D ad9361-phy adi,rx-fastlock-pincontrol-enable 1
    dev 'ad9361-phy', debug attr 'adi,rx-fastlock-pincontrol-enable', value :'0'
    wrote 2 bytes to adi,rx-fastlock-pincontrol-enable
    dev 'ad9361-phy', debug attr 'adi,rx-fastlock-pincontrol-enable', value :'1'
    > root@analog:/sys/bus/iio/devices/iio:device1# echo 0 > out_altvoltage0_RX_LO_fastlock_recall
    > root@analog:/sys/bus/iio/devices/iio:device1# cat out_altvoltage0_RX_LO_frequency
    2400000000

    However the outcome was the same.

  • out_altvoltage0_RX_LO_frequency won't reflect the state of the part when using fastlock. I believe if you look at the registers containing the VCO tuning words used to set the RFPLL in normal mode, they won't change when loading profiles. They are routed from the profile bank instead.

    -Travis