How to write an header in endpoint buffer of Cypress FX2LP

We're developing a device using a Cypress FX2LP (a camera with cmos sensor).

An image sensor sends pixels to FX2LP using slave fifo mode.

An interrupt on falling edge of a FRAME_VALID pin signals the end of the frame; during the endo of frame period no data will be written (SLWR is masked).

In that period of silence, we need to write an header of 12 bytes in endpoint 2, so that the following upcoming pixel data will be APPENDED in the same packet to the firmware-written header.

We have plenty of time to write the header (1 ms...) BUT we need to make the slave fifo interface APPEND the pixel data of next coming first line to the header that the firmware writes.

We are able to send packets written from firmware, OR sending packets written from slave fifo in AUTOIN mode.

But we are not able to write an header, and force the slave fifo logic NOT to overwrite the bytes already written by firmware.

We tried not to commit the packet without writing in the EP2 byte count registers, but in that case the header will be overwritten by slave fifo data. If we commit the buffer after writing the header, the packet will be sent, containing only the 12 bytes.

Seems that we need to send header + first pixel data in the same bulk packet, otherwise host driver won't be happy.

Is it possible, without introducing an external CPLD in the datapath ?

Reply to
Antonio Pasini
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.