Problem with sensor SC035GS #122

Open
opened 2026-02-16 11:49:08 -05:00 by artuppp · 0 comments
artuppp commented 2026-02-16 11:49:08 -05:00 (Migrated from github.com)

I am trying to make sensor SC035GS (with seems to be officially supported) work with the LicheeRV Nano, I am wiring the MIPI Lanes into 2, 0 and 1, as it appears in cs035gs_cmos.c. My /mnt/data/sensor_cfg.ini is configured as follows:

# cat /mnt/data/sensor_cfg.ini
[source]

;type = SOURCE_USER_FE

dev_num = 1

; section for sensor

[sensor]

; sensor name
name = SMS_SC035GS_MIPI_480P_120FPS_12BIT

bus_id = 4

sns_i2c_addr = 48

mipi_dev = 0

lane_id = 2, 0, 1, -1, -1

pn_swap = 1, 1, 1, 0, 0

mclk_en = 0

mclk = 0

;port = 0

;pin = 2

;pol = 1

;fps = 120

When I try to run the sensor_test, parsing of the configuration seems good but it looks like a mismatch somewhere. After that, MIPI_RX app it while-trued displayed.

# sensor_test 
[sys_vi_init]-41: MMF Version:752683e13-musl_riscv64
[SAMPLE_COMM_SNS_ParseIni]-2185: Parse /mnt/data/sensor_cfg.ini
[parse_source_devnum]-1778: devNum =  1
[parse_sensor_name]-1859: sensor =  SMS_SC035GS_MIPI_480P_120FPS_12BIT
[parse_sensor_busid]-1888: bus_id =  4
[parse_sensor_i2caddr]-1899: sns_i2c_addr =  48
[parse_sensor_mipidev]-1910: mipi_dev =  0
[parse_sensor_laneid]-1921: Lane_id =  2, 0, 1, -1, -1
[parse_sensor_pnswap]-1932: pn_swap =  1, 1, 1, 0, 0
[parse_sensor_mclken]-1954: mclk_en =  0
[parse_sensor_mclk]-1965: mclk =  0
[SAMPLE_PLAT_SYS_INIT]-72: common pool[0] BlkSize 491520
ISP Vipipe(0) Allocate pa(0x898c0000) va(0x0x3fdf3b1000) size(291424)
stSnsrMode.u16Width 640 stSnsrMode.u16Height 480 120.000000 wdrMode 0 pstSnsObj 0xee1e8
[SAMPLE_COMM_VI_StartMIPI]-494: sensor 0 stDevAttr.devno 0
awbInit ver 6.9@2021500
0 R:1400 B:3100 CT:2850
1 R:1500 B:2500 CT:3900
2 R:2300 B:1600 CT:6500
Golden 1024 1024 1024
WB Quadratic:0
isWdr:0
19700101 00:01:23.513 0562 E isp setNoiseProfile:3460 Noise profile get fail. Please check
###########   PinMux  #######################################################################
###########   PinMux End  #######################################################################
ViPipe:0,===SC035GS 480P 120fps 12bit LINE Init OK!===
********************************************************************************
cvi_bin_isp message
gerritId:      97347          commitId:      fc6ce647       
md5:           d6db2297ddfd44e8252c1f3f888f47b2
sensorNum      1              
sensorName0    35             

PQBIN message
gerritId:      
              commitId:      fc6ce647       
md5:           d6db2297ddfd44e8252c1f3f888f47b2
sensorNum      1              
sensorName0    4653           

author:        lxowalle       desc:          gc4653 30fps   
createTime:    2024-03-26 13:41:34version:                      
tool Version:       v3.0.5.48           mode:      
********************************************************************************
sensorName(0) mismatch, mwSns:35 != pqBinSns:4653
[SAMPLE_COMM_ISP_Thread]-95: ISP Dev 0 running!
[main]-538: ---Basic------------------------------------------------
[main]-539: 1: dump vi raw frame
[main]-540: 2: dump vi yuv frame
[main]-541: 3: set chn flip/mirror
[main]-542: 4: linear wdr switch
[main]-543: 5: AE debug
[main]-544: 6: sensor dump
[main]-545: 7: sensor proc
[main]-546: 255: exit

Module: [MIPI_RX], Build Time[#13 PREEMPT Thu Sep 5 16:28:45 CST 2024]

------------Combo DEV ATTR--------------
   Devno  WorkMode  DataType   WDRMode         LinkId        PN Swap  SyncMode  DataEndian  SyncCodeEndian
       0      MIPI     RAW10      NONE  2, 0, 1,-1,-1  1, 1, 1, 0, 0       N/A         N/A             N/A

------------MIPI info-------------------
 Devno EccErr CrcErr HdrErr WcErr fifofull   decode
     0      0      0      0     0        0  unknown
  Physical:       D0       D1       D2       D3       D4       D5
                   0        0        0        0        0        0
   Digital:       D0       D1       D2       D3    CK_HS  CK_ULPS  CK_STOP   CK_ERR   Deskew
             hs_idle  hs_idle  hs_idle  hs_idle        0        0        1        0     idle
[VI BE_Dbg_Info]
VIPreBEDoneSts		:0x0		VIPreBEDmaIdleStatus	:0x0
[VI Post_Dbg_Info]
VIIspTopStatus		:0x0
[VI DMA_Dbg_Info]
VIWdma0ErrStatus	:0x0	VIWdma0IdleStatus	:0x0
VIWdma1ErrStatus	:0x0	VIWdma1IdleStatus	:0x0
VIRdmaErrStatus		:0x0	VIRdmaIdleStatus	:0x0
[VI ISP_PIPE_A FE_Dbg_Info]
VIPreFERawDbgSts	:0x0		VIPreFEDbgInfo		:0x0
[VI ISP_PIPE_A]
VIOutImgWidth		: 640
VIOutImgHeight		: 480
VIInImgWidth		: 640
VIInImgHeight		: 480
VIDevFPS		:   0
VIFPS			:   0
VISofCh0Cnt		:   0
VIPreFECh0Cnt		:   0
VIPreBECh0Cnt		:   0
VIPostCnt		:   0
VIDropCnt		:   0
VIDumpCnt		:   0
[VI ISP_PIPE_A Csi_Dbg_Info]
VICsiIntStatus0		:0x0
VICsiIntStatus1		:0x0
VICsiCh0Dbg		:0x0
VICsiCh1Dbg		:0x0
VICsiOverFlowCnt	:   0
VICsiCh0WidthGTCnt	:   0
VICsiCh0WidthLSCnt	:   0
VICsiCh0HeightGTCnt	:   0
VICsiCh0HeightLSCnt	:   0

Module: [MIPI_RX], Build Time[#13 PREEMPT Thu Sep 5 16:28:45 CST 2024]

------------Combo DEV ATTR--------------
   Devno  WorkMode  DataType   WDRMode         LinkId        PN Swap  SyncMode  DataEndian  SyncCodeEndian
       0      MIPI     RAW10      NONE  2, 0, 1,-1,-1  1, 1, 1, 0, 0       N/A         N/A             N/A

------------MIPI info-------------------
 Devno EccErr CrcErr HdrErr WcErr fifofull   decode
     0      0      0      0     0        0  unknown
  Physical:       D0       D1       D2       D3       D4       D5
                   0        0        0        0        0        0
   Digital:       D0       D1       D2       D3    CK_HS  CK_ULPS  CK_STOP   CK_ERR   Deskew
             hs_idle  hs_idle  hs_idle  hs_idle        0        0        0        0     idle
[VI BE_Dbg_Info]
VIPreBEDoneSts		:0x0		VIPreBEDmaIdleStatus	:0x0
[VI Post_Dbg_Info]
VIIspTopStatus		:0x0
[VI DMA_Dbg_Info]
VIWdma0ErrStatus	:0x0	VIWdma0IdleStatus	:0x0
VIWdma1ErrStatus	:0x0	VIWdma1IdleStatus	:0x0
VIRdmaErrStatus		:0x0	VIRdmaIdleStatus	:0x0
[VI ISP_PIPE_A FE_Dbg_Info]
VIPreFERawDbgSts	:0x0		VIPreFEDbgInfo		:0x0
[VI ISP_PIPE_A]
VIOutImgWidth		: 640
VIOutImgHeight		: 480
VIInImgWidth		: 640
VIInImgHeight		: 480
VIDevFPS		:   0
VIFPS			:   0
VISofCh0Cnt		:   0
VIPreFECh0Cnt		:   0
VIPreBECh0Cnt		:   0
VIPostCnt		:   0
VIDropCnt		:   0
VIDumpCnt		:   0
[VI ISP_PIPE_A Csi_Dbg_Info]
VICsiIntStatus0		:0x0
VICsiIntStatus1		:0x0
VICsiCh0Dbg		:0x0
VICsiCh1Dbg		:0x0
VICsiOverFlowCnt	:   0
VICsiCh0WidthGTCnt	:   0
VICsiCh0WidthLSCnt	:   0
VICsiCh0HeightGTCnt	:   0
VICsiCh0HeightLSCnt	:   0

Module: [MIPI_RX], Build Time[#13 PREEMPT Thu Sep 5 16:28:45 CST 2024]

------------Combo DEV ATTR--------------
   Devno  WorkMode  DataType   WDRMode         LinkId        PN Swap  SyncMode  DataEndian  SyncCodeEndian
       0      MIPI     RAW10      NONE  2, 0, 1,-1,-1  1, 1, 1, 0, 0       N/A         N/A             N/A

------------MIPI info-------------------
 Devno EccErr CrcErr HdrErr WcErr fifofull   decode
     0      0      0      0     0        0  unknown
  Physical:       D0       D1       D2       D3       D4       D5
                   0        0        0        0        0        0
   Digital:       D0       D1       D2       D3    CK_HS  CK_ULPS  CK_STOP   CK_ERR   Deskew
             hs_idle  hs_idle  hs_idle  hs_idle        0        0        1        0     idle

.......

Why is the mismatch appearing? Do I have to change any other configuration in another place? Any help is appreciated!

I am trying to make sensor SC035GS (with seems to be officially supported) work with the LicheeRV Nano, I am wiring the MIPI Lanes into 2, 0 and 1, as it appears in cs035gs_cmos.c. My /mnt/data/sensor_cfg.ini is configured as follows: ``` # cat /mnt/data/sensor_cfg.ini [source] ;type = SOURCE_USER_FE dev_num = 1 ; section for sensor [sensor] ; sensor name name = SMS_SC035GS_MIPI_480P_120FPS_12BIT bus_id = 4 sns_i2c_addr = 48 mipi_dev = 0 lane_id = 2, 0, 1, -1, -1 pn_swap = 1, 1, 1, 0, 0 mclk_en = 0 mclk = 0 ;port = 0 ;pin = 2 ;pol = 1 ;fps = 120 ``` When I try to run the sensor_test, parsing of the configuration seems good but it looks like a mismatch somewhere. After that, MIPI_RX app it while-trued displayed. ``` # sensor_test [sys_vi_init]-41: MMF Version:752683e13-musl_riscv64 [SAMPLE_COMM_SNS_ParseIni]-2185: Parse /mnt/data/sensor_cfg.ini [parse_source_devnum]-1778: devNum = 1 [parse_sensor_name]-1859: sensor = SMS_SC035GS_MIPI_480P_120FPS_12BIT [parse_sensor_busid]-1888: bus_id = 4 [parse_sensor_i2caddr]-1899: sns_i2c_addr = 48 [parse_sensor_mipidev]-1910: mipi_dev = 0 [parse_sensor_laneid]-1921: Lane_id = 2, 0, 1, -1, -1 [parse_sensor_pnswap]-1932: pn_swap = 1, 1, 1, 0, 0 [parse_sensor_mclken]-1954: mclk_en = 0 [parse_sensor_mclk]-1965: mclk = 0 [SAMPLE_PLAT_SYS_INIT]-72: common pool[0] BlkSize 491520 ISP Vipipe(0) Allocate pa(0x898c0000) va(0x0x3fdf3b1000) size(291424) stSnsrMode.u16Width 640 stSnsrMode.u16Height 480 120.000000 wdrMode 0 pstSnsObj 0xee1e8 [SAMPLE_COMM_VI_StartMIPI]-494: sensor 0 stDevAttr.devno 0 awbInit ver 6.9@2021500 0 R:1400 B:3100 CT:2850 1 R:1500 B:2500 CT:3900 2 R:2300 B:1600 CT:6500 Golden 1024 1024 1024 WB Quadratic:0 isWdr:0 19700101 00:01:23.513 0562 E isp setNoiseProfile:3460 Noise profile get fail. Please check ########### PinMux ####################################################################### ########### PinMux End ####################################################################### ViPipe:0,===SC035GS 480P 120fps 12bit LINE Init OK!=== ******************************************************************************** cvi_bin_isp message gerritId: 97347 commitId: fc6ce647 md5: d6db2297ddfd44e8252c1f3f888f47b2 sensorNum 1 sensorName0 35 PQBIN message gerritId: commitId: fc6ce647 md5: d6db2297ddfd44e8252c1f3f888f47b2 sensorNum 1 sensorName0 4653 author: lxowalle desc: gc4653 30fps createTime: 2024-03-26 13:41:34version: tool Version: v3.0.5.48 mode: ******************************************************************************** sensorName(0) mismatch, mwSns:35 != pqBinSns:4653 [SAMPLE_COMM_ISP_Thread]-95: ISP Dev 0 running! [main]-538: ---Basic------------------------------------------------ [main]-539: 1: dump vi raw frame [main]-540: 2: dump vi yuv frame [main]-541: 3: set chn flip/mirror [main]-542: 4: linear wdr switch [main]-543: 5: AE debug [main]-544: 6: sensor dump [main]-545: 7: sensor proc [main]-546: 255: exit Module: [MIPI_RX], Build Time[#13 PREEMPT Thu Sep 5 16:28:45 CST 2024] ------------Combo DEV ATTR-------------- Devno WorkMode DataType WDRMode LinkId PN Swap SyncMode DataEndian SyncCodeEndian 0 MIPI RAW10 NONE 2, 0, 1,-1,-1 1, 1, 1, 0, 0 N/A N/A N/A ------------MIPI info------------------- Devno EccErr CrcErr HdrErr WcErr fifofull decode 0 0 0 0 0 0 unknown Physical: D0 D1 D2 D3 D4 D5 0 0 0 0 0 0 Digital: D0 D1 D2 D3 CK_HS CK_ULPS CK_STOP CK_ERR Deskew hs_idle hs_idle hs_idle hs_idle 0 0 1 0 idle [VI BE_Dbg_Info] VIPreBEDoneSts :0x0 VIPreBEDmaIdleStatus :0x0 [VI Post_Dbg_Info] VIIspTopStatus :0x0 [VI DMA_Dbg_Info] VIWdma0ErrStatus :0x0 VIWdma0IdleStatus :0x0 VIWdma1ErrStatus :0x0 VIWdma1IdleStatus :0x0 VIRdmaErrStatus :0x0 VIRdmaIdleStatus :0x0 [VI ISP_PIPE_A FE_Dbg_Info] VIPreFERawDbgSts :0x0 VIPreFEDbgInfo :0x0 [VI ISP_PIPE_A] VIOutImgWidth : 640 VIOutImgHeight : 480 VIInImgWidth : 640 VIInImgHeight : 480 VIDevFPS : 0 VIFPS : 0 VISofCh0Cnt : 0 VIPreFECh0Cnt : 0 VIPreBECh0Cnt : 0 VIPostCnt : 0 VIDropCnt : 0 VIDumpCnt : 0 [VI ISP_PIPE_A Csi_Dbg_Info] VICsiIntStatus0 :0x0 VICsiIntStatus1 :0x0 VICsiCh0Dbg :0x0 VICsiCh1Dbg :0x0 VICsiOverFlowCnt : 0 VICsiCh0WidthGTCnt : 0 VICsiCh0WidthLSCnt : 0 VICsiCh0HeightGTCnt : 0 VICsiCh0HeightLSCnt : 0 Module: [MIPI_RX], Build Time[#13 PREEMPT Thu Sep 5 16:28:45 CST 2024] ------------Combo DEV ATTR-------------- Devno WorkMode DataType WDRMode LinkId PN Swap SyncMode DataEndian SyncCodeEndian 0 MIPI RAW10 NONE 2, 0, 1,-1,-1 1, 1, 1, 0, 0 N/A N/A N/A ------------MIPI info------------------- Devno EccErr CrcErr HdrErr WcErr fifofull decode 0 0 0 0 0 0 unknown Physical: D0 D1 D2 D3 D4 D5 0 0 0 0 0 0 Digital: D0 D1 D2 D3 CK_HS CK_ULPS CK_STOP CK_ERR Deskew hs_idle hs_idle hs_idle hs_idle 0 0 0 0 idle [VI BE_Dbg_Info] VIPreBEDoneSts :0x0 VIPreBEDmaIdleStatus :0x0 [VI Post_Dbg_Info] VIIspTopStatus :0x0 [VI DMA_Dbg_Info] VIWdma0ErrStatus :0x0 VIWdma0IdleStatus :0x0 VIWdma1ErrStatus :0x0 VIWdma1IdleStatus :0x0 VIRdmaErrStatus :0x0 VIRdmaIdleStatus :0x0 [VI ISP_PIPE_A FE_Dbg_Info] VIPreFERawDbgSts :0x0 VIPreFEDbgInfo :0x0 [VI ISP_PIPE_A] VIOutImgWidth : 640 VIOutImgHeight : 480 VIInImgWidth : 640 VIInImgHeight : 480 VIDevFPS : 0 VIFPS : 0 VISofCh0Cnt : 0 VIPreFECh0Cnt : 0 VIPreBECh0Cnt : 0 VIPostCnt : 0 VIDropCnt : 0 VIDumpCnt : 0 [VI ISP_PIPE_A Csi_Dbg_Info] VICsiIntStatus0 :0x0 VICsiIntStatus1 :0x0 VICsiCh0Dbg :0x0 VICsiCh1Dbg :0x0 VICsiOverFlowCnt : 0 VICsiCh0WidthGTCnt : 0 VICsiCh0WidthLSCnt : 0 VICsiCh0HeightGTCnt : 0 VICsiCh0HeightLSCnt : 0 Module: [MIPI_RX], Build Time[#13 PREEMPT Thu Sep 5 16:28:45 CST 2024] ------------Combo DEV ATTR-------------- Devno WorkMode DataType WDRMode LinkId PN Swap SyncMode DataEndian SyncCodeEndian 0 MIPI RAW10 NONE 2, 0, 1,-1,-1 1, 1, 1, 0, 0 N/A N/A N/A ------------MIPI info------------------- Devno EccErr CrcErr HdrErr WcErr fifofull decode 0 0 0 0 0 0 unknown Physical: D0 D1 D2 D3 D4 D5 0 0 0 0 0 0 Digital: D0 D1 D2 D3 CK_HS CK_ULPS CK_STOP CK_ERR Deskew hs_idle hs_idle hs_idle hs_idle 0 0 1 0 idle ....... ``` Why is the mismatch appearing? Do I have to change any other configuration in another place? Any help is appreciated!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
maxpeterkaya/LicheeRV-Nano-Build#122
No description provided.