unexpected error requiring disconnect to clear

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
robertbaruch
Posts: 3
Joined: Wed May 11, 2022 5:17 pm

unexpected error requiring disconnect to clear

Post by robertbaruch »

I get the following error if I do not disconnect and reconnect (on the second run of an application):

ERROR @ /privatehost/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:369] _rfic_host_set_sample_rate: ad9361_set_rx_sampling_freq(phy, rate) failed: An unexpected error occurred
[ERROR @ /privatehost/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:1096] bladerf2_set_sample_rate: rfic->set_sample_rate(dev, ch, rate) failed: An unexpected error occurred
[ERROR @ /privatehost/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:997] bladerf2_set_rational_sample_rate: dev->board->set_sample_rate(dev, ch, integer_rate, &actual_integer_rate) failed: An unexpected error occurred
[2022-06-10 17:54:12.180058] (error) Failed parsing Config: set_sample_rate: Failed to set sample rate: An unexpected error occurred (-1)

any ideas why I need to hard-reset the board to clear the error after terminating the program on the first run?
[email protected]
Posts: 6
Joined: Fri May 20, 2022 4:42 pm

Re: unexpected error requiring disconnect to clear

Post by [email protected] »

I'm getting this error too, on a bladeRF 2.0 xA9 board, with all the latest software. The error happens whenever I stop the flowgraph and restart it, even without changing the sample rate. I get the following from verbose debugging on gnuradio:
...
[bladeRF source] Device: Nuand bladeRF 2.0 Serial # 2ce3...8c14 FW v2.3.2 FPGA v0.12.0
[bladeRF source] init: Buffers: 512, samples per buffer: 4096, active transfers: 32
[VERBOSE @ host/libraries/libbladeRF/src/backend/usb/usb.c:106] Changing to USB alt setting 0
[VERBOSE @ host/libraries/libbladeRF/src/backend/usb/usb.c:106] Changing to USB alt setting 1
[VERBOSE @ host/libraries/libbladeRF/src/backend/usb/nios_access.c:429] nios_config_read: Read 0x00000800
[VERBOSE @ host/libraries/libbladeRF/src/backend/usb/nios_access.c:440] nios_config_write: Wrote 0x00000800
[bladeRF source] bladerf_source_c: DEBUG: initialization complete
Calibration TIMEOUT (0x16, 0x80)
[ERROR @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:369] _rfic_host_set_sample_rate: ad9361_set_rx_sampling_freq(phy, rate) failed: An unexpected error occurred
[ERROR @ host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:1096] bladerf2_set_sample_rate: rfic->set_sample_rate(dev, ch, rate) failed: An unexpected error occurred
[ERROR @ host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:996] bladerf2_set_rational_sample_rate: dev->board->set_sample_rate(dev, ch, integer_rate, &actual_integer_rate) failed: An unexpected error occurred
Traceback (most recent call last):
File "/home/paul/electronics/gnuradio/blah.py", line 255, in <module>
main()
File "/home/paul/electronics/gnuradio/blah.py", line 233, in main
tb = top_block_cls()
File "/home/paul/electronics/gnuradio/blah.py", line 189, in __init__
self.bladeRF_source_0.set_sample_rate(samp_rate)
RuntimeError: set_sample_rate: Failed to set sample rate: An unexpected error occurred (-1)

>>> Done (return code 1)
The "Calibration TIMEOUT " line seems like the first error. Anybody have a clue???
robert.ghilduta
Posts: 156
Joined: Thu Feb 28, 2013 11:14 pm

Re: unexpected error requiring disconnect to clear

Post by robert.ghilduta »

Does this happen in bladeRF-cli? I would strongly suggest running few tests like setting the frequency, sampling rate, and capturing a few samples into a CSV. If there appears to be no issue, it might be worth compiling the GNURadio / gr-osmosdr from source using these instructions: https://github.com/Nuand/bladeRF/wiki/G ... on_PyBOMBS
[email protected]
Posts: 6
Joined: Fri May 20, 2022 4:42 pm

Re: unexpected error requiring disconnect to clear

Post by [email protected] »

Thanks for the suggestion using PyBOMBS. I'm almost all the way there, after fixing the issue with BOOST_FOREACH that is in the pull requests. But now my question is: how do I get gr-bladeRF (the gnuradio-companion blocks supporting bladeRF) into PyBOMBS. i try:

Code: Select all

pybombs -p bladeRF install gr-bladerf
but I get "Package gr-bladeRF has no recipe file". Is there a recipe file somewhere for this?

... several days later:

I found a way that works. Install pybombs and install the bladeRF stuff under the prefix "bladeRF" as given here:
https://github.com/Nuand/bladeRF/wiki/G ... on_PyBOMBS
Then install gr-bladeRF under pybombs like this:

Code: Select all

$ cd ~/pybombs
$ git clone https://github.com/Nuand/gr-bladeRF.git
$ cd gr-bladeRF
$ mkdir build
$ cd build
$ pybombs -p bladeRF run cmake ..
$ pybombs -p bladeRF run make -- -j4
$ pybombs -p bladeRF run make -- install
note the extra -- necessary in the pybombs run command necessary to add arguments to the make calls.
Last edited by [email protected] on Tue Nov 15, 2022 7:15 pm, edited 3 times in total.
Post Reply