Firmware update for Phywhisperer

Hi,Jean-Pierre,
I plan to run phwhisper on Linux system through jupyter. I can find the phwhisper device through “lsusb”, as follows:

shitou@shitou-virtual-machine:~/Desktop$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 2b3e:c610 NewAE Technology Inc. PhyWhisperer-USB
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The contents of the script file to be called are as follows:

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.reset_fpga()
phy.set_pattern([0x40, 0x00])
phy.arm()
phy.set_power_source("5V")
#wait a second for device enumeration, 'capturing' LED goes out
raw = phy.read_capture_data()
# WARNING:root:Capture FIFO overflow. Capture stopped when overflow detected.
packets = phy.split_packets(raw)
printPackets = pw.USBSimplePrintSink(highspeed=phy.get_usb_mode() == 'HS')
for packet in packets:
    printPackets.handle_usb_packet(ts=packet['timestamp'], buf=bytearray(packet['contents']), flags=0)

Copy the script to jupyter edit area. After running, the error message is as follows:

Traceback (most recent call last):
  File "/home/shitou/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py", line 287, in txrx
    response = self.get_possible_devices(payload)
  File "/home/shitou/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py", line 409, in get_possible_devices
    raise IOError("Failed to find USB backend. Check libusb drivers installed, check for path issues on library, and check for 32 vs 64-bit issues.")
OSError: Failed to find USB backend. Check libusb drivers installed, check for path issues on library, and check for 32 vs 64-bit issues.


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-6-9f2332ac45d8> in <module>
      2 
      3 phy = pw.Usb()
----> 4 phy.con()
      5 phy.addpattern = True #Adds captured data back, otherwise we capture 'after'
      6 phy.set_power_source("off")

~/.local/lib/python3.8/site-packages/phywhisperer/usb.py in con(self, PID, sn, program_fpga)
    113 
    114         self.usb = NAE.NAEUSB()
--> 115         self.usb.con(idProduct=[PID], serial_number=sn)
    116         self._llint = LLINT.PhyWhispererUSB(self.usb)
    117 

~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in con(self, idProduct, connect_to_first, serial_number)
    529         """
    530 
--> 531         devlist = self.get_possible_devices(idProduct)
    532 
    533         snlist = [d['sn'] + " (" + d['product'] + ")\n" for d in devlist]

~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in get_possible_devices(self, idProduct)
    522 
    523     def get_possible_devices(self, idProduct):
--> 524         return self.usbseralizer.get_possible_devices(idProduct)
    525 
    526     def con(self, idProduct=[0xACE2], connect_to_first=False, serial_number=None):

~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in get_possible_devices(self, idProduct)
    123         """Get a list of connected USB devices."""
    124         cmdpacket = self.make_cmd(self.GET_POSSIBLE_DEVICES, idProduct)
--> 125         return self.process_rx(self.txrx(tx=cmdpacket))
    126 
    127     def process_rx(self, inp):

~/.local/lib/python3.8/site-packages/phywhisperer/interface/naeusb.py in process_rx(self, inp)
    143 
    144         if resp == self.ERROR:
--> 145             raise payload
    146 
    147         return payload

OSError: Failed to find USB backend. Check libusb drivers installed, check for path issues on library, and check for 32 vs 64-bit issues.

shitou

First can you confirm whether or not you followed all of the Linux installation instructions here:
https://phywhispererusb.readthedocs.io/en/latest/installing.html#gnu-linux

Where is says:
sudo usermod -a -G plugdev YOUR-USERNAME

make sure you replace YOUR-USERNAME with your actual Linux username.

Hi,Jean-Pierre,
The current situation is as follows: I am running the Phywhisperer code in a Linux environment using Jupyter and it does not pass. The error is as follows:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 450, in get_possible_devices
    devlist = [{'sn': d.serial_number, 'product': d.product, 'pid': d.idProduct, 'vid': d.idVendor} for d in devlist]
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 450, in <listcomp>
    devlist = [{'sn': d.serial_number, 'product': d.product, 'pid': d.idProduct, 'vid': d.idVendor} for d in devlist]
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/core.py", line 854, in serial_number
    self._serial_number = util.get_string(self, self.iSerialNumber)
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/util.py", line 313, in get_string
    raise ValueError("The device has no langid"
ValueError: The device has no langid (permission issue, no string descriptors supported or device error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 450, in get_possible_devices
    devlist = [{'sn': d.serial_number, 'product': d.product, 'pid': d.idProduct, 'vid': d.idVendor} for d in devlist]
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 450, in <listcomp>
    devlist = [{'sn': d.serial_number, 'product': d.product, 'pid': d.idProduct, 'vid': d.idVendor} for d in devlist]
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/core.py", line 854, in serial_number
    self._serial_number = util.get_string(self, self.iSerialNumber)
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/util.py", line 313, in get_string
    raise ValueError("The device has no langid"
ValueError: The device has no langid (permission issue, no string descriptors supported or device error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 308, in txrx
    response = self.get_possible_devices(payload)
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 467, in get_possible_devices
    return self.get_possible_devices(idProduct, dictonly, "libusb0")
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 468, in get_possible_devices
    raise OSError("Unable to communicate with found ChipWhisperer. Check that another process isn't connected to it and that you have permission to communicate with it.")
OSError: Unable to communicate with found ChipWhisperer. Check that another process isn't connected to it and that you have permission to communicate with it.



---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-c59e23b073d4> in <module>
      1 import phywhisperer.usb as pw
      2 phy = pw.Usb()
----> 3 phy.con()
      4 phy.addpattern = True #Adds captured data back, otherwise we capture 'after'
      5 phy.set_power_source("off")

/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/usb.py in con(self, PID, sn, program_fpga, bitstream_file)
    120 
    121         self.usb = NAE.NAEUSB()
--> 122         self.usb.con(idProduct=[PID], serial_number=sn)
    123         self._llint = LLINT.PhyWhispererUSB(self.usb)
    124 

/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py in con(self, idProduct, connect_to_first, serial_number)
    615         """
    616 
--> 617         devlist = self.get_possible_devices(idProduct)
    618 
    619         snlist = [d['sn'] + " (" + d['product'] + ")\n" for d in devlist]

/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py in get_possible_devices(self, idProduct)
    608 
    609     def get_possible_devices(self, idProduct):
--> 610         return self.usbseralizer.get_possible_devices(idProduct)
    611 
    612     def con(self, idProduct=[0xACE2], connect_to_first=False, serial_number=None):

/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py in get_possible_devices(self, idProduct)
    126         """Get a list of connected USB devices."""
    127         cmdpacket = self.make_cmd(self.GET_POSSIBLE_DEVICES, idProduct)
--> 128         return self.process_rx(self.txrx(tx=cmdpacket))
    129 
    130     def process_rx(self, inp):

/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py in process_rx(self, inp)
    146 
    147         if resp == self.ERROR:
--> 148             raise payload
    149 
    150         return payload

OSError: Unable to communicate with found ChipWhisperer. Check that another process isn’t connected to it and that you have permission to communicate with it.

After setting up the Linux environment according to the link you gave, the system could not find the device, so I went back to my system.

However, the “sudo./viewsb.sh phywhisperer tui” command line can be executed and the captured data is basically the same as the data captured in a Windows phywhisperer environment.

I looked at the code in the viewsb project. The code fragment is as follows:

def run(self):
        """ Run a PhyWhisperer capture. """

        # TODO: provide here an offline mode where we don't connect the device and instead
        # call a variant of run_capture which reads from a file instead
        self.pw_device.con(program_fpga=True)

        try:
            halt_callback = lambda _ : self.termination_event.is_set()
            self.pw_device.run_capture(size=self.size, burst=self.burst, pattern=self.pattern, mask=self.mask, timeout=self.timeout, halt_callback=halt_callback)

        finally:
            self.pw_device.close()

I think the data is captured only once, not continuously. I don’t know if I understand right?

I try to connect the USB flash disk at the location of the target, and other contents will not be changed. After running, the interface in the previous figure will flash by, and then exit. The prompt message is as follows:

WARNING:root :Capture timed out!
WARNING:root :8190 entries captured.

I would like to ask if the phywhisper device supports reading U disk, keyboard, mouse and other universal USB devices? Is this situation captured successfully? Where can I see the captured data?

shitou

Hi ShiTou,

  1. There are a couple of possible reasons why you can’t run the Jupyter notebooks. The fact that you can connect to PhyWhisperer from viewsb means you should be almost there. First, make sure you’ve run the Linux-specific installation instructions - I’ve asked you to confirm this and you haven’t answered. The fact that you need to run viewsb as root suggests that you haven’t, so please review the installation instructions. Second, if your viewsb session is active, then you won’t be able to connect to the PhyWhisperer from Jupyter at the same time, so make sure any viewsb process is terminated.

  2. Data is captured once. PhyWhisperer has limited on-board storage (8190 entries, which are used for both USB data and timestamping that data) ; once that storage fills up, the host computer must read it before more data can be captured. Our tutorial notebooks is the best way to understand how this all works, and how to obtain the captured data. If you need to capture more data than what PhyWhisperer allows, look at the comparison table on the crowdsupply project page. However keep in mind that PhyWhisperer’s pattern-matching feature can allow it to be used with targets that generate a lot of data, by focusing on the portion of data that is relevant to you.

  3. PhyWhisperer supports any USB 2.0 LS/FS/HS device.

Hi,Jean-Pierre,
Set the VM environment according to the content of the document. At present, I can run the phwhisper code through jupyter to capture data, but I can only run it once. This is the first successful run:

The second time, there will be an error. The error code is 16,

The error message is as follows:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 310, in txrx
    response = self.open(serial_number=payload)
  File "/usr/local/lib/python3.8/dist-packages/phywhisperer-0.1.0-py3.8.egg/phywhisperer/interface/naeusb.py", line 364, in open
    dev.set_configuration()
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/core.py", line 905, in set_configuration
    self._ctx.managed_set_configuration(self, configuration)
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/core.py", line 159, in managed_set_configuration
    self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/backend/libusb1.py", line 812, in set_configuration
    _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))
  File "/usr/local/lib/python3.8/dist-packages/pyusb-1.1.1-py3.8.egg/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 16] Resource busy

and we need to plug and unplug the USB device again.

I have read the documents of the phwhisper, but there are few descriptions about the use of the device. Does the phwhisper device have the ability similar to the bus hound tool? Can you continuously capture the sent and received data without affecting the normal interaction?

shitou

When you say plug and unplug, are you referring to the USB target (i.e. what you’re connecting to the “target” port of PW), or are you referring to PW?

There shouldn’t be a need to replug the PW. If it’s the target, well that will depend on the target - perhaps it goes idle for a long time, unless you reset it?

It would be helpful if you copied here the complete notebook that you are running, to show what is run up to and including the point that the second capture fails. Can you write a minimal working example that shows the problem?

The documentation is contained within the example Jupyter notebooks; I encourage you to go through them all of them carefully. For example, the trigger.ipynb notebook shows an example of repeated captures.

Jean-Pierre

Hi,Jean-Pierre
Well, in the above question, I asked whether the phwhisper device can capture the data between me and the target board, such as my sending “00112233445566778899aabbccddeeff” and the target board’s returning “363 eff6cde1adea8b244ad2e3c4ebdc8”,In your previous answer, this function can be realized through viewsb, but in the past two days, the captured data only includes the process of device enumeration.

Or another kind of device, connecting the mouse, can the phwhisper device capture the click of the mouse or the movement of the position? Or if I connect the keyboard, can the phwhisper device get the key position that has been clicked on the keyboard?

Now what I can see is that the phywhisper device can enumerate the devices. For example, during the power-off and power on process, it can identify whether the connected device is a mouse or keyboard, or a USB 2.0 USB flash disk or our own development board. But there seems to be no actual data available.

shitou

Hi ShiTou,

I’m not sure how I can help you any further.

To be clear, I stated that ViewSB will help you parse the captured data.

PhyWhisperer captures everything that it sees, regardless of what the target is. However, it has limited storage capacity: once its storage is full, it cannot capture any more, until the data that it captured is read by the host, after which it can be re-armed to capture more data.

It’s expected that users make use the pattern match feature to capture data at the time of interest - however you define that to be. Of course in order to do this, you need to know what you’re looking for.

If you don’t know yet what you’re looking for, you may need a more powerful sniffer; we recommended the Beagle 480. This is all clearly explained on the project’s Crowdsupply page.

Jean-Pierre

Hi,Jean-Pierre
Sorry to disturb you.I want to share the whole requirement with you. We want to capture the data of USB interaction, including enumeration, sending and receiving data.

For example, if we connect a keyboard to a phwhisper device, if we capture USB data, we can capture the enumeration process of the device, including device model, PID, vid, USB version information, etc. After that, the key value will be captured and displayed. For example, enter “Hello world” on the keyboard, and the phwhisper device can capture this data. In addition, we want the phwhisper device to simulate the keyboard and replay the captured data.

For another example, we connect our development board to the phywhisper device, and the development board will run the AES encryption algorithm. We want to obtain the product name and model through the phywhisper device, and obtain the plaintext and ciphertext in each AES encryption operation of the development board. This process should be senseless, fast and continuous, which will not affect the normal interaction of the development board.

The effect we want to achieve is: open the capture window, the window works continuously, first enumerate the devices, then capture and display if the target has data interaction, if there is no data interaction, it is waiting to receive. I’d like to ask, have you ever done such a case? Or can phwhisper do this?

shitou

PhyWhisperer catches everything it sees, until its storage buffer is full. Then, the captured data needs to be downloaded by the host before PhyWhisperer can capture more data.

PhyWhisperer cannot be used to replay: it can only passively observe the USB traffic, it cannot change it or create it.

It sounds like PhyWhisperer is not the tool that you need. If you want to discuss further, you can submit a support ticket here:
https://support.newae.com/s/contactsupport

Jean-Pierre

Hi,Jean-Pierre,
I have installed a serial port debugging assistant in Linux environment, which can interact with the serial port devices connected on the phwhisper. The software operation is as follows:

When I run viewsb under Linux, I can only capture some device enumeration information, including device descriptor and configuration descriptor.The software operation is as follows:

When I look at the running code of the program, I find that the comments of the following code indicate that the capture process is a continuous process.

    def run(self):
    """ Run this core analysis thread until the frontend requests we stop. Performs the USB analysis itself. """

    # Start our core bg/fg threads.
    self.backend.start()
    self.frontend.start()

    # Run our analysis main-loop until we should quit.
    while not self.should_halt():

        # TODO: handle event-packet exchange with the UI
        # this should be coming Soon (TM)

        # If we're in a state where packets may arrive, try to receive them.
        if self.packets_may_arrive():
            self.run_analysis_iteration()

        # Otherwise, block the process a bit to give the CPU some time off.
        else:
            time.sleep(self.PACKET_READ_TIMEOUT)


    # FIXME: signal to the frontend to stop (if it didn't signal us to stop?)
    self.backend.stop()
    self.frontend.stop()

I try to make the last two lines of code do not work. After running the code again, the serial debugging tool can send and receive data normally, but the viewsb USB analyzer tool does not display the data sent and received.
What should I do? Or to whom?

Shitou

Hi,Jean-Pierre,
In the process of looking at the code, I found such a description:

    def run(self):
    """ Run a PhyWhisperer capture. """

    # TODO: provide here an offline mode where we don't connect the device and instead
    # call a variant of run_capture which reads from a file instead
    self.pw_device.con(program_fpga=True)

    try:
        halt_callback = lambda _ : self.termination_event.is_set()
        self.pw_device.run_capture(size=self.size, burst=self.burst, pattern=self.pattern, mask=self.mask, timeout=self.timeout, halt_callback=halt_callback)

    finally:
        self.pw_device.close()

I’d like to confirm these two lines with you:

   # TODO: provide here an offline mode where we don't connect the device and instead
    # call a variant of run_capture which reads from a file instead

I’d like to make sure that reading data from the file is about to be done, or has it been implemented below?

Shitou

Hi Shitou,

ViewSB is not our project. But from what I can see it looks like it’s working as it should.
You need to understand that PhyWhisperer cannot capture all of the USB traffic because it has limited storage, as I’ve tried to explain before.
Jean-Pierre

Hi,Jean-Pierre,

I run phywhisper code in Windows system,I modified the capture script below

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.reset_fpga()
phy.set_pattern([0x2d, 0x00])
phy.arm()
phy.set_power_source("host")

raw = phy.read_capture_data()

packets = phy.split_packets(raw)
printPackets = pw.USBSimplePrintSink(highspeed=phy.get_usb_mode() == 'HS')
for packet in packets:
    printPackets.handle_usb_packet(ts=packet['timestamp'], buf=bytearray(packet['contents']), flags=0)

The modified script is as follows:

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")

while 1 == 1:
    phy.reset_fpga()
    phy.set_usb_mode('FS')
    phy.set_capture_size(0xffff)
    phy.set_pattern(pattern=[0x2d, 0x00],mask=[0xff,0xff])
    phy.arm()
    phy.set_power_source("host")
    raw = phy.read_capture_data(timeout=5)
    # WARNING:root:Capture FIFO overflow. Capture stopped when overflow detected.
    packets = phy.split_packets(raw)
    printPackets = pw.USBSimplePrintSink(highspeed=phy.get_usb_mode() == 'HS')
    # file = open('return_out.txt', 'w')
    # for i in range(len(packets)):
    #     s = str(packets[i]).replace('{', '').replace('}', '').replace("'", '') + '\n'
    #     file.write(s)
    # file.close()
    for packet in packets:
        printPackets.handle_usb_packet(ts=packet['timestamp'], buf=bytearray(packet['contents']), flags=0)
    # phy.wait_disarmed()
print("END")

As you can see, the current collection process has become a circular collection, and data will be continuously captured.

However, from the results of the capture, there is only data for the first time, and there is no data for subsequent operations.

Here are twenty lines of the captured results:

    [      ]   0.000000 d=  0.000000 [   .0 +  0.017] [  1] Err - bad PID of 00 
    [      ]   0.000001 d=  0.000001 [   .0 +  1.267] [ 11] DATA0: 80 06 00 01 00 00 40 00 dd 94 
    [      ]   0.000010 d=  0.000009 [   .0 +  9.850] [  1] ACK 
    [      ]   0.000015 d=  0.000006 [   .0 + 15.433] [  3] IN   : 0.0 
    [      ]   0.000019 d=  0.000003 [   .0 + 18.767] [  1] NAK 
    [      ]   0.000041 d=  0.000022 [   .0 + 41.017] [  3] IN   : 0.0 
    [      ]   0.000044 d=  0.000003 [   .0 + 44.350] [ 11] DATA1: 12 01 10 01 ff 00 02 08 20 03 
    [      ]   0.000053 d=  0.000009 [   .0 + 53.017] [  1] ACK 
    [      ]   0.000058 d=  0.000005 [   .0 + 57.517] [  3] OUT  : 0.0 
    [      ]   0.000061 d=  0.000003 [   .0 + 60.767] [  3] DATA1: 00 00 
    [      ]   0.000064 d=  0.000003 [   .0 + 64.017] [  1] NAK 
    [      ]   0.000086 d=  0.000022 [   .0 + 86.100] [  3] OUT  : 0.0 
    [      ]   0.000089 d=  0.000003 [   .0 + 89.350] [  3] DATA1: 00 00 
    [      ]   0.000093 d=  0.000003 [   .0 + 92.600] [  1] ACK 
    [      ]   0.033188 d=  0.033096 [113   +  3.250] [  3] SETUP: 0.0 
    [      ]   0.033192 d=  0.000003 [113   +  6.500] [ 11] DATA0: 00 05 22 00 00 00 00 00 ec 76 
    [      ]   0.033200 d=  0.000009 [113   + 15.083] [  1] ACK 
    [      ]   0.033202 d=  0.000002 [113   + 17.167] [  3] IN   : 0.0 
    [      ]   0.033206 d=  0.000003 [113   + 20.417] [  3] DATA1: 00 00 
    [      ]   0.033209 d=  0.000003 [113   + 23.667] [  1] ACK 

The following are the results of the first cycle, the second and the third capture. You can see that the length of the second and the third capture is 0.

    [      ]   0.197656 d=  0.000030 [ 21   +473.333] [  3] IN   : 34.2 
    [      ]   0.197659 d=  0.000003 [ 21   +476.583] [  1] NAK 
    [      ]   0.197683 d=  0.000024 [ 21   +500.833] [  3] IN   : 34.2 
    [      ]   0.197687 d=  0.000003 [ 21   +504.083] [  1] NAK 
    [      ]   0.197709 d=  0.000022 [ 21   +526.333] [  3] IN   : 34.2 
    [      ]   0.197712 d=  0.000003 [ 21   +529.667] [  1] NAK 
    [      ]   0.197761 d=  0.000049 [ 21   +578.917] [  3] IN   : 34.2 
    [      ]   0.197765 d=  0.000003 [ 21   +582.167] [  1] NAK 
    [      ]   0.197804 d=  0.000039 [ 21   +621.333] [  3] IN   : 34.2 
    [      ]   0.197807 d=  0.000003 [ 21   +624.667] [  1] NAK 
    [      ]   0.197841 d=  0.000034 [ 21   +658.333] [  3] IN   : 34.2 
    [      ]   0.197844 d=  0.000003 [ 21   +661.583] [  1] NAK 
    [      ]   0.197885 d=  0.000041 [ 21   +702.333] [  3] IN   : 34.2 
    [      ]   0.197888 d=  0.000003 [ 21   +705.583] [  1] NAK 
    [      ]   0.197918 d=  0.000030 [ 21   +735.333] [  3] IN   : 34.2 
    [      ]   0.197921 d=  0.000003 [ 21   +738.667] [  1] NAK 
    WARNING:root:Capture timed out!
    WARNING:root:0 entries captured.
    WARNING:root:Capture timed out!
    WARNING:root:0 entries captured.

It is worth noting that after the first power on to the target board, I have used the serial debugging assistant to connect the serial device, and used the automatic sending function to send repeated plaintext to the target board all the time, and the serial device returned to normal.

I would like to ask the following questions:

  1. First of all, is my approach feasible?

  2. Is the failure to capture data for the second time or later caused by the cache problem?

  3. Is there a function to clear the cache that I can try?

My best wishes to you
Shitou

Hi Shitou,

I’m not sure why your code doesn’t work. Likely it’s because you’re setting the capture size too high; if you run help(phy.set_capture_size), you’ll see that:

Since the capture FIFO can hold 8188 events, setting this to > 8188 may result in overflow.

I understand that you want to capture more data than what the PhyWhisperer is able to capture. Unfortunately you are trying to make PhyWhisperer do something that it cannot do.

Can you email sales@newae.com, with a link to this thread, and we’ll take it from there?
Thanks,
Jean-Pierre