USB Debugging with sigrok

Summary

Sep 25, 2017
Advanced USB packet capture with logic analyzers and sigrok.

Demo Firmware

control-test.py

#! /usr/bin/env python3

import usb.core
import time

dev = usb.core.find(idVendor=0x0925, idProduct=0xD100)
if dev is None:
  raise ValueError('Device not found')

res = dev.ctrl_transfer(
  bmRequestType=0x40,                       # OUT, VENDOR, DEVICE request
  bRequest=1,                               # Request #1
  wValue=0xCAFE,
  wIndex=0xD00D,
  data_or_wLength=[0x01, 0x23, 0x45, 0x67])