Calibration Error [Fixed]


I am getting calibration errors: MCU error 2 (CGEN tune failed). CGEN is 393.216 MHz, I am performing calibration as part of the transmit initialisation. the radio is set to 145 MHz for transmit.

Calibrating the receiver with CGEN = 320MHz is OK.

Any thoughts please?

Another one for @IgnasJ.

MCU seems to be calibrating ok with CGEN at 393.216 MHz. Can you save chip configuration to file right before calibration start?


The file is here:

The calibration fails for the transmit channel 0, bandwidth 3.072 MHz.

Just tried on my LimeSDR, it works ok, all settings also looks good.
During calibration the actual CGEN frequency that is being tuned is 414,72 MHz. I suggest try to set CGEN frequency to 414,72 MHz using LimeSuiteGUI to see if it succeeds to tune it there.

I read the CGEN with:

LMS_GetClockFreq(m_pDevice, LMS_CLOCK_CGEN, &fFrequency);

so am I am sure what the CGEN is. Anyway, I get an error :frowning: . I’ll try the suite…

The calibration algorithm internally changes CGEN frequency from your 393.216 MHz to nearest multiple of 46.08 MHz (which is 414.72 MHz).
I’m suggesting to use LimeSuiteGUI as it would be easier to check what’s going on if the frequency fails.
If it fails, try to increase “Scales VCO bias current” and try again. if it succeeds with the initial value, then check how wide is the CSW_VCO_CGEN locking range, while changing CSW_VCO_CGEN value look at VCO comparators, at which point their values become different from High:1 Low:0


This assumes I know what the LimeSuiteGUI is doing, which I don’t. As the API returns an error message I need to find out how to resolve this error, determine whether it’s my hardware or a parameter which needs to be set.

In the above window I don’t see a Calibrate button.

In summary - if I am to support TX on the Lime-USB then I must be able to understand the errors generated by the library and provide meaningful responses to users, the vast majority will not understand LimeSuiteGUI (I don’t know what it’s doing).

So I do need help please.

1 Like

I’ve tried your configuration, parameters are good and it should work. I suspect this could be some hardware nuance, the only reason why CGEN tune could fail would be if the VCO cannot achieve desired frequency. To know for sure those marked parameters would have to be tested, there seems to be no direct way to manipulate CGEN tuning using API without being affected by other settings.

Try this:

  1. Open LimeSuiteGUI
  2. At the top Click Options->Connection settings, and connect to the board
  3. At the top Click Open, select your configuration file that you attached here
  4. Switch to CLKGEN tab
  5. near the center top part, there is “Frequency controls”, change CLK_H(MHz) to 414.72
  6. Click “Calculate” button
    If it fails and shows any error, then it’s a hardware issue and would need further investigation to see if it could be worked around on your board.


This I now understand and it worked correctly in LimeSuiteGUI. I expect this is an error in the sequence of commands used in my code to start the TX stream, I’ve looked at the samples and don’t see a difference. One thing i see in the diagnostics is: SetPllFrequency: error configuring phase when calling LMS_Init().

Frustrating, but getting there slowly :slight_smile: .

I’ll carry on digging…

1 Like

That would be error comming from FPGA gateware, it seems it happens when Tx and Rx sampling rates are different. Maybe @IgnasJ knows more about this.

Thanks :slight_smile:

Back to CGEN - here’s a logfile with the same processing, here we have level 1 and level 4 diagnostics. Maybe this helps, I don’t know. I will now try with RX and TX sample rates at 3.072 MHz, at the moment I have different sample rates.

Maybe I should use channel 0 at 10 MHz for receive, and channel 1 at 3.072 MHz for transmit.

Problem solved by manually selecting firmware 2.18 instead of letting LimeSuiteGUI install 2.17.

Are you sure you are using latest LimeSuite? It updates to GW 2.18 since Sep 28.