Problem connecting to device

Having issues with the site, hardware, source code, or any other issues?
Post Reply
Ghostatlo
Posts: 5
Joined: Wed Feb 05, 2014 9:36 am

Problem connecting to device

Post by Ghostatlo »

I recently got a BladeRF, and have been trying to set it up on my computer. I was following the Getting Started: Linux guide (I am running Ubuntu 13.10), and got to the section on “Detecting the bladeRF”. However, when I probed the device, this is what I received:

Code: Select all

bladeRF> probe

    Backend:        libusb
    Serial:         
    USB Bus:        1
    USB Address:    2
As you can see, there is no serial number for the BladeRF. Following the instructions on the Getting Started guide, I verified that my user account is in fact in the plugdev group.

Since I am a complete n00b to Linux, I’ve been doing searches on what dmesg and lsusb do and how to test for the proper VID and PID numbers of the BladeRF, but so far I haven’t been able to get either of these numbers for the BladeRF.

Next, I ended up at the firmware wiki page, where I followed the directions in the section “Upgrading on Linux”. This is what happens:

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ wget http://nuand.com/fx3/latest.img && bladeRF-cli -f latest.img
--2014-02-05 12:00:25--  http://nuand.com/fx3/latest.img
Resolving nuand.com (nuand.com)... 198.23.74.122
Connecting to nuand.com (nuand.com)|198.23.74.122|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 122112 (119K)
Saving to: ‘latest.img.4’

100%[===============================================>] 122,112      324KB/s   in 0.4s   

2014-02-05 12:00:26 (324 KB/s) - ‘latest.img.4’ saved [122112/122112]

Failed to open device ((null)): Unknown error code
Since this failed, I then followed the directions under “Force Cypress Bootloader”, but to no avail.

I am currently at a loss regarding what to do next. I used the version and verbose commands to see what information I could read. This is what I got:

Code: Select all

bladeRF> version

  bladeRF-cli version:        0.10.3-git-5110cf4-ppasaucy
  libbladeRF version:         0.12.1-git-5110cf4-ppasaucy

  Device version information unavailable: No device attached.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -v verbose
[VERBOSE] Using libusb version: 1.0.16.10774
[VERBOSE] Non-bladeRF device found: VID 046d, PID c063
[VERBOSE] Found a bladeRF (based upon VID/PID)
[DEBUG] Failed to retrieve serial number
[DEBUG] Failed to populate FW version (instance 1756260640): �FT 
Failed to open device ((null)): File or device I/O failure

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -i
Failed to open device ((null)): File or device I/O failure
Please help me figure out what’s going on with my setup so that I can start using my BladeRF. Thanks!!!
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Problem connecting to device

Post by jynik »

This sounds like the board may be running old firmware, and somewhere along the line a proper check is missing. I think you're correct in going down the firmware upgrade path, and doing so with verbose output enabled was a good call.
Ghostatlo wrote: [DEBUG] Failed to populate FW version (instance 1756260640): �FT
I found this obviously corrupted output to be concerning and found that there was a bug in the log call. I pushed a fix for that corrupted error message, with a couple added prints along the way. If you don't mind fetching the latest libbladeRF from git master and re-running with verbose output again, I'd be curious to see what those messages show.

However, that won't fix the underlying issue. Could you share some verbose logs of the procedure of booting the device in the bootloader? this post goes through the process step by step. Note that since you're not autoloading an FPGA at this point (I assume) and you're not upgrading from older firmare, you can skip the part about loading v1.5.3 firmare and disabling FPGA autoloading.

A common point of confusion is that the jumper must be removed after you boot into the bootloader, or otherwise you won't be able to write to flash.
Ghostatlo
Posts: 5
Joined: Wed Feb 05, 2014 9:36 am

Re: Problem connecting to device

Post by Ghostatlo »

Per your instructions, I fetched the latest PPA from git master, and then ran verbose again. Here is the output from that:

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -v verbose
[VERBOSE] Using libusb version: 1.0.16.10774
[VERBOSE] Non-bladeRF device found: VID 046d, PID c063
[VERBOSE] Non-bladeRF device found: VID 0424, PID 4060
[VERBOSE] Non-bladeRF device found: VID 0424, PID 2640
[VERBOSE] Non-bladeRF device found: VID 0424, PID 2514
[VERBOSE] Non-bladeRF device found: VID 1d6b, PID 0002
[VERBOSE] Non-bladeRF device found: VID 413c, PID 2106
[VERBOSE] Non-bladeRF device found: VID 1d6b, PID 0001
[VERBOSE] Non-bladeRF device found: VID 1d6b, PID 0001
[VERBOSE] Non-bladeRF device found: VID 1d6b, PID 0001
[VERBOSE] Found a bladeRF (based upon VID/PID)
[DEBUG] Failed to retrieve serial number
[DEBUG] Failed to get version string descriptor (-9). Using legacy fallback.
[VERBOSE] Legacy alt setting detected.
[VERBOSE] Legacy config i/f detected.
[VERBOSE] Claimed all inferfaces successfully
[VERBOSE] Legacy change to interface 0
[DEBUG] Failed to switch to USB_IF_NULL
Failed to open device (first available): Unknown error code
Your updates to the code are definitely triggering here. However, the line “Failed to retrieve serial number” is still a little unsettling. Next, I followed the instructions for fetching the newest firmware. After applying the jumper and using dmesg output, this is what I see:

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ dmesg | tail
[ 2188.920375] usb 1-4: Manufacturer: Nuand
[ 3260.098266] compiz[2094]: segfault at 314 ip 00007fd90f0fba83 sp 00007ffff2f183a0 error 4 in libnvidia-glcore.so.304.88[7fd90dc16000+19d0000]
[ 3269.689395] traps: bamfdaemon[1919] trap int3 ip:7fdc8ada93d9 sp:7fff13319db0 error:0
[ 4305.455292] usb 1-4: USB disconnect, device number 2
[ 4308.935083] usb 1-4: new high-speed USB device number 3 using ehci-pci
[ 4309.067982] usb 1-4: New USB device found, idVendor=04b4, idProduct=00f3
[ 4309.067987] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4309.067991] usb 1-4: Product: WestBridge 
[ 4309.067993] usb 1-4: Manufacturer: Cypress
[ 4309.067996] usb 1-4: SerialNumber: 0000000004BE
Most of this output matches what you had in your original post. However, I don’t know if this is a problem or not, but in your post it says “new high-speed USB device number 7 using xhci_hcd”, whereas mine says “new high-speed USB device number 3 using ehci-pci”. I don’t know the difference between xhci_hcd and ehci_pci; is this something that is a problem?

Anyways, after removing the jumper, I continued to get info.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -i -v info
[INFO] Found FX3 bootloader device on bus=1 addr=3. This may be a bladeRF.
[INFO] Use bladeRF-cli command "recover 1 3 <FX3 firmware>" to boot the bladeRF firmware.
No device(s) attached.

bladeRF> recover 1 3 bladeRF_fw_v1.5.3.img

Success! Use "open" to switch to this device.
Note that a "load fx3 <firmware>" is required to write the firmware to flash.

bladeRF> open
bladeRF> info

  Serial #:                 37400f00b68a9d9e9d8814b62eaf69ed
  VCTCXO DAC calibration:   0x9b09
  FPGA size:                115 KLE
  FPGA loaded:              no
  USB bus:                  1
  USB address:              4
  USB speed:                Hi-Speed
  Backend:                  libusb
  Instance:                 0

bladeRF> version

  bladeRF-cli version:        0.10.3-git-20d70a6-ppasaucy
  libbladeRF version:         0.12.1-git-20d70a6-ppasaucy

  Firmware version:           1.5.3-git-276379e
  FPGA version:               Unknown (FPGA not loaded)

bladeRF> load fx3 bladeRF_fw_v1.5.3.img
Flashing firmware from bladeRF_fw_v1.5.3.img...
[INFO] Erasing 0x00020000 bytes starting at address 0x00000000.
[INFO] Writing 0x00020000 bytes to address 0x00000000.
[INFO] Verifying 0x00020000 bytes at address 0x00000000
Done. Cycle power on the device.
bladeRF> quit
At this point I cycled the power for the BladeRF

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ dmesg | tail
[ 4683.754330] usb 1-4: Product: bladeRF
[ 4683.754332] usb 1-4: Manufacturer: Nuand
[ 4683.754335] usb 1-4: SerialNumber: 37400f00b68a9d9e9d8814b62eaf69ed
[ 4962.540454] usb 1-4: USB disconnect, device number 4
[ 4997.635160] usb 1-4: new high-speed USB device number 5 using ehci-pci
[ 4997.769544] usb 1-4: New USB device found, idVendor=1d50, idProduct=6066
[ 4997.769549] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4997.769553] usb 1-4: Product: bladeRF
[ 4997.769555] usb 1-4: Manufacturer: Nuand
[ 4997.769558] usb 1-4: SerialNumber: 37400f00b68a9d9e9d8814b62eaf69ed
I don’t know if this is problematic or not, but the output I see is different from what you have at this point.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -p

    Backend:        libusb
    Serial:         37400f00b68a9d9e9d8814b62eaf69ed
    USB Bus:        1
    USB Address:    5
At this point I am quite happy, as I now see a serial number of my bladeRF, which is already a huge step in the right direction. Next, I disabled the FPGA autoloading.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -L X
Flashing fpga...
Disabling FPGA flash auto-load
[INFO] Erasing 0x00010000 bytes starting at address 0x00040000.
Done.
However, now I encounter a problem.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -f bladeRF_fw_v1.6.0
Flashing firmware...
Error: failed to flash firmware: File or device I/O failure
Just for the sake of completion, I power cycled the BladeRF, and then checked the version on it.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -i
bladeRF> version

  bladeRF-cli version:        0.10.3-git-20d70a6-ppasaucy
  libbladeRF version:         0.12.1-git-20d70a6-ppasaucy

  Firmware version:           1.5.3-git-276379e
  FPGA version:               Unknown (FPGA not loaded)
After going through this process, I don’t entirely know if my BladeRF is okay, or if there is some underlying problem going on.

Hopefully this verbose feedback (pun absolutely intended) is useful to you, and any help you can provide is much appreciated!
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Problem connecting to device

Post by jynik »

Ghostatio wrote: ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -f bladeRF_fw_v1.6.0
Flashing firmware...
Error: failed to flash firmware: File or device I/O failure
I think you're just providing the wrong filename, and that should be bladeRF_fw_v1.6.0.img, unless you renamed it.

Also, you'll probably want to grab bladeRF_fw_v1.6.1.img, as this fixes some annoying bugs. FPGA v0.0.3 is up, so you'll likely want to use that (or v0.0.2 at a minimum).

Let me know if the filename ends up being the problem. This would imply to me that we need to improve our return codes and/or error messages.
Ghostatlo
Posts: 5
Joined: Wed Feb 05, 2014 9:36 am

Re: Problem connecting to device

Post by Ghostatlo »

Ah, that fixed it. I used v1.6.1 and v0.0.3, and it (almost) worked perfectly. There's only one issue now, which is in the last step.

Code: Select all

ben@ben-Precision-WorkStation-T7500:~$ bladeRF-cli -i
bladeRF> version

  bladeRF-cli version:        0.10.3-git-20d70a6-ppasaucy
  libbladeRF version:         0.12.1-git-20d70a6-ppasaucy

  Firmware version:           1.6.1-git-b7e6642
  FPGA version:               Unknown (FPGA not loaded)

bladeRF> load fpga hostedx40.rbf
Loading fpga from hostedx40.rbf...
Error: Operation timed out
Any idea why the operation is timing out?
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Problem connecting to device

Post by jynik »

FPGA loading timeouts are generally indicative of the wrong bitstream or a corrupted file being loaded. If you've got a 115 KLE FPGA, you'll need to be loading v0.0.3 of the hostedx115.rbf image.

Could you please confirm that you have a 40 KLE FPGA and not a 115 KLE? If you're not positive, could you paste the FPGA part number here? (It should contain something like EP4CE40 or EP4CE115.)

If you're certain that you're loading the correct bistream, could you run a md5sum hostedx40.rbf and paste the results here? Let's compare that against the known values on http://www.nuand.com/fpga/ to verify your bitstream hasn't been corrupted or anything.
Ghostatlo
Posts: 5
Joined: Wed Feb 05, 2014 9:36 am

Re: Problem connecting to device

Post by Ghostatlo »

It's the EP4CE115F23C8N. Does this mean that I should be using

Code: Select all

wget www.nuand.com/fpga/v0.0.3/hostedx115.rbf
instead of

Code: Select all

wget www.nuand.com/fpga/v0.0.3/hostedx40.rbf
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Problem connecting to device

Post by jynik »

Correct -- the "x115" corresponds to the bold part of the part number: EP4CE115F23C8N. (I'm jealous! I only have a 40 KLE ;) )

I think you'll be up and running after a:

Code: Select all

$ wget www.nuand.com/fpga/v0.0.3/hostedx115.rbf
$ bladeRF-cli -l hostedx115.rbf -i
bladeRF> version
Ghostatlo
Posts: 5
Joined: Wed Feb 05, 2014 9:36 am

Re: Problem connecting to device

Post by Ghostatlo »

It works!!! Thank you for your help throughout this!!! Yeah, I'm pretty happy to have gotten the beefier FPGA, I'm planning on using it a lot once I'm fully up and running.
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Problem connecting to device

Post by jynik »

Excellent, glad to hear it! :)

From here, I'd recommend going over the getting started guides, and perhaps getting set up with GNU Radio (the gr-osmosdr library supports the bladeRF) to have some "working out-of-the-box" applications. Check out the Project Showcase forum and any projects listed on the wiki.

Cheers!
Jon
Post Reply