FPGA code not loading: 'unexpected error' ?

Having issues with the site, hardware, source code, or any other issues?
Post Reply
djrevmoon
Posts: 30
Joined: Fri Mar 01, 2013 4:37 am

FPGA code not loading: 'unexpected error' ?

Post by djrevmoon »

The file is there, bladrf-cli works in both interative and batch mode, bladeRF is seen as device. But FPGA will not load:

#bladeRF-cli -b -l ./hostedx40.rbf
Loading fpga...
Error: failed to load FPGA: An unexpected error occurred
Could not load fpga

Any hints?
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: FPGA code not loading: 'unexpected error' ?

Post by bpadalino »

Can you rebuild the library with Debug? That should give us better insight as to what is going on.

Also, are you sure you have a 40kLE FPGA, or do you have a 115kLE? Look at the big Altera FPGA part number - does it say EP4CE40 or EP4CE115?
djrevmoon
Posts: 30
Joined: Fri Mar 01, 2013 4:37 am

Re: FPGA code not loading: 'unexpected error' ?

Post by djrevmoon »

Hi,

yes, its the correct fpga version. I rebuilt with debug but doesnt really help me much:

# bladeRF-cli
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:249] Found a bladeRF
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:315] Claimed all inferfaces successfully
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/bladerf.c:132] bladerf_open: fw=v1.1 serial=0bb3137c20ae145a367357ddd61cb4ae trim=0xa755 fpga_size=40
bladeRF> load fpga hostedx40.rbf
Loading fpga from hostedx40.rbf...
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:219] Change to alternate interface 0

Error: An unexpected error occurred

bladeRF>

Potentially important fact: I'm running on a Parallels VM Ubuntu on a MacBook. Seeing as the last error message is from libusb, there might be something fishy with the USB3 support in VM's??
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: FPGA code not loading: 'unexpected error' ?

Post by bpadalino »

Quite possibly. I'll add this to our known issues.

We're working on native Windows support. If you're feeling adventurous, you can try to follow or help fill out the guide for building on Windows.

You won't get the interactive shell just yet due to libtecla not being available for Windows, but loading the FPGA, firmware, and passing in scripts to run should be possible when things all work.
drelectro
Posts: 8
Joined: Fri Mar 01, 2013 3:03 pm

Re: FPGA code not loading: 'unexpected error' ?

Post by drelectro »

I am also seeing the same behaviour on a native Mint install so I suspect this may not be a VM issue:-

Code: Select all

mike@mike-X58A-UD5 ~/ntc-build/gnuradio/bladeRF/host $ bladeRF-cli -l ../hdl/hostedx40.rbf 
[DEBUG /home/mike/ntc-build/gnuradio/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:249] Found a bladeRF
[DEBUG /home/mike/ntc-build/gnuradio/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:315] Claimed all inferfaces successfully
[DEBUG /home/mike/ntc-build/gnuradio/bladeRF/host/libraries/libbladeRF/src/bladerf.c:129] bladerf_open: fw=v1.1 serial=407d3f0895d72b8885ceaa771ce9086a trim=0x99f5 fpga_size=40
Loading fpga...
[DEBUG /home/mike/ntc-build/gnuradio/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:219] Change to alternate interface 0
Error: failed to load FPGA: An unexpected error occurred
Could not load fpga
bladeRF>
djrevmoon
Posts: 30
Joined: Fri Mar 01, 2013 4:37 am

Re: FPGA code not loading: 'unexpected error' ?

Post by djrevmoon »

This evening I will try on a native ubuntu machine. Will report the results. Is there any way to get more debug info?
drelectro
Posts: 8
Joined: Fri Mar 01, 2013 3:03 pm

Re: FPGA code not loading: 'unexpected error' ?

Post by drelectro »

I now have it working :D

I re-built the FX3 FW from source, flashed that and it then burst into life.
I then tried re-flashing the latest.img downloaded from naund.com and guess what ? that worked too.

So I guess something must have gone wobbly during the update from V1.0 to V1.1
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: FPGA code not loading: 'unexpected error' ?

Post by bpadalino »

djrevmoon wrote:This evening I will try on a native ubuntu machine. Will report the results. Is there any way to get more debug info?
If you invoke the CLI as such:

Code: Select all

bladeRF-cli -i -v debug
You should get more information. We just change the logging mechanism over the weekend to be more granular. You should see a lot more debug messages coming out.

Also, be sure to check the Wiki regarding setup on Ubuntu - we've had a lot of reported success with that.

Let us know how it goes.
djrevmoon
Posts: 30
Joined: Fri Mar 01, 2013 4:37 am

Re: FPGA code not loading: 'unexpected error' ?

Post by djrevmoon »

Hi,

I built the FX3 fw from source, just like previous poster, and flashed that succesfully, but it still wont accept any fpga code.
bladeRF-cli -i -v debug doesnt do much, just cloned the git repo and built again. But no more info than previously:

# bladeRF-cli -b -l hostedx40.rbf
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:249] Found a bladeRF
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:315] Claimed all inferfaces successfully
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/bladerf.c:132] bladerf_open: fw=v1.1 serial=0bb3137c20ae145a367357ddd61cb4ae trim=0xa755 fpga_size=40
Loading fpga...
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:219] Change to alternate interface 0
Error: failed to load FPGA: An unexpected error occurred
Could not load fpga
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:871] could not access peripheral
[DEBUG /root/sandbox/bladeRF/host/libraries/libbladeRF/src/backend/libusb.c:871] could not access peripheral

I'll try on a native linux machine tonight and update here......
djrevmoon
Posts: 30
Joined: Fri Mar 01, 2013 4:37 am

Re: FPGA code not loading: 'unexpected error' ?

Post by djrevmoon »

Ok, so I tried on a native linux machine (but it only had USB2.0) and I could flash the FPGA code.

I then went back to my Ubuntu VM, and switched off USB3.0 support in Parallels. I was then also also able to load the FPGA code. Switch back on USB3 support and no FPGA load possible. So I can confirm this is a USB issue.

Now struggling to get some usefull output from the device, but have gqrx running with it....

Thanks!!
Post Reply