Problem
After calling adi_adrv9025_InitCalsRun() with ADI_ADRV9025_TX_LO_LEAKAGE_INTERNAL (0x400), about half of the channel runs leave the LO line at -10 to -20 dBm (TX attenuation 10 dB) instead of below -65 dBm. The success / failure of these init cals runs are independent of each other and also independent of the channel. No matter if there is a high LO leakage or not, the API always reports success even though this failure is present.
Potential Solution
I have found many suggestions in this forum by Analog Devices to connect the Tx with a coupler after the PA to the ORx port to improve the LO leakage tracking etc - but it shouldn't outright fail the initial calibration if this connection is not present. So I found the following solution;
The firmware keeps a status record for every calibration, and the host can read it with the GET CAL_STATUS command. The existing API function adi_adrv9025_TrackingCalTxLolStatusGet() does this for the LOL tracking calibration and reads the first 20 bytes. We send the same command, but for the internal LOL init calibration (object ADRV9025_CPU_OBJECTID_TXLOLINT_INIT) and read 120 bytes. Words 28 and 29 of that record are two floats that show how much LO leakage the calibration left: sqrt(w28² + w29²).
From in total 300 runs, it was above 850 when the LO leakage was still present, and below 1.4 when the init cal actually suceeded. This was tested with the LOs at different frequencies from 650 MHz to 5.9 GHz.
So the attached patch adds a new API function, adi_adrv9025_TxLolInternalInitCalCheck(). For each channel it reads that record and, while the value is above 10, runs the calibration again on that channel.
Root Cause?
Of course this is a bit of a hack this re-try mechanism. The actual root cause is probably in the correlator that gives back wrong results in about 50% of the cases that should actually be rejected. This is then further compounded by the aggregation mechanism => in bad runs when the correlator is not outputting correct values for the very first pulse train, later good correlations do not manage to overturn this bad measurement. So an easy fix could be to just repeat this measurement of correlating the pulse train when it fails.
Could you check this and maybe provide a firmware update for this so the fix is cleaner? Thanks a lot.