ataradov / usb-sniffer-lite

A simple USB sniffer based on Raspberry Pi RP2040
BSD 3-Clause "New" or "Revised" License
542 stars 49 forks source link

Does not function yet #10

Closed WillemOuwerkerk closed 5 months ago

WillemOuwerkerk commented 5 months ago

Hi Ataradov,

I installed the UF2 and made me a primitive cable. Can get the menu in a terminal screen, but i can't get it to capture any data. Both USB connectors are connected to the same bus.

And i do not understand the function of the start key, can you explain this to me?

Kind regards, Willem Ouwerkerk

ataradov commented 5 months ago

What do you mean by the "same bus"? Can you describe your connections in more detail? What is your device under test?

The start key actually starts the capture.

WillemOuwerkerk commented 5 months ago

They are connected to the same USB hub What is the difference between the START key and the trigger key? My first device is an USB to RS232 dongle

ataradov commented 5 months ago

What exact device you are trying to capture? What IC is it based on? Are you sure it is FS/LS device?

Trigger is not a key, it is a signal. If enabled, then after you start the capture, the sniffer will wait for the trigger signal. It is useful if you are debugging your own firmware and can toggle a GPIO at the point of interest. If you are capturing existing devices, then trigger is rarely useful. Disable it.

WillemOuwerkerk commented 5 months ago

Ok now i understand it's function, nice. The dongle is a PL2302just to try it out I want to use it to write a custom RP2040 usb driver

ataradov commented 5 months ago

PL2302 is a Full-Speed device, so you should be able to capture it. If you don't see any frames when you start the capture, then you will have to provide more details of your setup.

What custom USB driver? I'm confused.

WillemOuwerkerk commented 5 months ago

Oh i just want to understand the built-in USB of the RP2040

usb dongles

afbeelding

ataradov commented 5 months ago

This photo is not useful at all. There is nothing I can tell from it.

If you just want to understand USB part, then this project may be more useful https://github.com/ataradov/free-dap/tree/master/platform/rp2040 It is a CMSIS-DAP programmer + VCP without complexities of the sniffer part.

WillemOuwerkerk commented 5 months ago

What do you need to know from me tot help me? Is the start key toggle or need i keep it pressed?

made the simple connector as you adviced to GPIO10 & 11 A switch to GPIO12 and the status led blinks

I plugged all devices including the sniffer in the same usb-hub.

ataradov commented 5 months ago

I need a diagram of all your connections.

Actually, it makes no sense. The USB bus from the IC to the hub here is inside the plug. And this is the bus you want to observe.

This style of simple splice only works for devices with mini/micro USB connector. This way you can take a standard USB-A to micor-USB cable and tap in the middle.

The sniffer can't capture anything thorough the hub, it need to observe the bus between the hub and the device.

Plugging in the target interface (GPIO10 and 11) into the hub will do nothing, since hub does not carry any data on those pins if there is no device connected to that port.

WillemOuwerkerk commented 5 months ago

Hi Alex,

Now i think that i start to understand how it must be used. Is it like this?

afbeelding

ataradov commented 5 months ago

Yes, exactly. The sniffer passively observes the communication.

WillemOuwerkerk commented 5 months ago

Thanks, i am going to make the correct cable Also thanks for the pointer to your example code

WillemOuwerkerk commented 5 months ago

Thanks Alex, it's working now

ataradov commented 5 months ago

Closing the issue then.