Post Go back to editing

AD9361: Unhandled case in ad9361_tx_quad_calib

Category: Choose a category
Product Number: ADRV9364
Software Version: Git latest

Our application has a lower RX rate requirement than that for TX. We Monitor RX at a rate of 4 MSPS and when required to transmit, the rate is changed to accommodate TX requirement (4 MSPS to 60000 MSPS) as required. When required to cease transmission, the baseband rate is set to the minimum RX rate of 4 MSPS to save power. On a handful of occasions we have found that an ADRV9364 will not transmit IQ data until the system is rebooted. We have not attempted to cycle the AD9364 ensm_mode to any other states and then back to fdd to see if that resolves the issue largely because we are not able to duplicate it easily and we have no way of knowing when TX channel is non responsive. When TX channel is in this state, no matter what IQ data is sent to the TX channel, the output is a CW. We also see the following kernel messages:

[ 2652.175472] ad9361 spi3.0: Unhandled case in ad9361_tx_quad_calib line 2889 clkrf 3999999 clktf 15999999
[ 2652.213479] ad9361 spi3.0: Unhandled case in ad9361_tx_quad_calib line 2889 clkrf 3999999 clktf 15999999
[ 2652.937384] ad9361 spi3.0: Unhandled case in ad9361_tx_quad_calib line 2889 clkrf 3999999 clktf 15999999
[ 2712.005104] ad9361 spi3.0: Unhandled case in ad9361_tx_quad_calib line 2889 clkrf 3999999 clktf 15999999
[ 2712.042263] ad9361 spi3.0: Unhandled case in ad9361_tx_quad_calib line 2889 clkrf 3999999 clktf 15999999
[ 2712.813428] ad9361 spi3.0: Unhandled case in ad9361_tx_quad_calib line 2889 clkrf 3999999 clktf 15999999

We understand the message from looking at https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/adc/ad9361.c#L2889 but have not idea how clkrf and clktf are selected such that the code ends up in a case that is not handled. And frankly, not sure that would necessarily cause the problem we are experiencing.

Next time the issues occurs, I'll try changing the rate and ensm mode. Any ideas to help us resolve this issue are welcome.



Fix language
[edited by: EdwardK at 5:30 PM (GMT -4) on 5 Oct 2022]

Top Replies

    •  Analog Employees 
    Oct 7, 2022 in reply to EdwardK +1 verified
    Looks like AD9361 Filter Design Wizard creates a filter with parameters that trigger the issue?

    Not directly - but let me explain.

    The RXSAMP and TXSAMP rate must always be equal. In case you…

Parents
  • Wondering do you have a FIR filter loaded with some interpolation or decimation?

    There is only one application controlling the IIO device? Right?

    Can you share more information about this use case?

    I don't think I ever come across something close. 

    -Michael

  • Hi Michael, 

    We have FIR filters but do not use interpolation or decimation. Out filters are asymmetric s in we do not use any in the RX chain and are applied to the TX size only when required to meet meet 3 dB specifications for specific waveforms. These filters were designed using AD9361 Filter Design Wizard 16.1.3-g924f0cd. The TX filters are used in 1 MHz output bandwidth steps from 1 MHz to 40 MHz. I can provide the filters if that helps to look at the setting therein. Note that the issue persists when FIR filters are disabled.

    There is one application controlling the IIO device but it multi threaded to allow logical separation of the RX and TX chains but have a shared lock prior to changing any rates. The RX chain only configures the Fs initially and the TX chain is responsible for rate changes thereafter.

    RX control signal is narrow band FSK or can be a tone. TX can be any modulation from CW to wideband waveforms. Our application is battery powered at as such we need to minimize Fs to reduce power consumption.

  • Hi,

    I had a similar setup running today on our test bench.

    Changing baseband rate between 60MSPS and 4MSPS in a tight loop.

    No issues detected while running for 7 hours and exchanging millions of SPI messages.

    # pwd
    /sys/bus/platform/devices/e0006000.spi/spi_master/spi0/statistics

    # grep "" *
    bytes:206676953
    bytes_rx:35620637
    bytes_tx:171056319
    errors:0
    messages:68076769
    spi_async:0
    spi_sync:68076769
    spi_sync_immediate:68076769
    timedout:0
    transfer_bytes_histo_0-1:32951328
    transfer_bytes_histo_1024-2047:0
    transfer_bytes_histo_128-255:0
    transfer_bytes_histo_16-31:0
    transfer_bytes_histo_16384-32767:0
    transfer_bytes_histo_2-3:67854613
    transfer_bytes_histo_2048-4095:0
    transfer_bytes_histo_256-511:0
    transfer_bytes_histo_32-63:0
    transfer_bytes_histo_32768-65535:0
    transfer_bytes_histo_4-7:889450
    transfer_bytes_histo_4096-8191:0
    transfer_bytes_histo_512-1023:0
    transfer_bytes_histo_64-127:0
    transfer_bytes_histo_65536+:0
    transfer_bytes_histo_8-15:0
    transfer_bytes_histo_8192-16383:0
    transfers:101695391
    transfers_split_maxsize:0
    #

    I think the issue on your side could be caused by a SPI issue.

    Can you read all device attributes after the issue happened?

    # cd /sys/bus/iio/devices/iio\:device0
    
    # grep "" *
    
    calib_mode:auto
    
    calib_mode_available:auto manual manual_tx_quad tx_quad rf_dc_offs rssi_gain_step
    
    dcxo_tune_coarse_available:[0 0 0]
    
    dcxo_tune_fine_available:[0 0 0]
    
    dev:252:0
    
    ensm_mode:fdd
    
    ensm_mode_available:sleep wait alert fdd pinctrl pinctrl_fdd_indep
    
    filter_fir_config:FIR Rx: 0,0 Tx: 0,0
    
    gain_table_config:<gaintable AD9361 type=FULL dest=3 start=1300000000 end=4000000000>
    
    gain_table_config:-3, 0x00, 0x00, 0x20
    
    gain_table_config:-3, 0x00, 0x00, 0x00
    
    gain_table_config:-3, 0x00, 0x00, 0x00
    
    gain_table_config:-2, 0x00, 0x01, 0x00
    
    gain_table_config:-1, 0x00, 0x02, 0x00
    
    gain_table_config:0, 0x00, 0x03, 0x00
    
    gain_table_config:1, 0x00, 0x04, 0x00
    
    gain_table_config:2, 0x00, 0x05, 0x00
    
    gain_table_config:3, 0x01, 0x03, 0x20
    
    gain_table_config:4, 0x01, 0x04, 0x00
    
    gain_table_config:5, 0x01, 0x05, 0x00
    
    gain_table_config:6, 0x01, 0x06, 0x00
    
    gain_table_config:7, 0x01, 0x07, 0x00
    
    gain_table_config:8, 0x01, 0x08, 0x00
    
    gain_table_config:9, 0x01, 0x09, 0x00
    
    gain_table_config:10, 0x01, 0x0A, 0x00
    
    gain_table_config:11, 0x01, 0x0B, 0x00
    
    gain_table_config:12, 0x01, 0x0C, 0x00
    
    gain_table_config:13, 0x01, 0x0D, 0x00
    
    gain_table_config:14, 0x01, 0x0E, 0x00
    
    gain_table_config:15, 0x02, 0x09, 0x20
    
    gain_table_config:16, 0x02, 0x0A, 0x00
    
    gain_table_config:17, 0x02, 0x0B, 0x00
    
    gain_table_config:18, 0x02, 0x0C, 0x00
    
    gain_table_config:19, 0x02, 0x0D, 0x00
    
    gain_table_config:20, 0x02, 0x0E, 0x00
    
    gain_table_config:21, 0x02, 0x0F, 0x00
    
    gain_table_config:22, 0x02, 0x10, 0x00
    
    gain_table_config:23, 0x02, 0x2B, 0x20
    
    gain_table_config:24, 0x02, 0x2C, 0x00
    
    gain_table_config:25, 0x04, 0x27, 0x20
    
    gain_table_config:26, 0x04, 0x28, 0x00
    
    gain_table_config:27, 0x04, 0x29, 0x00
    
    gain_table_config:28, 0x04, 0x2A, 0x00
    
    gain_table_config:29, 0x04, 0x2B, 0x00
    
    gain_table_config:30, 0x24, 0x21, 0x20
    
    gain_table_config:31, 0x24, 0x22, 0x00
    
    gain_table_config:32, 0x44, 0x20, 0x20
    
    gain_table_config:33, 0x44, 0x21, 0x00
    
    gain_table_config:34, 0x44, 0x22, 0x00
    
    gain_table_config:35, 0x44, 0x23, 0x00
    
    gain_table_config:36, 0x44, 0x24, 0x00
    
    gain_table_config:37, 0x44, 0x25, 0x00
    
    gain_table_config:38, 0x44, 0x26, 0x00
    
    gain_table_config:39, 0x44, 0x27, 0x00
    
    gain_table_config:40, 0x44, 0x28, 0x00
    
    gain_table_config:41, 0x44, 0x29, 0x00
    
    gain_table_config:42, 0x44, 0x2A, 0x00
    
    gain_table_config:43, 0x44, 0x2B, 0x00
    
    gain_table_config:44, 0x44, 0x2C, 0x00
    
    gain_table_config:45, 0x44, 0x2D, 0x00
    
    gain_table_config:46, 0x44, 0x2E, 0x00
    
    gain_table_config:47, 0x44, 0x2F, 0x00
    
    gain_table_config:48, 0x44, 0x30, 0x00
    
    gain_table_config:49, 0x44, 0x31, 0x00
    
    gain_table_config:50, 0x64, 0x2E, 0x20
    
    gain_table_config:51, 0x64, 0x2F, 0x00
    
    gain_table_config:52, 0x64, 0x30, 0x00
    
    gain_table_config:53, 0x64, 0x31, 0x00
    
    gain_table_config:54, 0x64, 0x32, 0x00
    
    gain_table_config:55, 0x64, 0x33, 0x00
    
    gain_table_config:56, 0x64, 0x34, 0x00
    
    gain_table_config:57, 0x64, 0x35, 0x00
    
    gain_table_config:58, 0x64, 0x36, 0x00
    
    gain_table_config:59, 0x64, 0x37, 0x00
    
    gain_table_config:60, 0x64, 0x38, 0x00
    
    gain_table_config:61, 0x65, 0x38, 0x20
    
    gain_table_config:62, 0x66, 0x38, 0x20
    
    gain_table_config:63, 0x67, 0x38, 0x20
    
    gain_table_config:64, 0x68, 0x38, 0x20
    
    gain_table_config:65, 0x69, 0x38, 0x20
    
    gain_table_config:66, 0x6A, 0x38, 0x20
    
    gain_table_config:67, 0x6B, 0x38, 0x20
    
    gain_table_config:68, 0x6C, 0x38, 0x20
    
    gain_table_config:69, 0x6D, 0x38, 0x20
    
    gain_table_config:70, 0x6E, 0x38, 0x20
    
    gain_table_config:71, 0x6F, 0x38, 0x20
    
    gain_table_config:</gaintable>
    
    in_out_voltage_filter_fir_en:0
    
    in_temp0_input:29825
    
    in_voltage0_gain_control_mode:slow_attack
    
    in_voltage0_hardwaregain:71.000000 dB
    
    in_voltage0_hardwaregain_available:[-3 1 71]
    
    in_voltage0_rf_port_select:A_BALANCED
    
    in_voltage0_rssi:122.25 dB
    
    in_voltage2_offset:57
    
    in_voltage2_raw:578
    
    in_voltage2_scale:0.305250
    
    in_voltage_bb_dc_offset_tracking_en:1
    
    in_voltage_filter_fir_en:0
    
    in_voltage_gain_control_mode_available:manual fast_attack slow_attack hybrid
    
    in_voltage_quadrature_tracking_en:1
    
    in_voltage_rf_bandwidth:18000000
    
    in_voltage_rf_bandwidth_available:[200000 1 56000000]
    
    in_voltage_rf_dc_offset_tracking_en:1
    
    in_voltage_rf_port_select_available:A_BALANCED B_BALANCED C_BALANCED A_N A_P B_N B_P C_N C_P TX_MONITOR1 TX_MONITOR2 TX_MONITOR1_2
    
    in_voltage_sampling_frequency:3999999
    
    in_voltage_sampling_frequency_available:[2083333 1 61440000]
    
    grep: multichip_sync: Permission denied
    
    name:ad9361-phy
    
    out_altvoltage0_RX_LO_external:0
    
    out_altvoltage0_RX_LO_fastlock_load:0
    
    out_altvoltage0_RX_LO_fastlock_save:0 103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103
    
    out_altvoltage0_RX_LO_fastlock_store:0
    
    out_altvoltage0_RX_LO_frequency:2400000000
    
    out_altvoltage0_RX_LO_frequency_available:[325000000 1 3800000000]
    
    out_altvoltage0_RX_LO_powerdown:0
    
    out_altvoltage1_TX_LO_external:0
    
    out_altvoltage1_TX_LO_fastlock_load:0
    
    out_altvoltage1_TX_LO_fastlock_save:0 94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94
    
    out_altvoltage1_TX_LO_fastlock_store:0
    
    out_altvoltage1_TX_LO_frequency:2449999998
    
    out_altvoltage1_TX_LO_frequency_available:[325000000 1 3800000000]
    
    out_altvoltage1_TX_LO_powerdown:0
    
    out_voltage0_hardwaregain:-10.000000 dB
    
    out_voltage0_hardwaregain_available:[-89.750000 0.250000 0.000000]
    
    out_voltage0_rf_port_select:A
    
    out_voltage0_rssi:0.00 dB
    
    out_voltage2_raw:306
    
    out_voltage2_scale:1.000000
    
    out_voltage3_raw:306
    
    out_voltage3_scale:1.000000
    
    out_voltage_filter_fir_en:0
    
    out_voltage_rf_bandwidth:18000000
    
    out_voltage_rf_bandwidth_available:[200000 1 40000000]
    
    out_voltage_rf_port_select_available:A B
    
    out_voltage_sampling_frequency:3999999
    
    out_voltage_sampling_frequency_available:[2083333 1 61440000]
    
    rssi_gain_step_error:lna_error: 0 0 0 0
    
    rssi_gain_step_error:mixer_error: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    
    rssi_gain_step_error:gain_step_calib_reg_val: 0 0 0 0 0
    
    rx_path_rates:BBPLL:1023999992 ADC:31999999 R2:15999999 R1:7999999 RF:3999999 RXSAMP:3999999
    
    trx_rate_governor:nominal
    
    trx_rate_governor_available:nominal highest_osr
    
    tx_path_rates:BBPLL:1023999992 DAC:31999999 T2:15999999 T1:7999999 TF:3999999 TXSAMP:3999999
    
    uevent:MAJOR=252
    
    uevent:MINOR=0
    
    uevent:DEVNAME=iio:device0
    
    uevent:DEVTYPE=iio_device
    
    uevent:OF_NAME=ad9361-phy
    
    uevent:OF_FULLNAME=/amba/spi@e0006000/ad9361-phy@0
    
    uevent:OF_COMPATIBLE_0=adi,ad9363a
    
    uevent:OF_COMPATIBLE_N=1
    
    xo_correction:39999990
    
    xo_correction_available:[39991991 1 40007989]
    
    # 
    
    CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.8 | VT102 | Offline | ttyUSB8                                                                                                                                    
    
    
    
    

    And then also a register?

    # iio_reg ad9361-phy 0x37
    0xa
    #

    -Michael
     

  • Thanks, will do as soon as I duplicate the issue

  • One more question do you see this issue only on one setup, or can you replicate this on different units as well?

    -Michael

  • We have seen the issue on multiple SoMs but by far a minority. So out of about 1500 SoMs I'd say that I have seen the issue personally about 20 times. It is likely triggered by a specific sequence in our test is documented and are following.

Reply Children
No Data