MCU error 3 (SXR tune failed) on LimeSDR USB

Hi!

I wanted to check LimeGPS project, but was unable to do this. Right now I’m facing calibration issues when running it:

Opening and initializing device...
Reference clock 30.72 MHz
Sample rate: 2500000.0 Hz (Host) / 2500000.0 Hz (RF)
Calibrating...
Tx Calibration: MCU error 3 (SXR tune failed)
Warning: Failed to calibrate device: Tx Calibration: MCU error 3 (SXR tune failed)
Setup TX stream...
Creating GPS task...
Using static location mode.
xyz =   1335616.6,  -4648136.6,   4144388.5
llh =   40.785092,  -73.968285,        10.0
     8.382e-09   -7.451e-09   -5.960e-08    5.960e-08
     8.806e+04   -3.277e+04   -1.966e+05    1.966e+05
     1.86264514923e-09   3.55271367880e-15     233472      1987
    18
Start time = 2018/02/04,00:00:00 (1987:0)
...

As a result I don’t see any transmission of GPS signal. Is there a wiring mistake or some issues with hardware?

P.S. platform: Windows 10, gw version 2.21. LimeQuickTest shows everything is ok. LimeUtil --timing shows same MCU error 3 or MCU error 5.

Thanks.

Doesn’t look like it’s been updated in around a year and so may not work with the latest version of Lime Suite. The best thing to do would be to raise an issue on the GitHub tracker.

Thanks @andrewback . I also tried gps-sdr-sim, an updated version of LimeGPS, and have same issues.
Anyway I still interrested what could cause this “MCU error 3” to raise during TX calibrartion. Seems like it related to RX calibration. Also I have same errors also in LimeUtil --timing during ‘TX corrections’ and ‘RX corrections’ loops. The latter shows ‘MCU error 3’ or ‘MCU error 5’.

@IgnasJ perhaps you could advise.

I’ve checked this through LimeSuite and I’m getting the same error, when trying to set 1575.74 MHz in SXT tab (Calculate + Tune) and pressing ‘Calibrate TX’ in ‘Calibrations’ tab after.

Edit: although a lot of other frequencies are calibrated without issues.

  1. Does setting frequency in SXR tab to around the same as in SXT (~1575MHz) work (Calculate+tune does not produce errors)? If it still does not work then there may be something wrong with your board or power delivery.
  2. Do you always get the error or only when the board is cold/heated up?
    Also, press “Default” button before setting frequency in SXT/SXR tab to make sure the board is not in some unknown state.
  1. Typically no. I’ve tried several times and ‘calculate+tune’ worked fine. The issue only rise during calibration on specific frequencies.
  2. The behaviour is always the same and doesn’t depend on board temperature.

I do not get that error message in the LimeSuite GUI, could it be that you are doing something different. Below is exactly what I did to try and recreate your error message. Maybe I’m not doing something that you are.

  1. I run Limesuite.
  2. I press F1, and the version shown is 19.04.0
  3. I goto Options->ConnectionSettings
  4. I select/highlight my device and click on Connect. At the bottom of the display I see “LimeSDR-USB FW:4 HW:4 Protocol:1 GW:2.21 Ref Clk: 30.72 MHz”.
  5. I click on the “Default” button, to put the board into a known good state.
  6. I select the SXT tab/leaf and in the “Frequency, MHz” box I type in 1575.74 and press Calculate and Tune.
  7. I select the SXR tab/leaf and in the “Frequency, MHz” box I type in 1575.74 and press Calculate and Tune.
  8. I select the Calibrations tab/leaf and click on “Calibrate TX” and a click OK pop-up alert box saying “Tx Calibration Finished” appears, to which I click OK.
  9. Still in the Calibrations tab/leaf I click on “Calibrate RX” and a click OK pop-up alert box saying “Rx Calibration Finished” appears, to which I click OK.

Actually on screenshot above a result of similar procedure skipping steps 7 and 9. For other frequencies results could be successful. But several others show such error during calibration.

I’ve checked one more time: there are several frequency ranges I’m unable to ‘TX calibrate’, but ‘RX calibrate’ works fine. E.g. 30 MHz, 400 MHz, 790 MHz, 1575 MHz.


Also here is my LimeUtil --timing output where I saw the first signs of the issue:

C:\Program Files\PothosSDR\bin>LimeUtil.exe --timing
Connected to [LimeSDR-USB, media=USB 3.0, module=FX3, serial=0009060B0046220C, index=0]
Creating instance of LMS7002M:

Timing basic operations:
  >>> SPI write register:       177.698 us
  >>> SPI read register:        185.737 us
  >>> TSP NCO setting:          1309.33 us
  >>> RFE gain setting:         374.987 us
  >>> TRF gain setting:         742.616 us

Timing tuning operations:
  >>> CGEN PLL tuning:          25.8269 ms
  >>> RF PLL tuning:            70.7425 ms
  >>> TBB filter tuning:        91.8032 ms
  >>> RBB filter tuning:        148.211 ms
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
Tx Calibration: MCU error 3 (SXR tune failed)
  >>> TX corrections:           88.194 ms
  >>> RX corrections:           167.179 ms

Done timing!

The issue does not seem to affect all boards/setups as I am unable to replicate it. That is why I suggested that it may be power, temperature or defective board and wanted to make sure that we use same settings (loaded by ‘Default’ button).

It is strange that SXR tune works from SXR tab but not during calibrations. Maybe @Karolis or @ricardas could provide some insights on that, as they have more knowledge of how MCU calibration works.

Any suggestion what I should do with my board?

Hello @nepo, sorry for the delayed response.

In “Capture2.png” logs, i see that there were successful TX calibration procedures prior. After that, you set both SXR and SXT to the same frequency (i assume single frequency operation is wanted).

Could you try:

  1. Add a frequency offset to SXR and SXT (for example 1575 and 1570 MHz) and then try calibrating.
  2. If same frequency is needed for RX and TX, make sure that SXR VCO is powered down (“VCO” check box is marked in SXR) and LO buffers from SXT are active (check box “LO buffer from SXT to SXR” is not checked). In this scenario, both RX and TX mixer source will be SXT PLL.
  3. Increase “Scales VCO bias current” for but SXR and SXT PLL’s to 255.

Regards,
Karolis

Hello @Karolis. Thanks for your answer! Currently my tries were to make transmit on several frequencies working. I’ve tried what you wrote:

  1. Set SXT to 1575 and SXR to 1570. Pressed Calculate + Tune + Calibrate:

    [21:03:25] INFO: SXT frequency set to 1575.000000 MHz
    [21:03:41] INFO: SXR frequency set to 1570.000000 MHz
    [21:03:47] INFO: Rx calibration finished
    [21:03:49] INFO: Rx Calibrated
    [21:03:50] ERROR: Tx Calibration: MCU error 3 (SXR tune failed)
    
  2. Reset board. Set to 1575 both SXR and SXT. Pressed Calculate + Tune, set VCO for SXR and unset LO buffer for SXT. Tried to calibrate:

    [21:06:19] INFO: SXR frequency set to 1575.000000 MHz
    [21:06:23] INFO: SXT frequency set to 1575.000000 MHz
    [21:06:32] ERROR: Rx calibration: MCU error 3 (SXR tune failed)
    [21:06:34] ERROR: Tx Calibration: MCU error 3 (SXR tune failed)
    
  3. Increased PLL’s to 255 for SXR and SXT. Tried calibrate and it seems worked.

    [21:07:05] INFO: Rx calibration finished
    [21:07:06] INFO: Rx Calibrated
    [21:07:07] INFO: Tx calibration finished
    [21:07:08] INFO: Tx Calibrated
    

My questions are:

  1. Is it possible to do this only for transmission (SXT)? I’ve tried to increase PLL and seems doesn’t work.
  2. Do I need to patch somehow software (e.g. explicitly set PLLs, VCO, LO buffer) if it fails to calibrate?
  3. Is there a simple way to check that with your options set board working correctly?

Thanks.

I’m facing the same error ("[ERROR] Tx Calibration: MCU error 3 (SXR tune failed)") but in a differnet context. I’m not sure if my issue is the same, but wanted to share it here first before I open a new topic or issue.

I want to use SoapySDR to transmit signals on frequencies lower than 30 MHz with the LimeSDR Mini. As far as I understand, this needs to be achieved in the numeric domain through the NCO, which shifts my signal lower than TXPLL’s frequency.

Digging into the source code of LimeSuite, I figured that SoapyLMS7::setFrequency calls (if I got it right) LMS7_LimeSDR_mini::SetFrequency, which then does the “magic” stuff required to send lower than 30 MHz (setting the NCO). However, in practice, I get the following (listing the C calls I made first):

SoapySDRDevice_setSampleRate(device, SOAPY_SDR_TX, 0, 384000);
SoapySDRDevice_setFrequency(device, SOAPY_SDR_TX, 0, 29025e3, NULL);
SoapySDRDevice_setAntenna(device, SOAPY_SDR_TX, 0, "BAND2");
SoapySDRDevice_setGainElement(device, SOAPY_SDR_RX, 0, "PAD", 52.0);
SoapySDRDevice_setGainElement(device, SOAPY_SDR_RX, 0, "IAMP", 0.0);
SoapySDRDevice_setupStream(device, &stream, SOAPY_SDR_TX, SOAPY_SDR_CF32, NULL, 0, NULL);
SoapySDRDevice_activateStream(device, stream, 0, 0, 0);

[INFO] Make connection: 'LimeSDR Mini [USB 2.0] 1D3AC7FE409032'
[INFO] Reference clock 40.00 MHz
[INFO] Device name: LimeSDR-Mini
[INFO] Reference: 40 MHz
[INFO] LMS7002M register cache: Disabled
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 5 MHz.Real pole 1st order filter set to 2.5 MHz. Preemphasis filter not active
[INFO] TX LPF configured
[ERROR] Tx Calibration: MCU error 3 (SXR tune failed)

I tried to set the “RF” and “BB” (NCO) frequency separately to get rid of the error:

[...]
SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "RF", 30000e3, NULL);
SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "BB", -975e3, NULL);
[...]

[...]
[ERROR] Tx Calibration: MCU error 3 (SXR tune failed)

I helped myself with setting the RF frequency a bit higher than 30 MHz, which (at first) seemed to work:

[...]
SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "RF", 33000e3, NULL);
SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "BB", -3975e3, NULL);
[...]

[INFO] Make connection: 'LimeSDR Mini [USB 2.0] 1D3AC7FE409032'
[INFO] Reference clock 40.00 MHz
[INFO] Device name: LimeSDR-Mini
[INFO] Reference: 40 MHz
[INFO] LMS7002M register cache: Disabled
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 5 MHz.Real pole 1st order filter set to 2.5 MHz. Preemphasis filter not active
[INFO] TX LPF configured
[INFO] Tx calibration finished

However, when I later measured the actual RF output, this approach caused massive attenuation. I assumed this was because of the TX filter bandwidth being too low (5 MHz = ±2.5 MHz < 3.975 MHz). Trying to solve this by setting the bandwidth raised the calibration error again :sob:

SoapySDRDevice_setBandwidth(device, SOAPY_SDR_TX, 0, 11925e3);
SoapySDRDevice_setSampleRate(device, SOAPY_SDR_TX, 0, 384000);
SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "RF", 33000e3, NULL);
SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "BB", -3975e3, NULL);
[...]

[...]
[ERROR] Tx Calibration: MCU error 3 (SXR tune failed)

Note that I set the bandwidth prior to setting the sample rate, as otherwise the filter gets (unnecessarily) calibrated twice (while still throwing the MCU error 3).

I find it noteable that in those cases where the “MCU error 3 (SXR tune failed)” error occurred, the (halved) TX bandwidth was set high enough to cover both the RF (TXPLL) and BB (NCO) frequencies. Setting it lower doesn’t solve my problem though, as then my actual signal will suffer massive attenuation.

I wonder if this is a bug in the software or a hardware problem. And if it’s the hardware, whether it is just my unit or it’s reproducible for anyone else. Any advice is appreciated.

Further testing revealed that the problem seems independent of the “BB” (NCO) frequency. The problem seems to occur whenever the “RF” frequency is close to 30 MHz and the bandwidth is increased (which just happens automatically when you use the “SoapySDRDevice_setFrequency” C-call with a target frequency below 30 MHz.

If I manually set the RF and BB frequencies and if I set the bandwidth only after activating the stream, then there is no error, but I assume the calibration will be wrong then. :slightly_frowning_face: Does anyone know what’s the right way to initialize the LimeSDR Mini with SoapySDR in C? Where can I find documentation on this? Can anyone else reproduce my problems with an “RF” frequency close to 30 MHz and an increased TX bandwidth?

I did some further research to figure out where the error arises in my use case. I could track it down to function LMS7002M::CalibrateTx, more precisely: status = mcuControl->WaitForMCU(1000), which returns a value other than MCU_BD::MCU_NO_ERROR, that is then caught in the following if-clause, which reports the error:

mcuControl->RunProcedure(useExtLoopback ? MCU_FUNCTION_CALIBRATE_TX_EXTLOOPB : MCU_FUNCTION_CALIBRATE_TX);
status = mcuControl->WaitForMCU(1000);
if(status != MCU_BD::MCU_NO_ERROR)
    return ReportError(EINVAL, "Tx Calibration: MCU error %i (%s)", status, MCU_BD::MCUStatusMessage(status));

When my RF frequency is set to 33 MHz, I can calibrate with bandwidths up to 11563000 Hz but a bandwidth of 11563001 Hz or higher seems to cause errors. The boundary where the error occurs seems to be dependent on the RF frequency: if the RF frequency is set to 29.999 Mhz, then bandwidths up to 11558000 Hz seem to work fine, but any bandwidth greater than or equal to 11558001 Hz seem to make trouble. The BB (NCO) frequency seems to be irrelevant for the bandwidth boundary.

I wonder if this is a limitation of the LMS7002M chip or a firmware bug? Can it possibly be fixed in the Lime Suite?

I used Lime Suite version 20.01.0.

The first thing I’d suggest trying is to build Lime Suite from source using git master:

https://wiki.myriadrf.org/Lime_Suite#Building_from_source

(omit checkout stable step)

See how you get on with this and if issues persist a colleague in the engineering team can take a look.

Thank you for proposing trying the master branch. I checked out the git repository, last commit 1b0309b385547db64ef116618c774c8ce62de0d5.

This leads to a new error:

[ERROR] Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?)

This new error even occurs on frequency/bandwidth combinations that previously worked fine, namely an “RF” frequency of 33 MHz and a bandwidth of 11563000, which worked fine with Lime Suite stable version 20.01.0. The new error, however, doesn’t seem occur on a hard boundary.

Meanwhile I reconfirmed that the boundary for version 20.01.0 is indeed 11563000, even on a different day (slightly different temperature conditions).

  • RF = 33 MHz and 11563000 Hz bandwidth work fine with Lime Suite version 20.01.0,
  • RF = 33 MHz and 11563001 Hz bandwidth reproducibly fail with Lime Suite version 20.01.0,
  • Either of the above fail with the new error “[ERROR] Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?)” when I use the git master.

Hope that helps figuring out what goes wrong?

What were the gains set to?