Mini 2.0 : 9E6 samples cause crash inside LMS_RecvStream

Hello,

I’m using the singleRX.cpp sample code.
The following code spcifies the data size:

//Data buffers
const int buffersize = 10000; //complex samples per buffer
float buffer[buffersize * 2]; //must hold I+Q values of each sample
//Start streaming
LMS_StartStream(&streamId);
...
int samplesRead = LMS_RecvStream(&streamId, buffer, buffersize, NULL, 1000);

Instead of 10000 complex samples I tried 4E6 samples.

This scenario cause a crash inside LMS_RecvStream.

Is there any limit on number of samples ?

When I changed to 2E6 it worked fine.

Instead of calling once to LMS_RecvStream I called it several times till I got 9E6 samples.

Each time I read 0x40000 samples (262144)

Is this the right solution ?

Thank you,

Zvi

Hi,

Is there a particular reason you want to use the limesuiteng-legacyapi library and the old API?

For new boards (and LimeSDR Mini 2.0) we recommend that you use the limesuiteng library and LimeSuiteNG library API instead since it is a more up to date software stack that is actively maintained and has issues like these already resolved.

Hi,

The only reason I used the legacy API that it’s syntex is simpler.

Thank you,

Zvi

Is that buffer defined as a file static variable, or is that an auto variable in a function? If the latter, you are likely exceeding the stack space allocated for the program.
I strongly urge that you at least allocate that buffer on the heap with operator new() (and assign it to a std::unique_ptr<> or std::shared_ptr<>), or preferably use a std::vector<> to contain the data.

It will be deprecated, hence we strongly advise against creating new applications which use this.