BladeRF Micro Trigger

Discussions related to embedded firmware, driver, and user mode application software development

Moderator: robert.ghilduta

Post Reply
lbelella
Posts: 6
Joined: Thu Sep 13, 2018 8:49 am

BladeRF Micro Trigger

Post by lbelella » Thu Sep 13, 2018 9:06 am

Hello all! I've been trying to figure out if it is possible to get the trigger working on the BladeRF Micro (A4). What I'm trying to do is trigger the RX stream when the trigger signal goes high. From looking at the schematic and the pin definitions, I can see that the trigger signal should be coming in/out on J51 pin 1. I've tried a variety of things and I can't seem to get bladerf_trigger_state to return anything that makes me feel like it's working.

So, as a test, I wanted to see if I could get a trigger signal to first come from the Blade. My current test code does the following:
  • bladerf_trigger_init as MASTER on RX0
  • bladerf_trigger_arm
  • bladerf_sync_config
  • bladerf_sync_rx
  • bladerf_trigger_fire
I've tried the init, arm, and fire calls in various places and I can't seem to get anything coming out on J51 (checking it on a scope).

I've also tried:
  • bladerf_trigger_init as SLAVE on RX0
  • bladerf_trigger_arm
  • bladerf_sync_config
  • bladerf_sync_rx with timeout set to 5000ms
But when I do this, sync_rx will simply receive samples as it does normally (I would expect it to timeout after 5 seconds because I'm not triggering it with anything yet).

So a few questions. Is trigger functionality currently supported on the micro? If so, what dumb thing am I doing to mess it all up?

I'm running the latest released firmware (2.2.0-git-3d38fac2) and FPGA (0.7.3) images and I've tried with both the 2018.08 release of the host library as well as the latest git commit (601d8fe). Any help anyone can provide would be greatly appreciated. Thanks in advance for your time!

User avatar
rtucker
Posts: 77
Joined: Sun Jan 25, 2015 10:38 am

Re: BladeRF Micro Trigger

Post by rtucker » Thu Sep 13, 2018 11:25 am

Well, I don't think it's you :)

Everything looks okay at first glance, but it fails for me too. I've opened an issue on this: https://github.com/Nuand/bladeRF/issues/632

(Also opened issues https://github.com/Nuand/bladeRF/issues/630 and https://github.com/Nuand/bladeRF/issues/631 for documentation and bladeRF-cli updates.)
Rey Tucker (she/her)
Systems Engineer, Nuand LLC
Rochester, NY, USA

#WontBeErased

lbelella
Posts: 6
Joined: Thu Sep 13, 2018 8:49 am

Re: BladeRF Micro Trigger

Post by lbelella » Thu Sep 13, 2018 11:26 am

Thanks for the speedy reply! I'll keep my eyes peeled for some additional updates. Thanks again!

User avatar
rtucker
Posts: 77
Joined: Sun Jan 25, 2015 10:38 am

Re: BladeRF Micro Trigger

Post by rtucker » Thu Sep 13, 2018 12:31 pm

As of moments ago, master should have the fix. It's embarrassingly simple :)

https://github.com/Nuand/bladeRF/pull/6 ... 10d334cf81
Rey Tucker (she/her)
Systems Engineer, Nuand LLC
Rochester, NY, USA

#WontBeErased

lbelella
Posts: 6
Joined: Thu Sep 13, 2018 8:49 am

Re: BladeRF Micro Trigger

Post by lbelella » Thu Sep 13, 2018 12:49 pm

Doh! Thanks for the update! I'll pull it down and give it a try. Thanks again for the help!

lbelella
Posts: 6
Joined: Thu Sep 13, 2018 8:49 am

Re: BladeRF Micro Trigger

Post by lbelella » Thu Sep 13, 2018 1:35 pm

Pulled down master and it is working much better. Thanks! I'm still a bit confused on the functionality though. So, in my case, I'm not using another Blade as the master. I'm using an external device. It looks like when a trigger is set as master and armed it drives the trigger pin high, then when fired, pulls it low again. Is the gate for using the RX trigger a falling edge on the trigger line? If so, how long does the trigger line have to be held high for everything to work?

My thought is I would be able to do this:
  • Arm RX0 as a trigger slave
  • Call sync_rx with a long enough timeout
  • Have external device provide the trigger signal
  • sync_rx gives me samples
Does that sound correct? Also, from the documentation it looks like I should call sync_config after arming the trigger. Where in that whole sequence should I enable the channels?

Thanks again for all of the help!!!

User avatar
rtucker
Posts: 77
Joined: Sun Jan 25, 2015 10:38 am

Re: BladeRF Micro Trigger

Post by rtucker » Fri Sep 14, 2018 12:44 pm

I've not personally used the trigger functionality, but from looking through things...

The trigger is level-based, so the trigger_line must be high when the trigger is armed, or else it will immediately fire and disarm itself. Note also that it's a direct pin into the FPGA, so ensure the high level is no higher than 3.3 V referenced to ground (conveniently available at J51-3) and the low is ~0 V. Max V_IL is 0.8 V, min V_IH is 1.7 V, per the Cyclone V datasheet.

I don't think it matters too much what order bladerf_trigger_* and bladerf_sync_* are called (relative to each other), but definitely bladerf_enable_module should be the last thing.

Trigger hasn't changed much between bladerf1 and bladerf2, so it might also be worthwhile to search through the forum to see if other folks have done similar things. :)
Rey Tucker (she/her)
Systems Engineer, Nuand LLC
Rochester, NY, USA

#WontBeErased

lbelella
Posts: 6
Joined: Thu Sep 13, 2018 8:49 am

Re: BladeRF Micro Trigger

Post by lbelella » Fri Sep 14, 2018 1:03 pm

Right on! I'll give it a few more looks and see if I can't get the thing working. Thanks again!

lbelella
Posts: 6
Joined: Thu Sep 13, 2018 8:49 am

Re: BladeRF Micro Trigger

Post by lbelella » Fri Sep 14, 2018 2:14 pm

OK, since I actually have 2 micros, I thought I would try the sync_trx example from the source tree. After a few tweaks to slave.txt to update it with the latest valid options it looked like it was going to work. However, it appears that someone is not honoring the timeout value set with rx config. The timeout in that file should be 60 seconds, but ~1 second after the script calls rx start I see the following output (then bladeRF-cli exits):

Code: Select all

[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd350000cd0
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359c2e010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359be2010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359bc1010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359ba0010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359b7f010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359b5e010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359b3d010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359b1c010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359afb010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359ada010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359ab9010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359a98010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359a77010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd359a56010
[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1073] Transfer timed out for buffer 0x7fd357044010
This is consistent with what I have been seeing in my own application as well (I set a timeout for 15 seconds and see the same error messages after ~1 second when the RX trigger is armed and I call sync_rx).

I've attached a verbose log file (with most of the nios_access lines removed). Any help is, as always, greatly appreciated! Thanks!
Attachments
timeout.txt
Verbose output
(7.93 KiB) Downloaded 56 times

User avatar
rtucker
Posts: 77
Joined: Sun Jan 25, 2015 10:38 am

Re: BladeRF Micro Trigger

Post by rtucker » Mon Sep 24, 2018 1:02 pm

Hmmm, yeah, I can reproduce this... this is probably a bug. I've opened an issue in the tracker at https://github.com/Nuand/bladeRF/issues/655 ... further updates on it will be available there as we look into it :)

Thanks for the report!
Rey Tucker (she/her)
Systems Engineer, Nuand LLC
Rochester, NY, USA

#WontBeErased

Post Reply