DM6435, raw video acquisition from an fpga with external sync.
For application dependent reasons, the video stream can be randomly interrupted, even in the middle of a frame, and restarted with a brand new frame after some time.
The idea is to reset the VPSS with the PSC to recover after the video in "break", before enabling the vpfe again.
The problem is that sometimes the PSC_PTSTAT flag doesn't get cleared, like if some activity was still pending inside the peripheral. The code is below.
Is this something expected?
Can there be a workaround?
Of course the answer should be… never interrupt the video, but again it’s something that they cannot control.
Best regards
Massimo
============
#define PSC_BASE 0x01C41000
#define PSC_PTCMD *((volatile UINT32 *) (PSC_BASE + 0x120))
#define PSC_PTSTAT *((volatile UINT32 *) (PSC_BASE + 0x128))
#define PSC_MDCTL_BASE (PSC_BASE + 0xA00)
…
// disable the CCD controller writing 0 to PCR.ENABLE
.....
//
*((volatile UINT32 *) (PSC_MDCTL_BASE + 0)) = 0x1;
*((volatile UINT32 *) (PSC_MDCTL_BASE + 4)) = 0x1;
PSC_PTCMD = 0x0001; // Transition power (ALWAYSON)
while (PSC_PTSTAT & 0x0001) ; // Wait for transtion to finish /// HANGS HERE SOMETIMES
*((volatile UINT32 *) (PSC_MDCTL_BASE + 0)) = 0x3;
*((volatile UINT32 *) (PSC_MDCTL_BASE + 4)) = 0x3;
PSC_PTCMD = 0x0001; // Transition power (ALWAYSON)
while (PSC_PTSTAT & 0x0001) ; // Wait for transtion to finish