Page 1 of 2

Re: BladeRF and MATLAB 2017a error

Posted: Thu Feb 01, 2018 3:05 pm
by mando238
After trying the new installer I'm now down to just
MATLAB System block 'bladerf_passive2_justgather/MATLAB System' error occurred when invoking 'setupImpl' method of 'bladeRF_Simulink'. The error was thrown from '
'C:\Program Files\bladeRF\matlab\bladeRF.m' at line 111
'C:\Program Files\bladeRF\matlab\bladeRF_XCVR.m' at line 108
'C:\Program Files\bladeRF\matlab\bladeRF_XCVR.m' at line 364
'C:\Program Files\bladeRF\matlab\bladeRF.m' at line 518
'C:\Program Files\bladeRF\matlab\bladeRF_Simulink.m' at line 343'.
Caused by:
libbladeRF error (-1) in bladerf_set_frequency(): An unexpected error occurred

No more of the thunk file warnings - so that part seems to be fixed.

Re: BladeRF and MATLAB 2017a error

Posted: Fri Feb 02, 2018 9:27 am
by rtucker
Hmm, what happens if you just do something simple, like:

Code: Select all

device = bladeRF();
and then

Code: Select all

device.rx.frequency = 2.4e9
and

Code: Select all

device.tx.frequency = 2.4e9
?

This sounds like libbladeRF is throwing an unexpected error on a frequency change, which is weird...

Re: BladeRF and MATLAB 2017a error

Posted: Sun Feb 04, 2018 6:05 pm
by Axel
Thank you for you answers!
Im working on my Bachelor Degree and want to implement my FPGA Board as a Simulink model to have a reference with the bladeRF.
I will give you the requested information tomorrow and try the suggested solution.
Thank you again! :)

Sorry for the late response,
have been soldering the prototype board to have it tormorrow morning with the professor.

Re: BladeRF and MATLAB 2017a error

Posted: Mon Feb 05, 2018 8:40 am
by rtucker
Oh awesome, that looks really fun! ^^

Let me know how it goes!

Re: BladeRF and MATLAB 2017a error

Posted: Mon Feb 05, 2018 12:00 pm
by Axel
rtucker wrote: Thu Feb 01, 2018 11:43 am Okay, looks like it wasn't at all what I thought it was. Try this installer, which can be installed over 2017.12-rc1:

https://www.dropbox.com/s/g72gdqpd65adw ... 1.exe?dl=0

SHA256: 607cc8344c12da8d1d2a55a6f1cc0f48bfe68acf82e13cb0b681ffa708a92368
GPG signature: https://www.dropbox.com/s/potzi696y4o6j ... e.sig?dl=0

Let me know how this works for y'all. Thanks for your patience and feedback!

Hey rtucker,
the new installer is working perfectly! Tested on R2017b.

Wirth R2017a and R2016a I had to add the paths, but it works also perfect.
I dont know if i would had to add the path, if ther were only one matlab installed.

I notieced, that the device selection has changed (added "libusb:serial" in front of the device selection)
Maybe this information helps in future.

Tank you verry much for you support! And i'd love to keep you up to date with my MAX10 FPGA project.

Re: BladeRF and MATLAB 2017a error

Posted: Tue Feb 06, 2018 9:50 am
by rtucker
Awesome!! Woohoo! Thanks for your patience and assistance!

It will only add itself to the path of the first Matlab it finds, so that makes sense.

I look forward to hearing about your project, and good luck ^^

Re: BladeRF and MATLAB 2017a error

Posted: Thu Feb 08, 2018 2:07 pm
by bwick
Hey guys,

I've also been struggling through getting the bladeRF to work in a matlab 2017b environment and your suggestions have been super helpful. I'm down to the point at which it works the first time but if I clear and try to reconnect to the bladeRF I get an error no device found message. Any ideas on how to solve this issue?

Re: BladeRF and MATLAB 2017a error

Posted: Fri Mar 02, 2018 12:11 pm
by rtucker
For what it's worth, I also run into this... it almost feels like bladerf_close is not getting properly called to release the device, or something like that. I was secretly hoping it was a problem with my environment, but it sounds like I'm not that lucky :)

Re: BladeRF and MATLAB 2017a error

Posted: Fri Mar 09, 2018 10:21 am
by mando238
rtucker wrote: Fri Mar 02, 2018 12:11 pm For what it's worth, I also run into this... it almost feels like bladerf_close is not getting properly called to release the device, or something like that. I was secretly hoping it was a problem with my environment, but it sounds like I'm not that lucky :)
I've finally had a chance to get back at this, I started from scratch in matlab and can now get it to work once again like Axel with the fixed installer on RX ONLY.
But I'm encountering this quoted issue as well; where it will work on the first try but subsequent tries will show no device available in both Matlab. I do not need to reset the device to get it working however, exiting out of matlab (or matlab/simulink) in its entirety will enable the device to be used again either from BladeRF-cli or from a freshly launched matlab.

FWIW - sometimes I can get the following error in BladeRF-Cli if I try entering interactive mode after a matlab script finished first-use of the device (so the script itself has closed the device but matlab is still open):

C:\Users\Name>bladerf-cli -i
[WARNING @ "C:\\Users\\msft\\source\\repos\\bladeRF-win-installer\\work\\bladeRF\\host\\libraries\\libbladeRF\\src\\backend\\usb\\libusb.c":481] Found a bladeRF via VID/PID, but could not open it due to insufficient permissions.
No bladeRF device(s) available.

If one is attached, ensure it is not in use by another program
and that the current user has permission to access it.


------- Regarding Transmitting-----
I still sometimes get the same set frequency issue reported above when transmit is included, even wit the simplified program (device = bladeRF();device.rx.frequency = 2.4e9;device.tx.frequency = 2.4e9;) you suggested. Sometimes instead it gives the issue with no devices found we all seem to be encountering. Sometimes if I reset the BladeRF and the PC, I can get it to run in both transmit and receive, but it will only do this on the first try - after that producing the errors described above...

Thanks for trying to solve this!
I can still roll back to the bladeRF-win-installer-2016.05-rc2-alpha2 when I need full functionality.

Re: BladeRF and MATLAB 2017a error

Posted: Tue Mar 27, 2018 3:20 pm
by rtucker
FYI, I've opened an issue to track this: https://github.com/Nuand/bladeRF/issues/553

Re: BladeRF and MATLAB 2017a error

Posted: Thu Apr 19, 2018 11:18 am
by rtucker
Okay, looks like there was a bug in the Windows-specific mutex handling: https://github.com/Nuand/bladeRF/pull/550

I just tested a build of this and everything seems good! I can clear the bladeRF object in MATLAB and create a new one (or use bladeRF-cli) without needing to close MATLAB!

Here's the installer, built from commit 23c6379: https://www.dropbox.com/s/jlhyaeiukiw7w ... 1.exe?dl=0
SHA256: 61d7a5868e58d3e6cb7695661aa3a605efe230b34841b6e585817fc061fec44d

Let me know if this helps. :)

Re: BladeRF and MATLAB 2017a error

Posted: Wed Apr 25, 2018 5:40 pm
by mando238
Glad to hear it's fixed! However, I get an error saying the file has been deleted when trying to download the new installer from that link..

Re: BladeRF and MATLAB 2017a error

Posted: Thu Apr 26, 2018 1:48 pm
by rtucker
Oh frack, my bad. I did indeed delete it. Sorry about that.

Here it is again:
https://www.dropbox.com/s/isfaiyo1l9wf9 ... 1.exe?dl=0
SHA256: 61d7a5868e58d3e6cb7695661aa3a605efe230b34841b6e585817fc061fec44d

Re: BladeRF and MATLAB 2017a error

Posted: Sat May 02, 2020 12:40 pm
by vondess
I still can't attach images, but a text list is below. I will also emphasize I had to completely, manually, delete the C:/Program Files/bladeRF directory before running the older (2016.05-rc2-alpha2 ) installer to get it to work.