This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

J721EXSOMXEVM: IMX390 not working in Vision Apps

Part Number: J721EXSOMXEVM
Other Parts Discussed in Thread: J721EXCPXEVM

Hi,

we use the J721EXSOMXEVM together with the J721EXCPXEVM and the Fusion Board.

Unfortunately our camera does not work although it uses the IMX390 sensor and the UB953 serializer. (https://www.leopardimaging.com/product/autonomous-camera/ti-fpdlinkiii-cameras/li-imx390-fpdlinkiii/li-imx390-fpdlinkiii-200h/)

I did some tests with the "Camera based Image Classification Application" contained in the Vision Apps. (https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/vision_apps/docs/user_guide/group_apps_dl_demos_app_tidl_cam.html)

The logs when I run $ ./run_app_tidl_cam.sh:

  • Log when Fusion Board is not powered:
    [MCU2_0] 56.582427 s: rawtestpat_PowerOn Error : initFusion2_UB97x returned 0xffffffff
    [MCU2_0] 56.582427 s: rawtestpat_PowerOn Error : initFusion2_UB97x returned 0xffffffff
    [MCU2_0] 56.582565 s: Error writing 0x2 to UB960 register 0x1
    [MCU2_0] 56.582565 s: Error writing 0x2 to UB960 register 0x1
    [MCU2_0] 56.582614 s: UB960 Error: Reg Write Failed for regAddr 1
    [MCU2_0] 56.582614 s: UB960 Error: Reg Write Failed for regAddr 1
    [MCU2_0] 56.582664 s: Error : ub960_cfgScript returned -1 while configuring DES 0
    [MCU2_0] 56.582664 s: Error : ub960_cfgScript returned -1 while configuring DES 0
    [MCU2_0] 56.582761 s: Error writing 0x2 to UB960 register 0x1
    [MCU2_0] 56.582761 s: Error writing 0x2 to UB960 register 0x1
    [MCU2_0] 56.582807 s: UB960 Error: Reg Write Failed for regAddr 1
    [MCU2_0] 56.582807 s: UB960 Error: Reg Write Failed for regAddr 1
    [MCU2_0] 56.582852 s: Error : returned -1 while configuring DES 1
    [MCU2_0] 56.582852 s: Error : returned -1 while configuring DES 1
  • Log when Fusion Board is powered and Camera is not connected:
    Sensor width = 1936
    Sensor height = 1096
    54.042097 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_PWRON ... !!!
    54.042573 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_CONFIG ... !!!
    [MCU2_0] 54.042376 s: IMX390_PowerOn : chId = 0x0
    54.559430 s: ISS: ERROR: Initializing sensor [IMX390-UB953_D3] failed !!!
    54.559459 s: ISS: Initializing sensor [IMX390-UB953_D3] ... Done !!!
    Error initializing sensor IMX390-UB953_D3
    read_test_image_raw : Unable to open file /opt/vision_apps/test_data//img_test.raw, setting error message as all 0s
    [MCU2_0] 54.559071 s: Error writing 0x1 to UB953 register 0x1
    [MCU2_0] 54.559138 s: UB953 Error: Reg Write Failed for regAddr 1
    [MCU2_0] 54.559235 s: Error : sensor probe failed for channel 0
    Scaler output1 width = 960
    Scaler output1 height = 540
    Scaler output2 width = 480
    Scaler output2 height = 270
    Computing checksum at 0x0000FFFFABDF9800, size = 689552
    54.943679 s: ISS: Starting sensor [IMX390-UB953_D3] ... !!!
    [MCU2_0] 55.456079 s: Error : I2C Timeout while writing 0x0 to IMX390 register 0x0
    55.498251 s: ISS: Starting sensor [IMX390-UB953_D3] failed !!!
  • Log when Fusion Board is powered and Camera is connected:
    Sensor width = 1936
    Sensor height = 1096
    73.600024 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_PWRON ... !!!
    73.600550 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_CONFIG ... !!!
    [MCU2_0] 73.600303 s: IMX390_PowerOn : chId = 0x0
    74.306879 s: ISS: ERROR: Initializing sensor [IMX390-UB953_D3] failed !!!
    74.306911 s: ISS: Initializing sensor [IMX390-UB953_D3] ... Done !!!
    Error initializing sensor IMX390-UB953_D3
    read_test_image_raw : Unable to open file /opt/vision_apps/test_data//img_test.raw, setting error message as all 0s
    [MCU2_0] 74.306654 s: Error : sensor probe failed for channel 0
    Scaler output1 width = 960
    Scaler output1 height = 540
    Scaler output2 width = 480
    Scaler output2 height = 270
    Computing checksum at 0x0000FFFF79802800, size = 689552
    74.682044 s: ISS: Starting sensor [IMX390-UB953_D3] ... !!!
    [MCU2_0] 75.194686 s: Error : I2C Timeout while writing 0x0 to IMX390 register 0x0
    75.236726 s: ISS: Starting sensor [IMX390-UB953_D3] failed !!!

I suggest that the problem is the IMX390 sensor as there are no errors regarding UB960 and UB953 in the last test case.

What would we have to do to get our camera running?

Is really only the camera from D3 Engineering supported (https://www.d3engineering.com/product/designcore-d3rcm-imx390-953-rugged-camera-module/) although our camera also uses IMX390 and UB953?

Thank you in advance!

Best regards,

Philipp

  • Hi Philipp,

    May I know if you are using IMX390 RCM or CM module?

    As in the file ${PSDKRA}/imaging/sensor_drv/src/imx390/imx390_serdes_config.h there is a MACRO CAM_MODULE_VER that is 0 for CM camera and 1 for RCM camera based on which the i2c address are different.

    In default SDK, the RCM cameras are enabled.

    Hence, could you please confirm what is the module present at your end?

    Regards,
    Nikhil

  • Hi Nikhil,

    I do not use the RCM or CM module from D3 Engineering. What i use is this: https://www.leopardimaging.com/wp-content/uploads/LI-IMX390-FPDLINKIIII-xxxH_Datasheet.pdf

    I changed the I2C address in the imx390_serdes_config.h to 0x84 in order to match the address of our IMX390 sensor.

    However nothing changed. There is still the I2C timeout happening.

    Log:

    Sensor width = 1936
    Sensor height = 1096
    73.382432 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_PWRON ... !!!
    73.382955 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_CONFIG ... !!!
    [MCU2_0] 73.382708 s: IMX390_PowerOn : chId = 0x0
    74.089330 s: ISS: ERROR: Initializing sensor [IMX390-UB953_D3] failed !!!
    74.089360 s: ISS: Initializing sensor [IMX390-UB953_D3] ... Done !!!
    Error initializing sensor IMX390-UB953_D3
    read_test_image_raw : Unable to open file /opt/vision_apps/test_data//img_test.raw, setting error message as all 0s
    [MCU2_0] 74.089109 s: Error : sensor probe failed for channel 0
    Scaler output1 width = 960
    Scaler output1 height = 540
    Scaler output2 width = 480
    Scaler output2 height = 270
    Computing checksum at 0x0000FFFF8FDE9800, size = 689552
    74.473276 s: ISS: Starting sensor [IMX390-UB953_D3] ... !!!
    [MCU2_0] 74.986128 s: Error : I2C Timeout while writing 0x0 to register 0x0
    75.028191 s: ISS: Starting sensor [IMX390-UB953_D3] failed !!!

    Regards,

    Philipp

  • Hi Philipp,

    Could you enable the debug logs in the imaging and please share the same with us?
    You could enable the debug logs by #define ENABLE_DEBUG_IMAGING present at ${PSDKRA}/imaging/sensor_drv/src/iss_sensor_priv.h

    This would get all the logs present in issLogPrintf() and could give more clarity on the issue.

    Regards,
    Nikhil

  • Hi Nikhil,

    Sure, this is the output:

    Sensor width = 1936
    Sensor height = 1096
    96.067100 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_PWRON ... !!!
    96.067688 s: ISS: Initializing sensor [IMX390-UB953_D3], doing IM_SENSOR_CMD_CONFIG ... !!!
    [MCU2_0] 96.067315 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_PWRON
    [MCU2_0] 96.067391 s: IM_SENSOR_CMD_PWRON : channel_mask = 0x1
    [MCU2_0] 96.067462 s: IMX390_PowerOn : chId = 0x0
    [MCU2_0] 96.067868 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_CONFIG
    [MCU2_0] 96.067924 s: Application requested features = 0x158
    [MCU2_0]
    [MCU2_0] 96.067970 s: UB960 config start
    [MCU2_0] 96.323696 s: End of UB960 config
    [MCU2_0] 96.323763 s: UB960 config start
    [MCU2_0] 96.579693 s: End of UB960 config
    [MCU2_0] 96.579899 s: UB960 config start
    [MCU2_0] 96.583690 s: End of UB960 config
    [MCU2_0] 96.583750 s: ub953 config start : slaveAddr = 0x74
    96.774263 s: ISS: ERROR: Initializing sensor [IMX390-UB953_D3] failed !!!
    96.774299 s: ISS: Initializing sensor [IMX390-UB953_D3] ... Done !!!
    Error initializing sensor IMX390-UB953_D3
    read_test_image_raw : Unable to open file /opt/vision_apps/test_data//img_test.raw, setting error message as all 0s
    [MCU2_0] 96.773699 s: End of UB953 config
    [MCU2_0] 96.773909 s: Error : I2C Timeout while reading from register 0x330
    [MCU2_0] 96.773959 s: IMX390 Probe : Failed to read CHIP_ID register 0x330
    [MCU2_0] 96.774024 s: Error : sensor probe failed for channel 0
    [MCU2_0] 96.774061 s: IM_SENSOR_CMD_CONFIG returning status = -1
    Scaler output1 width = 960
    Scaler output1 height = 540
    Scaler output2 width = 480
    Scaler output2 height = 270
    Computing checksum at 0x0000FFFF75D17800, size = 689552
    97.034731 s: ISS: Starting sensor [IMX390-UB953_D3] ... !!!
    [MCU2_0] 97.035240 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_STREAM_ON
    [MCU2_0] 97.035317 s: IM_SENSOR_CMD_STREAM_ON: channel_mask = 0x1
    [MCU2_0] 97.035365 s: UB960 config start
    [MCU2_0] 97.290708 s: End of UB960 config
    [MCU2_0] 97.290776 s: UB960 config start
    [MCU2_0] 97.546692 s: End of UB960 config
    [MCU2_0] 97.546948 s: Error : I2C Timeout while writing 0x0 to register 0x0
    [MCU2_0] 97.556750 s: UB960 config start
    97.588997 s: ISS: Starting sensor [IMX390-UB953_D3] failed !!!

    The UB953 initialization seems to fail too. Where can I set the I2C address of the UB953?
    According to the datasheet the UB953 address should be 0x30.

    Regards,
    Philipp

  • Hi Philipp,

    PSDK only supports D3CM and D3RCM cameras for IMX390.

    I am not an expert on serdes and imx390, but there seems no error message about writing to UB953 registers.
    I find that "CAM_MODULE_VER" appears multiple times in "imx390_serdes_config.h" and "imx390_cfg.h", e.g.,

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    I2cParams ub953SerCfg_D3IMX390[IMX390_D3_SER_CFG_SIZE] = {
    {0x01, 0x01, 0x20},
    {0x02, 0x72, 0x10},
    #if (FUSION_BOARD_VER == 0)
    {0x06, 0x21, 0x1F},
    #elif (FUSION_BOARD_VER == 1)
    {0x06, 0x41, 0x1F},
    #else
    Unsuppprted version
    #endif
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    It looks like ub953 register 0x07 (clock) and 0x0D (GPIO) must be programmed differently for D3CM and D3RCM.
    I suppose you might need to make some similar changes for your Leopard Imaging camera.

  • Hi Gang,

    we got the information from Leopard Imaging that the sensors I2C address in their datasheet is wrong. However the new one did not work too. I adapted the source code so it tries the whole I2C address range. I get responses from four addresses when reading the chip ID register (0x330) but none of them contains the right value (0x15). Therefore I think our problem is related to this question in the forum: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1049536/tda4vm-single-camera-demo-for-imx390-ub953-question

    It seems like the sensor is not powered on and we have to update the serializer settings. 

  • Thanks for the update!

    BTW, do you correct the GPIO value to match the LI camera design?