Hello,
I have a use-case where a camera will be asynchronously plugged and unplugged into the TDA4. I have made an application to handle this, and to deal with detecting a disconnect usecase, reprobing the camera - etc.
After extended testing, I'm finding what appears to be a race condition where after some high volume of connect / disconnects, the CSIRX is stuck in a state where it cannot recover except via a reboot.
Below is some unorganized debugging information I've collected. There seem to be two "types" of crashes:
- CSIRX Registers:
- During some of the crashes - i get this behavior:
- During the lockup, status register 0x04504104 reports 0x80000111, 0x80000112 and 0x800001B3
- The IRQ register 0x04504028 reports several errors. Upon clearing it, I noticed these errors are permanently stuck: 0x00001060
- During other crashes:
- During the lockup, the status register 0x04504104 reports seemingly normal states, like 0x80000111, 0x80000112 and 0x80000133
- During some of the crashes - i get this behavior:
- Capture Node:
- During the crash event, the capture node will always timeout and receive a callback indicating that there not a new frame:
- the function `tivxCaptureTimeout` is never having the event `frame_available` posted via the callback `captDrvCallback`
- During the crash event, the capture node will always timeout and receive a callback indicating that there not a new frame:
- CSIRX Driver:
- Similarly, the CSIRX driver is not doing anything from what I can tell. I added printfs to the beginning of every function and see absolutely no activity after this happens
- (I added printfs to csirx_drv.c, csirx_event.c csirx_drvUdma.c)
- During one type of crash, the ECC and CRC IRQs get stuck high, and so the event service routine will endlessly process it on all available clock cycles when a camera is streaming
- During the other type of crash, I see no activity inside of the CSIRX driver
I believe the bug occurs the moment the camera stream is cut from the TDA4, and will not fix itself until it is rebooted. Other CSIRX ports will continue working. It takes hundreds of disconnects in order to reproduce this issue.
EDIT: I have reproduced the issue by simply disabling / enabling the CSI output of the deserializer. As far as I understand, this confirms the issue lies within the TDA4 somewhere - either the CSIRX driver chain or the CSIRX hardware.
I have a few questions:
- Where is this thing getting stuck? How could I debug it further? Can it be fixed?
- Is it possible that I could issue a soft reset to some device in the TDA4 such as the CSIRX or related nodes to get operation up and running again?
- I've tried the following soft resets with no luck:
- CSI_RX_IF_VBUS2APB_SOFT_RESET
- CSI_RX_IF_VBUS2APB_STREAM0_CTRL
- I've also tried tearing down the openvx pipeline completely - then recreating it. Unfortunately, this doesn't fix anything.
- I've tried the following soft resets with no luck:
