Bug in Matlab driver - TX

Follow our development of DSP and SDR tutorials
Post Reply
Michael
Posts: 4
Joined: Tue Dec 02, 2014 11:05 am

Bug in Matlab driver - TX

Post by Michael »

Hi, all!

I found a bug in Matlab driver for bladeRF
Here: https://github.com/Nuand/Simulink-MATLA ... rf_dev.cpp , line 188 - CHECK_BUF_LENGTH (BUF_LENGTH );
BUF_LENGTH == TX_DATA (see lines 42 and 43)
So in TX mode line 188 asserts that the real value of the first IQ must be positive, otherwise you get a message:
Error using bladerf_dev
Buffer Length must be numeric and greater zero

So this example: https://github.com/Nuand/Simulink-MATLA ... lay_demo.m always crashes
yoshimifuj
Posts: 15
Joined: Wed May 07, 2014 8:59 pm

Re: Bug in Matlab driver - TX

Post by yoshimifuj »

I encountered this problem, too and changed the C source code as follows.
/* check input */
CHECK_DEVICE_INDEX(DEVICE_INDEX);
CHECK_BANDWIDTH (BANDWIDTH );
CHECK_SAMPLE_RATE (SAMPLE_RATE );
CHECK_FREQUENCY (FREQUENCY );
// The following line has moved into 'if' statement.
// CHECK_BUF_LENGTH (BUF_LENGTH );

rx = 1;
if (mxGetString(DEVICE_MODE, (char *)&mode, 3)) {
rx = 1;
CHECK_BUF_LENGTH (BUF_LENGTH );
} else {
if (!strcmp(mode, "TX"))
rx = 0;
}
Would you confirm this change?
robert.ghilduta
Posts: 156
Joined: Thu Feb 28, 2013 11:14 pm

Re: Bug in Matlab driver - TX

Post by robert.ghilduta »

Thanks for the report Michael and thanks for the patch Yoshimi!

The bug fix has been committed to Github. We'll update the windows binary installer with the fix soon.
Post Reply