From ba541620dcde0622234dcd6653374abaf1fa01ce Mon Sep 17 00:00:00 2001 From: Jorge Centeno Date: Mon, 28 Sep 2026 03:35:58 +0000 Subject: [PATCH] hi3516ev200/sc2235: repeat DVP pad setup after stream start Without this the Imou Cue 2 (IPC-C22EN, Hi3516EV200 + SC2235 on the DVP pads) gets no pixel clock and VI never counts a frame interrupt. The sequence is taken from the vendor (Dahua) firmware's init table, which writes 0x3d08/0x3640/0x3641 after the first 0x0100=0x01 and then starts streaming again. Only these writes are added; the rest of the table is unchanged for existing boards. --- .../hi3516ev200/smart_sc2235/sc2235_sensor_ctl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/sensor/hi3516ev200/smart_sc2235/sc2235_sensor_ctl.c b/libraries/sensor/hi3516ev200/smart_sc2235/sc2235_sensor_ctl.c index 2c23dfaf..6c57e4ba 100644 --- a/libraries/sensor/hi3516ev200/smart_sc2235/sc2235_sensor_ctl.c +++ b/libraries/sensor/hi3516ev200/smart_sc2235/sc2235_sensor_ctl.c @@ -331,6 +331,16 @@ void sc2235_linear_1080p30_init(VI_PIPE ViPipe) delay_ms(20); sc2235_write_register(ViPipe, 0x0100, 0x01); + // On the Imou Cue 2 (IPC-C22EN) the sequence above alone leaves the + // SoC with no pixel clock. Its vendor (Dahua) firmware repeats the DVP + // pad setup once the sensor is streaming, with stronger drive, and + // then starts streaming again. + delay_ms(20); + sc2235_write_register(ViPipe, 0x3d08, 0x01); + sc2235_write_register(ViPipe, 0x3640, 0x01); + sc2235_write_register(ViPipe, 0x3641, 0x02); + sc2235_write_register(ViPipe, 0x0100, 0x01); + printf("=== Smart SC2235_1080P_30FPS_10BIT_LINE_Init_OK!===\n"); return;