MCU error 3 (SXR tune failed) on LimeSDR USB

Apparently, the error (with the master branch) isn’t reproducible right now (the device was connected to my computer for a while and maybe heated up meanwhile when I tried again and couldn’t reproduce it). But the error definitely was there earlier and I could reproduce it by switching between version 20.01.0 and the git master branch back and forth several times earlier.

I had the following setup:

SoapySDRKwargs args = {};
if (SoapySDRKwargs_set(&args, "driver", "lime")) { /*...*/ }
SoapySDRDevice *device = SoapySDRDevice_make(&args);
SoapySDRKwargs_clear(&args);
if (SoapySDRDevice_setBandwidth(device, SOAPY_SDR_TX, 0, 11563000)) { /*...*/ }  // or 11563001, see my comment above
if (SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "BB", -3975e3, NULL)) {
if (SoapySDRDevice_setAntenna(device, SOAPY_SDR_TX, 0, "BAND2")) {
if (SoapySDRDevice_setGainElement(device, SOAPY_SDR_RX, 0, "PAD", 52.0)) {
if (SoapySDRDevice_setGainElement(device, SOAPY_SDR_RX, 0, "IAMP", 0.0)) {
if (SoapySDRDevice_setupStream(device, &stream, SOAPY_SDR_TX, SOAPY_SDR_CF32, NULL, 0, NULL)) stream = NULL;
if (!stream) { /*...*/ }
if (SoapySDRDevice_activateStream(device, stream, 0, 0, 0)) { /*...*/ }

Kind regards,
Jan

The error (“Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?)”) just occurred again after having the device disconnected for a couple of minutes. It’s too early to deduce a pattern here though.

Seems to be a temperature issue. When the device is connected for a while it works. Disconnecting and reconnecing it shortly after also causes no problem. But disconnecting the device for half a minute or longer will lead to the error unless I wait for a while again.

I will do further tests at some later point to see if the problem is generally solved when the device has heated up. (But in either case it’s still a bit spooky.)

Update:

Meanwhile I also found a scenario where I get the original (“[ERROR] Tx Calibration: MCU error 3 (SXR tune failed)”) with the current git version 1b0309b385547db64ef116618c774c8ce62de0d5:

SoapySDRDevice_setFrequency(s->device, SOAPY_SDR_TX, 0, 28000e3, NULL);

with PAD set to 52.0 and IAMP set to 0.0 gives me:

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

And waiting for the device to heat up (when the other error vanishes) doesn’t help. No idea what’s going on. :sob:

Question: Has anyone successfully operated the LimeSDR Mini on frequencies below 30 MHz without a too-low bandwidth (which would cause massive attenuation), and if so: How is your setup and initialization sequence? Do you use or skip calibration?

Hello @DL9JBE,

Could you share register dump, please.

Hi all,

I received a new LimeSDR Mini, so I was able to compare different hardware units to rule out any hardware issues.

These are my results:

The following behavior was reproducible with the new hardware (which has a metal casing, room temperature was about 22°C), both with LimeSuite-20.07.2 and the master branch (3858ed79b95a040145629f95bcaa75e1ea623c6d):

A bandwidth of 11563001 Hz or higher yields an [ERROR] Tx Calibration: MCU error 3 (SXR tune failed).

When I use the old device, I occasionally get [ERROR] Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?) when I sent a bandwidth of 11563000 Hz.

So the MCU error 5 seems to be related to my old hardware (which has no metal casing or heat sink, while the new hardware is in metal casing). The MCU error 3 is an independent issue that occurs with both hardware units and with both LimeSuite versions (20.07.2 and master).

My test setup:

#include <SoapySDR/Device.h>
#include <SoapySDR/Formats.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv) {
  SoapySDRDevice *device;
  SoapySDRStream *tx;
  SoapySDRKwargs args = {};
  if (SoapySDRKwargs_set(&args, "driver", "lime")) abort();
  device = SoapySDRDevice_make(&args);
  SoapySDRKwargs_clear(&args);
  if (SoapySDRDevice_setSampleRate(device, SOAPY_SDR_RX, 0, 384000)) abort();
  if (SoapySDRDevice_setBandwidth(device, SOAPY_SDR_TX, 0, 11563001)) abort();  // 11563000 works with new hardware
  if (SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "RF", 33e6, NULL)) abort();
  if (SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "BB", 0, NULL)) abort();
  if (SoapySDRDevice_setAntenna(device, SOAPY_SDR_TX, 0, "BAND2")) abort();
  if (SoapySDRDevice_setGainElement(device, SOAPY_SDR_TX, 0, "PAD", 52.0)) abort();
  if (SoapySDRDevice_setGainElement(device, SOAPY_SDR_TX, 0, "IAMP", 0.0)) abort();
  if (SoapySDRDevice_setupStream(device, &tx, SOAPY_SDR_TX, SOAPY_SDR_CF32, NULL, 0, NULL)) tx = NULL;
  if (!tx) abort();
  if (SoapySDRDevice_activateStream(device, tx, 0, 0, 0)) {
    fprintf(stderr, "activateStream error: %s\n", SoapySDRDevice_lastError());
    return 1;
  }
  if (SoapySDRDevice_deactivateStream(device, tx, 0, 0)) fprintf(stderr, "Could not deactivate stream!\n");
  if (SoapySDRDevice_closeStream(device, tx)) fprintf(stderr, "Could not close stream!\n");
  if (SoapySDRDevice_unmake(device)) abort();
  return 0;
}

Do I need to update the firmware of the old hardware unit? If yes, how can I do it?

@Zack: I would like to provide one, but I don’t know what that is and how I get one. What do I need to do to get a register dump?

Connect to the board using LimeSuiteGUI and use “Save” button.

I wasn’t sure if I should do it after or before using my test program above, so I did both. Here are the respective files for the old and new hardware:

Note that my test was done on FreeBSD (with the USB reset omitted yet, we’re still working on fixing that for FreeBSD). If necessary, I can repeat them on Linux.

Amendment:

When I let the test program run, the LimeSuiteGUI was closed. I ran the test program (that caused MCU error 3), then started LimeSuiteGUI afterwards, connected to the board, and saved the dump.

If I need to keep LimeSuiteGUI open during the test, let me know, please. I would then redo the dump (in whichever way needed).

Maybe someone can try to compile my C test program and check if the error is reproducible. I made it available for download (click here to download).

I compiled it with: cc -o limetest -Wall -g -o limetest -I /usr/local/include -L /usr/local/lib limetest_2020-09-01_1134Z.c -lSoapySDR

Note that on error, the program will just abort (and write a core dump). That’s the output if I run the code:

% ./limetest 
[INFO] Make connection: 'LimeSDR Mini [USB 3.0] 1D589769035A75'
[INFO] Reference clock 40.00 MHz
[INFO] Device name: LimeSDR-Mini
[INFO] Reference: 40 MHz
[INFO] LMS7002M register cache: Disabled
[INFO] RX LPF configured
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 11.563 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)

Could anyone please let me know if I’m the only one facing this behavior? I have tested it already with different hardware units. Compiling and running the program should be easy to do.

I get the same error

1 Like

Thanks a lot for testing. This shows that it isn’t just a problem with my computer or particular hardware units but a general problem.

Assuming my initialization is correct (not sure where I could have made a mistake?) this is a big problem when I want to transmit on frequencies below 30 MHz: Either the TX filter bandwidth is too small and I have to deal with massive unwanted attenuation, or the TX filter bandwidth is too big such that calibration fails (unless the error is bogus?)

Now I wonder on which layer this problem is. Is it a problem of the LimeSDR Mini’s firmware? In particular, has anyone ever successfully sent out signals below 27 MHz, for example, that are reaching 7 dBm without skipping calibration? Or is this “just” a problem of the SoapySDR driver or maybe only the C/C++ interface?

I just double checked everything, and I did find an error indeed. It should have been

SoapySDRDevice_setSampleRate(device, SOAPY_SDR_TX, 0, 384000)

instead of

SoapySDRDevice_setSampleRate(device, SOAPY_SDR_RX, 0, 384000)

You can download the corrected C file here. However, the error is the same:

[INFO] Make connection: 'LimeSDR Mini [USB 3.0] 1D589769035A75'
[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] Filter calibrated. Filter order-4th, filter bandwidth set to 11.563 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)

Note that the filter now gets calibrated twice. But the MCU error 3 is still occurring.

Side note: If I set the sample rate later in the process, the filter gets calibrated just once (but the sent out signal isn’t correct, as I discovered in a different context). Again, I’m missing documentation about proper initialization using the SoapySDR C API :disappointed:

But in both cases I get “MCU error 3 (SXR tune failed)” :weary:

I get the same thing…

[INFO] Make connection: ‘LimeSDR-USB [USB 3.0] 9072C00D5071E’
[INFO] Reference clock 30.72 MHz
[INFO] Device name: LimeSDR-USB
[INFO] Reference: 30.72 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] Filter calibrated. Filter order-4th, filter bandwidth set to 11.563 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)

Hi, I know this topic has been dormant and everyone has probably moved on, but I’d really like to use the LimeSDR USB I purchased about a year ago on Alibaba so … thought I’d try to revive it (seems there was no solution, just ‘radio silence’ ).

Anyway, I’m getting the same error from within a Python script (which works for the author on ‘the same’ SDR HW). [I think we can ignore the gnuradio error re: vmcircbuf_prefs or maybe not?]

[INFO] Make connection: ‘LimeSDR-USB [USB 3.0] 9060B00471A28’
[INFO] Reference clock 30.72 MHz
[INFO] Device name: LimeSDR-USB
[INFO] Reference: 30.72 MHz
[INFO] LMS7002M register cache: Disabled
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 25 MHz.Real pole 1st order filter set to 2.5 MHz. Preemphasis filter not active
[INFO] TX LPF configured
vmcircbuf_prefs::get :info: /root/.gnuradio/prefs/vmcircbuf_default_factory failed to open: bad true, fail true, eof true
[ERROR] Tx Calibration: MCU error 3 (SXR tune failed)
libusb: warning [libusb_exit] device 2.2 still referenced
libusb: warning [libusb_exit] device 2.1 still referenced
libusb: warning [libusb_exit] application left some devices open

Running LimeUtil for just 2-3 MHz:

$ LimeUtil --cal --start 2000000 --stop 3000000
Connected to [LimeSDR-USB [USB 3.0] 9060B00471A28]
Reference clock 30.72 MHz
Cal sweep over [2, 3, 1] MHz, channels=ALL, dir=BOTH
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ Calibrating for freq = 2 MHz
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ Calibrating for freq = 3 MHz
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Unable to meet NCO oversampling requirements
Error tuning (skipping)
Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Rx calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)
Fast Tune success; vco=0 value=13
Tx Calibration: MCU error 3 (SXR tune failed)
Error calibrating (skipping)

Cleanup…

I’d appreciate any guidance/advice, thanks!

The MCU calibration algorithm is going to fail if the center frequency is suppose to be <30 MHz. Because the lowest LO frequency that can be tuned is ~30 MHz, lower than that requires adjusting sampling rate and using NCO offsets, the MCU algorithm does not cower such edge case.

Thanks, Ricardas, for your prompt and clear reply, much appreciated.

The application (Python program) I mentioned was created by researchers at the University of Oxford. It imports soapy from gnuradio and sets lime_sdr_sink parameters to send a digital bit pattern at 17 MHz. I’m in touch with them to debug, etc. - will post updates here.

Meanwhile, is there any explanatory and/or practical documentation (e.g. theory of operation, guide to using LimeSuite) for using a LimeSDR USB as a transceiver between 100 kHz - 30 MHz?

Thanks much, cheers! -Craig