Phywhisperer trigger out not generated

Hello Forum,

I’ve been using Phywhisperer to capture some traces for a target, and I want to get a trigger signal from it. However I don’t know why my setup fails to generate one. I’ve connected the Phy to an oscilloscope waiting for the trigger, but I cannot locate it, even for a two byte pattern.
The setup script looks like this:

import phywhisperer.usb as pw
phy = pw.Usb()
phy.con()

phy.addpattern = True #Adds captured data back, otherwise we capture ‘after’
phy.set_power_source(“off”)
phy.set_pattern([0x80, 0x06])
phy.set_capture_size(8000)
phy.set_trigger(2, 150,150)
phy.set_power_source(“host”)
print(phy.get_usb_mode())
phy.arm()

raw = phy.read_capture_data()

Several data contain this pattern based on capture. Is there a way to debug this(is there an interface function returning wether trigger has been issued)? Did I miss to set something?

Best regards,
Norbert

Hi Norbert,

First, are you using the latest code from the master branch? I’m confused because your use of phy.set_trigger(2,150,150) isn’t compatible with either the latest version, which supports multiple triggers:
def set_trigger(self, num_triggers=1, delays=[0], widths=[1], enable=True):

or the one prior to that which supported a single trigger:
def set_trigger(self, delay=0, width=1, enable=True):

Hopefully the issue lies with the above.
Some other ideas otherwise:

  • What’s the result of phy.usb.cmdReadMem(phy.REG_TRIGGER_ENABLE, 1)?
    1 means the trigger is enabled, 0 means it’s not.
  • I noticed you’re arming after powering the target. Are you sure that data is being captured? Does the blue “Armed” light turn off? The time when it turns off and the “Capturing” light turns on indicates when the trigger logic activates.
    What if you arm before powering the target?
  • if you run the trigger.ipynb tutorial unmodified from the repo, do you observe triggers?
  • the trigger output runs off a 240 MHz clock, so if its pulse width isn’t programmed to be sufficiently large, low-cost logic analyzers might not catch it

Regards,
Jean-Pierre

Thanks Jean-Pierre,

relocating arming, and the other suggestions solved the problem.