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.

setting ISS driver sensor registers from A8 - IPNC_RDK 3.8 DM8127

Hello,

There's an ITT_Server that receives messages from the DCC program on the PC. The messages are sent over sockets to the IPNC's IP address. I'd like to bypass this and set ISS registers from an application called from the Linux console. How can I do this?

I found the i2c_rdwr.c module (in ipnc_mcfw/mcfw/src_linux/utils/)that calls OSA_i2cTestMain. It accepts as input register address and value and sets/reads registers. Is there a way of using this function from a console application to set ISS registers?

Thanks,

Mechi

  • I will notify the IPNC RDK team for help.

    BR
    Pavel
  • Hi,

    You can perform i2c communication from the U-boot command line using the following commands on the UART console:

    >i2c dev 2  => to select the i2c bus 2

    >i2c write <slave_addr> <value>

     

    regards,

    Anand

  • Thanks Anand - I hope this works.
    When you write "slave address" and "slave value" are you talking about the actual register addresses that we changed in the issdrv_mt9j003_config.h file?
    Because in the DCC window application, there are also other types of fields called "registers".
    Thanks,
    Mechi
  • And how do I read a register?

    > i2c read <addr> <num_registers> ????

    as in the i2c_rdwr file? Where will the returned value be stored?
  • Anand -
    When you say " from the U-boot command line" - what do you mean?
    The i2c command is not recognized by the shell. Also there's no "i2c" script/program in /opt/ipnc.
    Do you mean before the usecase is active?
    I need to set register values as the usecase is working and the video is streaming.
    Thanks again,
    Mechi
  • Mechi,

    Mechi Fendel said:
    When you say " from the U-boot command line" - what do you mean?
    The i2c command is not recognized by the shell.

    See if the below e2e thread will be in help:

    BR
    Pavel

  • The real answer to all of these questions is the i2c_rdwr utility in /opt/ipnc/bin.

    ./i2c_rdwr.out

    gives:

    I2C Test Utility,
    Usage: ./i2c_rdwr.out -r|-w <devAddrInHex> <regAddrInHex> <regValueInHex or numRegsToReadInDec>
  • This i2c_rdwr utility only accepts register addresses and values of 1 byte in size. The registers of the MT9J003 contain 16-bit data, and the register addresses of registers that can be programmed are greater than 256.
    How can this utility be used for setting/reading the MT9J003 registers?

    I tried to read register address 0 - which should give 0x2C01 - the model ID:

    root@DM8127_IPNC:/opt/ipnc/bin# ./i2c_rdwr.out -r 0x36 0x0 1
    OSA_i2cTestMain: devAddr=54 regAddr=0 numRegs=1 regValue8=0
    ERROR (osa_i2c.c|OSA_i2cTestMain|265): OSA_i2cOpen( instId = 3 )
    root@DM8127_IPNC:/opt/ipnc/bin#

    The device address is from the issdrv_mt9j003_config.h file - 

    #define MT9J_003_ADDR (0x36) // CCI write address

    Since 0x36 is the write address, I tried 0x37 (usually LSB differentiates between i2c read/write instructions) also - but received same error as above.

    The OSA_i2cTestMain printout is from debugging code that i added to the function.

    What did I do wrong?

    How can I access the MT9J003 registers this way?


    Thanks,
    Mechi

  • This is not the way to get to the sensor's registers.
    A message can be sent to the ITT server from an IP address (in the same way that the PC DCC application does).