-
Notifications
You must be signed in to change notification settings - Fork 104
Description
I am working on pure-C implementation for OpenVizsla host software: https://github.com/matwey/libopenvizsla
I've faced the following issue with FPGA firmware last summer.
I have been not able to make FPGA reliable restart sniffed data transmission.
The issue itself is the following.
The protocol has two encapsulation levels.
The upper level is packets come from SDRAM buffering module.
The packets consists of 0x0D magic header, length byte, and the data.
On practice this packets are of the same length.
The nested data is a stream consisted of packets from captured data.
They are consisted of 0xA0 magic header, length and USB data.
This packets are not aligned with each other.
One 0x0D-packet may consisted many 0xA0-packets, and 0xA0-packet may be split between two consecutive 0x0D-packets.
When I stop capturing and streaming and start it again then the first data byte of the first 0x0D-packet is not 0xA0 which it should be.
This is an issue because there is no other reliable way to sync 0xA0-packet stream. We cannot just scan for first 0xA0 because 0xA0 byte may be consisted inside data itself (compare with SLIP protocol).
My stop sequence is the following:
-
write
0toSDRAM_HOST_READ_GO(0xC28) -
write
0toSDRAM_SINK_GO(0xE11) -
write
0toCSTREAM_CFG(0x800)
My start sequence is the following (given I assured that the stream is stopped):
-
write 32-bit
0toSDRAM_SINK_RING_BASE(0xE09) -
write 32-bit
0x01000000toSDRAM_SINK_RING_END(0xE0D) -
write 32-bit
0toSDRAM_HOST_READ_RING_BASE(0xC1C) -
write 32-bit
0x01000000toSDRAM_HOST_READ_RING_END(0xC20) -
write
0toSDRAM_SINK_PTR_READ(0xE00) -
write
1toCSTREAM_CFG(0x800) -
write
1toSDRAM_SINK_GO(0xE11) -
write
1toSDRAM_HOST_READ_GO(0xC28)
I've tried to add Reset for sdram_fifo in SDRAM_Sink and SDRAM_Host_Read to reset fifoes on SDRAM_SINK_GO/SDRAM_HOST_READ_GO switch but this didn't help.
The issue is still present in the latest firmware from new_migen branch.