Closed bglod closed 6 years ago
I think I've reproduced this in the debugger, and yep, I concur...
(gdb) run
Starting program: /home/rtucker/dev/bladeRF/host/build/output/bladeRF-cli -L X
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff692e700 (LWP 18652)]
Deferring device init until after FPGA load
[Thread 0x7ffff692e700 (LWP 18652) exited]
[New Thread 0x7ffff692e700 (LWP 18653)]
Erasing stored FPGA to disable autoloading...
[INFO @ host/libraries/libbladeRF/src/backend/usb/usb.c:455] Erasing 55 blocks starting at block 4
[INFO @ host/libraries/libbladeRF/src/backend/usb/usb.c:460] Erased block 58
[INFO @ host/libraries/libbladeRF/src/backend/usb/usb.c:468] Done erasing 55 blocks
Done.
Thread 1 "bladeRF-cli" hit Breakpoint 1, bladerf2_trigger_init (
dev=0x5555557a6220, ch=0, signal=BLADERF_TRIGGER_J71_4,
trigger=0x7fffffffdd30)
at /home/rtucker/dev/bladeRF/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:3343
3343 CHECK_BOARD_STATE(STATE_INITIALIZED);
(gdb) bt
#0 bladerf2_trigger_init (dev=0x5555557a6220, ch=0,
signal=BLADERF_TRIGGER_J71_4, trigger=0x7fffffffdd30)
at /home/rtucker/dev/bladeRF/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:3343
#1 0x00007ffff7b720e5 in bladerf_trigger_init (dev=0x5555557a6220, ch=0,
signal=BLADERF_TRIGGER_J71_4, trigger=0x7fffffffdd30)
at /home/rtucker/dev/bladeRF/host/libraries/libbladeRF/src/bladerf.c:830
#2 0x00005555555724d0 in disarm_triggers (s=0x555555792280, dir=BLADERF_RX)
at /home/rtucker/dev/bladeRF/host/utilities/bladeRF-cli/src/cmd/rxtx.c:84
#3 0x00005555555731d5 in rxtx_shutdown (s=0x555555792280, rxtx=0x5555557922e0)
at /home/rtucker/dev/bladeRF/host/utilities/bladeRF-cli/src/cmd/rxtx.c:473
#4 0x000055555555edd1 in cli_state_destroy (s=0x555555792280)
at /home/rtucker/dev/bladeRF/host/utilities/bladeRF-cli/src/common.c:150
#5 0x000055555555eab7 in main (argc=3, argv=0x7fffffffdf08)
at /home/rtucker/dev/bladeRF/host/utilities/bladeRF-cli/src/main.c:550
(gdb)
I am able to reproduce by:
bladeRF-cli -e version
(w/ host-based FPGA autoloading enabled)bladeRF-cli -L X
Steps to reproduce:
The "Firmware Loaded, requires Initialized" case occurs in the CLI
main.c
during tear-down atcli_state_destroy()
, which callsrxtx_shutdown()
-->disarm_triggers()
-->bladerf_trigger_init()
, where the board state is checked and it errors out. The board was never initialized because of the flash operation. https://github.com/Nuand/bladeRF/blob/aaca552637b03bacc82caf175b22a7cfdb873519/host/utilities/bladeRF-cli/src/main.c#L550 https://github.com/Nuand/bladeRF/blob/aaca552637b03bacc82caf175b22a7cfdb873519/host/utilities/bladeRF-cli/src/common.c#L144-L150 https://github.com/Nuand/bladeRF/blob/aaca552637b03bacc82caf175b22a7cfdb873519/host/utilities/bladeRF-cli/src/cmd/rxtx.c#L470-L474For the interactive "version" command case, we also see the "Firmware loaded, requires FPGA loaded" error .. but the FPGA was loaded via SPI flash. The debug output says
BLADERF_FORCE_NO_FPGA_PRESENT
is set, so theis_fpga_configured()
function will always return false, causing the error.https://github.com/Nuand/bladeRF/blob/aaca552637b03bacc82caf175b22a7cfdb873519/host/libraries/libbladeRF/src/backend/usb/usb.c#L116-L133