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.

DS90UB953-Q1: multi camera module application _ I2C address

Part Number: DS90UB953-Q1
Other Parts Discussed in Thread: DS90UB954-Q1, ALP

Dear team,

May I learn frim you how to read/write multi-camera by host(cpu) if they have same I2C address of 953?

block diagram as below picture showed.

thanks.

Regards,

Ben

  • Hi Ben, 

    Please refer to section 7.5.3 Remote Slave Operation and 7.5.4 Remote Slave Addressing in our DS90UB954-Q1 datasheet. 

    Thanks
    Sally 

  • Hi Sally,

    Thanks for your information.

    Customer would like to ask if we have sample code for SlaveAlias setting or not.

    Could you guide customer how to read/write SlaveAlias when multi-953 user case? 

    Regards,

    Ben

  • Hi Ben, 

    camAlias = 0x?? -> user define

    camAddr = 0x?? -> fcheck camera d/s

    serAlias = 0x?? -> user define

    serAddr = 0x?? -> from IDX strap

    devAddr = 0x?? -> from IDX strap

    board.WriteI2C(devAddr,0x4c,0x01)  #port 0 read/write

    # setup Ser ID and Alias
    board.WriteI2C(devAddr, 0x5B, serAddr)
    board.WriteI2C(devAddr, 0x5C, serAlias)

    # setup Cam ID and Alias
    board.WriteI2C(devAddr,0x5D,camAddr)
    board.WriteI2C(devAddr,0x65,camAlias)

  • Hi Sally,

    Customer cannot read back the right register value, could you help to guide customer how to fix this issue?

    Please refer to customer's setting below.

    Step1: CH1_write:

    #90954 port 0 read/write

    board.WriteI2C(0x60,0x4c,0x01)

    # 90954 setup Ser ID and Alias

    board.WriteI2C(0x60, 0x5b, 0x32)

    board.WriteI2C(0x60, 0x5c, 0x32)

    # 90954 setup Cam ID and Alias

    board.WriteI2C(0x60,0x5d,0x34)

    board.WriteI2C(0x60,0x65,0x34)

    # 90953 write LOCAL_GPIO_DATA

    board.WriteI2C(0x32,0x0d,0x0f)

     

    Step2: CH2_read:

    #90954 port 0 read/write

    board.WriteI2C(0x7a,0x4c,0x01)

    # setup Ser ID and Alias

    board.WriteI2C(0x7a, 0x5b, 0x32)

    board.WriteI2C(0x7a, 0x5c, 0x32)

    # setup Cam ID and Alias

    board.WriteI2C(0x7a,0x5d,0x34)

    board.WriteI2C(0x7a,0x65,0x34)

    # 90953 read LOCAL_GPIO_DATA

    board.ReadI2C(0x32,0x0d,0x33,0x0f) -> I should get 0x07, but got 0x0f.

     

    Note:

    CH1_addresses:

    camAlias = 0x34 -> user define

    camAddr = 0x34 -> fcheck camera d/s

    serAlias = 0x32 -> user define

    serAddr = 0x32 -> from IDX strap

    devAddr = 0x60 -> from IDX strap

     

    CH2_addresses:

    camAlias = 0x34 -> user define

    camAddr = 0x34 -> fcheck camera d/s

    serAlias = 0x32 -> user define

    serAddr = 0x32 -> from IDX strap

    devAddr = 0x7a -> from IDX strap

  • Hi Ben, 

    Are you performing these writes in ALP or by some other method? If you are in ALP, can you read the registers in the register tab? The info tab should have the I2C address, make sure you are writing/reading to that address. 

    Thanks

    Sally 

  • Hi Sally,

    This comments write/read in customer's board. I have attached customer's log. Could you help to check the log?

    Thanks.

    sunnyqc3@sunnyqc3-Linux-PC:~$ adb shell "echo 1 > /sys/devices/soc/soc:ext_cam_ir_ch1_led/ext_cam_ir_ch1"
    sunnyqc3@sunnyqc3-Linux-PC:~$ adb shell cat /sys/devices/soc/soc:ext_cam_ir_ch2_led/ext_cam_ir_ch2
    1
    sunnyqc3@sunnyqc3-Linux-PC:~$ adb shell
    sdm660_64:/ $ su
    sdm660_64:/ # dmesg
    [   37.508797] init: starting service 'console'...
    [   37.511377] init: setpgid failed for console: Operation not permitted
    [   38.398779] init: starting service 'vendor.hbtp'...
    [   38.549735] hbtp_input_ioctl_handler: The input device is already created
    [   38.569623] init: Service 'vendor.hbtp' (pid 3712) exited with status 255
    [   38.569684] init: Sending signal 9 to service 'vendor.hbtp' (pid 3712) process group...
    [   38.569899] libprocessgroup: Successfully killed process cgroup uid 1000 pid 3712 in 0ms
    [   38.573045] init: Service 'console' (pid 3711) exited with status 0
    [   38.573094] init: Sending signal 9 to service 'console' (pid 3711) process group...
    [   38.573278] libprocessgroup: Successfully killed process cgroup uid 2000 pid 3711 in 0ms
    [   38.661191] IRQ5 no longer affine to CPU4
    [   42.515212] init: starting service 'console'...
    [   42.517613] init: setpgid failed for console: Operation not permitted
    [   42.833371] init: Service 'console' (pid 3724) exited with status 0
    [   42.833427] init: Sending signal 9 to service 'console' (pid 3724) process group...
    [   42.833647] libprocessgroup: Successfully killed process cgroup uid 2000 pid 3724 in 0ms
    [   43.402213] init: starting service 'vendor.hbtp'...
    [   43.561010] hbtp_input_ioctl_handler: The input device is already created
    [   43.579651] init: Service 'vendor.hbtp' (pid 3727) exited with status 255
    [   43.579712] init: Sending signal 9 to service 'vendor.hbtp' (pid 3727) process group...
    [   43.579915] libprocessgroup: Successfully killed process cgroup uid 1000 pid 3727 in 0ms
    [   43.661244] IRQ5 no longer affine to CPU7
    [   47.518718] init: starting service 'console'...
    [   47.521185] init: setpgid failed for console: Operation not permitted
    [   48.173529] init: Service 'console' (pid 3738) exited with status 130
    [   48.173587] init: Sending signal 9 to service 'console' (pid 3738) process group...
    [   48.173805] libprocessgroup: Successfully killed process cgroup uid 2000 pid 3738 in 0ms
    [   48.405998] init: starting service 'vendor.hbtp'...
    [   48.563347] hbtp_input_ioctl_handler: The input device is already created
    [   48.582733] init: Service 'vendor.hbtp' (pid 3741) exited with status 255
    [   48.582793] init: Sending signal 9 to service 'vendor.hbtp' (pid 3741) process group...
    [   48.583012] libprocessgroup: Successfully killed process cgroup uid 1000 pid 3741 in 0ms
    [   48.661231] IRQ5 no longer affine to CPU4
    [   49.544320] type=1400 audit(1607410368.359:56): avc: denied { getattr } for pid=3039 comm=".asus.aics.trvd" path="/sys/devices/soc/5000000.qcom,kgsl-3d0/kgsl/kgsl-3d0/gpu_available_frequencies" dev="sysfs" ino=31561 scontext=u:r:system_app:s0 tcontext=u:object_r:sysfs_kgsl:s0 tclass=file permissive=1
    [   49.544378] type=1400 audit(1607410391.859:57): avc: denied { write } for pid=3746 comm="sh" name="ext_cam_ir_ch1" dev="sysfs" ino=46347 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
    [   49.544469] __set_ch1: write 0x4C = 0x01
    [   49.544743] __set_ch1: write 0x5B = 0x32
    [   49.545218] __set_ch1: write 0x5C = 0x32
    [   49.545326] type=1400 audit(1607410391.859:57): avc: denied { write } for pid=3746 comm="sh" name="ext_cam_ir_ch1" dev="sysfs" ino=46347 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
    [   49.545370] type=1400 audit(1607410391.859:58): avc: denied { open } for pid=3746 comm="sh" path="/sys/devices/soc/soc:ext_cam_ir_ch1_led/ext_cam_ir_ch1" dev="sysfs" ino=46347 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
    [   49.546025] __set_ch1: write 0x5D = 0x34
    [   49.546781] __set_ch1: write 0x65 = 0x34
    [   49.546991] __set_ch1:216 Read PASS:value=0x7
    [   49.547170] __set_ch1:236 Set PASS:value=0xf,result=0
    [   51.321922] IRQ5 no longer affine to CPU7
    [   52.525814] init: starting service 'console'...
    [   52.528144] init: setpgid failed for console: Operation not permitted
    [   53.073652] init: Service 'console' (pid 3756) exited with status 0
    [   53.073711] init: Sending signal 9 to service 'console' (pid 3756) process group...
    [   53.073937] libprocessgroup: Successfully killed process cgroup uid 2000 pid 3756 in 0ms
    [   53.410049] init: starting service 'vendor.hbtp'...
    [   53.550026] hbtp_input_ioctl_handler: The input device is already created
    [   53.569359] init: Service 'vendor.hbtp' (pid 3759) exited with status 255
    [   53.569418] init: Sending signal 9 to service 'vendor.hbtp' (pid 3759) process group...
    [   53.569621] libprocessgroup: Successfully killed process cgroup uid 1000 pid 3759 in 0ms
    [   53.662096] IRQ5 no longer affine to CPU4
    [   55.505232] type=1400 audit(1607410391.859:58): avc: denied { open } for pid=3746 comm="sh" path="/sys/devices/soc/soc:ext_cam_ir_ch1_led/ext_cam_ir_ch1" dev="sysfs" ino=46347 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
    [   55.505290] type=1400 audit(1607410397.819:59): avc: denied { read } for pid=3766 comm="cat" name="ext_cam_ir_ch2" dev="sysfs" ino=46340 scontext=u:r:shell:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
    [   55.505381] __show_ch2: write 0x4C = 0x01
    [   55.505730] __show_ch2: write 0x5B = 0x32
    [   55.505981] __show_ch2: write 0x5C = 0x32
    [   55.506518] __show_ch2: write 0x5D = 0x34
    [   55.506873] __show_ch2: write 0x65 = 0x34
    [   55.507165] __show_ch2:148 PASS ret = 0xf 
    [   57.529296] init: starting service 'console'...
    [   57.531688] init: setpgid failed for console: Operation not permitted
    [   58.183396] init: Service 'console' (pid 3772) exited with status 0
    [   58.183455] init: Sending signal 9 to service 'console' (pid 3772) process group...
    [   58.183682] libprocessgroup: Successfully killed process cgroup uid 2000 pid 3772 in 0ms
    [   58.413650] init: starting service 'vendor.hbtp'...
    [   58.567607] hbtp_input_ioctl_handler: The input device is already created
    [   58.588773] init: Service 'vendor.hbtp' (pid 3775) exited with status 255
    [   58.588832] init: Sending signal 9 to service 'vendor.hbtp' (pid 3775) process group...
    [   58.589072] libprocessgroup: Successfully killed process cgroup uid 1000 pid 3775 in 0ms
    [   58.662098] IRQ5 no longer affine to CPU5
    [   62.536234] init: starting service 'console'...
    [   62.538655] init: setpgid failed for console: Operation not permitted
    [   62.893135] init: Service 'console' (pid 3790) exited with status 0
    [   62.893193] init: Sending signal 9 to service 'console' (pid 3790) process group...
    [   62.893416] libprocessgroup: Successfully killed process cgroup uid 2000 pid 3790 in 0ms
    [   63.416813] init: starting service 'vendor.hbtp'...
    [   63.579344] hbtp_input_ioctl_handler: The input device is already created
    [   63.599060] init: Service 'vendor.hbtp' (pid 3793) exited with status 255
    [   63.599120] init: Sending signal 9 to service 'vendor.hbtp' (pid 3793) process group...
    [   63.599329] libprocessgroup: Successfully killed process cgroup uid 1000 pid 3793 in 0ms
    [   63.682192] IRQ5 no longer affine to CPU4
    sdm660_64:/ # 
    
    

    Ben

  • Ben,

    can you decode this test.log clarify "Customer cannot read back the right register value"? for example, which slave ID and which reg. can't be read?

    the log mixed many other messages, we can't understand it clearly.

    regards,

    Steven

  • Hi Steven,

    Please refer customer's code in 2020/12/20 of this post.

    There are two 954 and each of deseri connect to one 953 chip.

    According to the reference code in this post, customer have wrote the test commend.

    They write CH1 comment as 0x0f in below.

    ---------------------------

    # 90953 write LOCAL_GPIO_DATA

    board.WriteI2C(0x32,0x0d,0x0f)

    ---------------------------

    Then read CH2 as below. They expect the value read back should be 0x07, but it's 0x0f which means both 953 have been write to 0x0f.

    ------------------------------

    # 90953 read LOCAL_GPIO_DATA

    board.ReadI2C(0x32,0x0d,0x33,0x0f)

    ---------------------------

    Could you help to solve this issue?

    Regards,

  • what is the command  "board.ReadI2C(0x32,0x0d,0x33,0x0f)"?

    and what is the  "0x32" in you case, is it your 953 IDX? if yes, it is correct as you had write reg. 0x0D with 0x0F, so you can read reg. 0x0D as 0x0F returned value.

    rgds,

    Steven

  • Hi Steven,

    May I learn from you how to fix below code to implement customer's application. ( please refer to functional block diagram on the top of this post)

    ---------------

    Step1: CH1_write:

    #90954 port 0 read/write

    board.WriteI2C(0x60,0x4c,0x01)

    # 90954 setup Ser ID and Alias

    board.WriteI2C(0x60, 0x5b, 0x32)

    board.WriteI2C(0x60, 0x5c, 0x32)

    # 90954 setup Cam ID and Alias

    board.WriteI2C(0x60,0x5d,0x34)

    board.WriteI2C(0x60,0x65,0x34)

    # 90953 write LOCAL_GPIO_DATA

    board.WriteI2C(0x32,0x0d,0x0f)

     

    Step2: CH2_read:

    #90954 port 0 read/write

    board.WriteI2C(0x7a,0x4c,0x01)

    # setup Ser ID and Alias

    board.WriteI2C(0x7a, 0x5b, 0x32)

    board.WriteI2C(0x7a, 0x5c, 0x32)

    # setup Cam ID and Alias

    board.WriteI2C(0x7a,0x5d,0x34)

    board.WriteI2C(0x7a,0x65,0x34)

    # 90953 read LOCAL_GPIO_DATA

    board.ReadI2C(0x32,0x0d,0x33,0x0f) -> I should get 0x07, but got 0x0f.

     

    Note:

    CH1_addresses:

    camAlias = 0x34 -> user define

    camAddr = 0x34 -> fcheck camera d/s

    serAlias = 0x32 -> user define

    serAddr = 0x32 -> from IDX strap

    devAddr = 0x60 -> from IDX strap

     

    CH2_addresses:

    camAlias = 0x34 -> user define

    camAddr = 0x34 -> fcheck camera d/s

    serAlias = 0x32 -> user define

    serAddr = 0x32 -> from IDX strap

    devAddr = 0x7a -> from IDX strap

    ------------------------

    Regards,

  • This is one basic function on I2C operation and can get this answer from d/s example or EVM user guide. btw, some IDX assigned is based on your system definition, so it is required that the board designer or system designer should know it well!

    1. checking if local I2C can work or not? //if not, you can follow up the d/s request on idx setting request

    2. check remote I2C accessment with below// sally had replied your message.

    3. in your block pls use the 8bits IDX, you can refer to 953/954 on the IDX setting. in below example, Pls input your upper 954 idx 954_1 and bottom idx 954_2 based on your 954 IDX setting in your case.

    Upper 954 I2C addr. setting:

    board.WriteI2C(954_1,0x4c,0x01) //supposing camera is linked to port0 & 954_1 = IDX design in your case, referring to 954 d/s on the IDX setting to get the final value

    # I2C passthrough and IDx setting

    enable pass-through in  954's reg. 0x58[6], other bits are dependent on your system design // enable passthrough remote I2C 

    board.WriteI2C(0954_1, 0x5c, 0x34) // 953 camera which is linked to port0, its alias IDX is assigned as 0x34

    bottom 954 I2C addr. setting

    board.WriteI2C(954_2,0x4c,0x01) //supposing camera is linked to port0 & 954_2 = IDX design in your case, referring to 954 d/s on the IDX setting to get the final value

    # I2C passthrough and IDx setting

    enable pass-through in  954's reg. 0x58[6], other bits are dependent on your system design // enable passthrough remote I2C 

    board.WriteI2C(0954_2, 0x5c, 0x36) // 953 camera which is linked to port0, its alias IDX is assigned as 0x36

     upper 953 reading:

    #  read reg. 0x0D

    board.ReadI2C(0x34,0x0D).

     Bottome 953 reading:

    #  read reg. 0x0D

    board.ReadI2C(0x36,0x0D).