msdk icon indicating copy to clipboard operation
msdk copied to clipboard

CSI2 retention problem in standby mode

Open isztldav opened this issue 1 year ago • 2 comments

Board: devkit max78002

In short: I took the provided CSI2 example, implemented "standby mode", and added the call to int mipi_camera_sleep(int sleep).
While the wake/sleep cycle seems to work well, the camera capture will throw errors and after some time suddenly work (for one frame).

Source code: I just changed the main file: main.zip
basically adding static void _go_to_sleep(void) and static void _setup_btn_wake(void).

Image: Screenshot from 2024-05-08 09-26-58

Thank you for your help!

isztldav avatar May 08 '24 07:05 isztldav

Thanks @isztldav - I've been able to replicate the issue. This is reminiscent of some deep-rooted timing issues in our CSI hardware I've dealt with in the past. I hadn't tested captures from STANDBY.

There also seems to be some issues with the sleep functions specific to the OV5640 drivers. If I remove the mipi_camera_sleep calls I can get things working in Sleep Mode and Low Power Mode, which leave the peripherals fully powered on. I think we need to re-examine our sleep mode functions for the camera too.

Micro-Power Mode (UPM) fails with the same random CTRL error flags. That mode actually puts the peripherals in state retention, so there seems to be some core issue with the state retention logic for the CSI2 peripheral in general.

Jake-Carter avatar May 13 '24 23:05 Jake-Carter

Thank you for confirming this. For now my best workaround is to spam the capture function until magically one frame is transmitted from the camera.

isztldav avatar May 22 '24 09:05 isztldav