Logging/data capture within buspirate

This is just a thought: Would it be usefull to be able to capture the data passing through the buspirate to the flash, basically record what gets sent to the io ports and received. Possibly in binary format. And when in bridge mode.

A use case would be trying to reverse engineer a protocol by using the buspirate as a man in the middle or just capture a log or trace. e.g. Using the buspirate as a smart card (sim) reader using existing external tooling talking to the upstream software and downstream to a smart card.

I suspect could be an issue with write cycles/wear levelling on the flash chip.

For some use cases the format might be best as user readable and for some a binary format. For some reasons I am thinking wireshark pcap might be worth looking at…

This is probably a more general answer to dumping flash chips to file.


I’m also a bit concerned about thrashing the flash chip. However, we have a 128K “BIG BUFFER” that is shared (fake malloc) between the scope, logic analyzer, and disk format command (more soon too…). We could store at least a sector there at a time before logging to the disk. Or, store in the big buffer and dump to disk with a command when you think you have something good in the buffer?

Wouldn’t it be simpler just transmitting the data over USB and let the host save the capture?

Another concern in the limited write speed to the NAND flush, depending on the sampling speed that you want, across all 8 pin could overwhelm the flush chip or the SPI bus.

True, but I assume I assume the use case is long term PC sleep proof logging. It just sits theres and you can trust it to record stuff

I disagree, in general BP is relaying on the host computer in order to operate, there are some handy features like dumping flash chip’s memory into internal storage, so the user would not have to have flashrom program or a similar program installed on his computer.
But in this case he would need a special program in order to decode the binary capture anyway. And the limited onboard storage would fill up eventually, preventing long captures anyway.


I was not so much thinking of long term logging but you have just spent a while trying to get something working, possibly with the use of other tools or are using the buspirate as Man In the middle to reverse engineer an interface. So saving the last 32K(?) in a rotating buffer that you can then save afterwards might be enough.

For long term logging I would use other tools and a raspberry pi,

But I also like the idea of dumping the data to the host system.

1 Like

The big buffer can definitely be used for that. Some man in the middle stuff is on my list to implement, I’ve made a note to keeping traces and dump to display or log file when requested.