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.

TDA4VM-Q1: I2C Issues with 100Khz Frequency

Part Number: TDA4VM-Q1
Other Parts Discussed in Thread: TDA4VM, DRA821

Hi TI team,

We are seeing unknown busses( Meaning it through very random busses which are not connected in our design)  in our custom TDA4VM hardware when we are operating I2C bus in 100Khz frequency. Please find the snapshot of I2C busses we found when we perform ‘’ I2Cdetect’’ function in our custom hardware.

 

As per our design on MCU_I2C bus we have total 8 slaves as per below table which are connected in daisy chain fashion in our PCB. When we perform ‘’I2cdetect -y-r-0’’ command we see random I2C slaves are detected which are not presented in our design.

In the same time when we move the I2C speed to 400Khz, we don't see any Unknown devices or ghost devices. it works correctly. would like to understand more or suggestion on the same.

Regards,

Chaitanya

  • Hi Chaitanya,

    Could you please share the exact slave IDs which are expected? Also are you able communicate with the on board slaves at 400k?

    Best Regards,

    Keerthy

  • Hi Keerthy,

    Thanks for your feedback.

    here are slave IDs which we are using MCU_I2C0 bus.

    ''

    0x 40,

    0x 44

    0x 45

    0x 12

    0x 51

    0x 2B

    0x 2A

    0x 48

    All the slave id mentioned above we are able to communicate with 400Khz and 100khz frequency, however in 100Khz we see random ghost address which are not present in the board. in same time we don't see any ghost address in 400Khz frequency.

    Regards,

    chaitanya

  • Hi Keerthy,

    Any update on below.

    Regards,

    Chaitanya

  • Chaitanya,

    I am checking internally on this hence taking time. Another quick try would be to check if you see the same on U-Boot as well.

    Please try the below command from U-Boot prompt:

    i2c bus

    On my DRA821 board I get something like below:

    Bus 1: i2c@40b00000
    Bus 2: i2c@40b10000
    Bus 0: i2c@42120000 (active 0)
    51: generic_51, offset len 2, flags 0
    52: generic_52, offset len 2, flags 0
    54: generic_54, offset len 2, flags 0
    Bus 3: i2c@2000000
    21: gpio@21, offset len 1, flags 0
    20: gpio@20, offset len 1, flags 0
    22: gpio@22, offset len 1, flags 0
    Bus 4: i2c@2010000
    20: gpio@20, offset len 1, flags 0
    Bus 5: i2c@2020000
    Bus 6: i2c@2030000
    Bus 7: i2c@2040000
    Bus 8: i2c@2050000
    Bus 9: i2c@2060000

    Followed by:

    i2c dev 'x'

    replace x with the MCU_I2C instance. For example above Bus 1: i2c@40b00000 Is Bus 1

    So

    i2c dev 1.

    The above should give all the Slave IDs.

    i2c probe
    Valid chip addresses: 12 48 50 51


    Couple of reasons from our I2C expert:

    • Glitch due to interference / Wrong pull up.
    • Slaves that work only at 100K?

    Could you check with your schematics if the expected slave IDs in the above list are the only ones that are connected?

    Best Regards,
    Keerthy

  • Hi keerthy,

    Thanks for the feedback. I will check with my software team check the slave ids as per above instructions. Regarding the other feedback i have other comments.

    Couple of reasons from our I2C expert:

    • Glitch due to interference / Wrong pull up.
    • [Chaitanya]: We are using 2.2K Pullup by default. however we have modified the pullup values from 1K , 1.2K, 1.5K, 1.8K, 2K, 2.5K, 2.7K, 3K, 3.6K and 3.3K, still the behavior is the same. we see ghost address randomly on the board when we are operating I2C in 100Khz frequency. 
    • Note to mention we don't see any ghost address in 400khz frequency. Also in the layout we have taken care in the PCB routed I2C signals in Daisy chain fashion with continuous ground.
    • Slaves that work only at 100K?
    • [Chaitanya]: All the slaves connected on the bus supports from 100Khz to 400Khz frequency.

    I have double checked with my schematics and we don't see any other slave IDs connected other than i have mention in this thread.

    Regards,

    Chaitanya

  • Updating further information, the issue is seen on the EVM.

  • Thanks for the update Karthik.


    Chaitanya,

    I am unable to reproduce the issue on TDA4VM EVM.



    Logs attached:

    U-Boot Logs:
    
    =>
    => i2c dev 1
    Setting bus to 1
    => i2c probe
    Valid chip addresses: 12 48 49 50 51
    => i2c probe
    Valid chip addresses: 12 48 49 50 51
    => i2c probe
    Valid chip addresses: 12 48 49 50 51
    => i2c probe
    Valid chip addresses: 12 48 49 50 51
    
    Kernel logs:
    
    root@j7-evm:~# dmesg | grep i2c
    [    0.708823] i2c /dev entries driver
    [    0.893211] omap_i2c 40b00000.i2c: bus 0 rev0.12 at 100 kHz
    [    0.899322] omap_i2c 40b10000.i2c: bus 1 rev0.12 at 100 kHz
    [    0.905412] omap_i2c 42120000.i2c: bus 2 rev0.12 at 100 kHz
    [    0.974080] omap_i2c 2000000.i2c: bus 3 rev0.12 at 400 kHz
    [    0.980528] omap_i2c 2010000.i2c: bus 4 rev0.12 at 400 kHz
    [    0.990289] omap_i2c 2020000.i2c: bus 5 rev0.12 at 400 kHz
    [    1.028122] omap_i2c 2030000.i2c: bus 6 rev0.12 at 400 kHz
    [    1.034197] omap_i2c 2040000.i2c: bus 7 rev0.12 at 100 kHz
    [    1.040187] omap_i2c 2050000.i2c: bus 8 rev0.12 at 100 kHz
    [    1.079771] omap_i2c 2060000.i2c: bus 9 rev0.12 at 400 kHz
    
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2	  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@j7-evm:~# i2cdetect -y -r 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    root@j7-evm:~# dmesg | grep i2c
    [ 0.708823] i2c /dev entries driver
    [ 0.893211] omap_i2c 40b00000.i2c: bus 0 rev0.12 at 100 kHz

    So MCU_I2C0 is already at 100KHz at boot.

    Consistently shows only the valid Slave IDs.

    root@j7-evm:~# i2cdetect -y -r 0
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    Best Regards,
    Keerthy

  • HI Keerthy,

    Thanks for the feedback. I will check on my side EVM also.

    Regards,

    Chaitanya

  • Hi Keerthy,

    I checked EVM schematics and see on MCU_I2C0 only 4 Nos of slaves connected Like below

    0x12 --- PMICA

    0x48 -----Temperature sensor1

    0x49 ----- Temperature Sensor2

    0x50 ----- Boot EEPROM

    but above your log shows 0x51 also in the device list. could you help which is the one assigned for 0x51?

    Regards,

    Chaitanya

  • Hi keerthy,

    Any update on above issue.

    Regards,

    Chiatanya

  • Chaitanya,

    TDA4VM User guide: https://www.ti.com/lit/ug/spruis4d/spruis4d.pdf?ts=1667233676508&ref_url=https%253A%252F%252Fwww.google.com%252F

    Page 29

    0x50/0x51 - Boot EEPROM Interface

    Best Regards,
    Keerthy

  • Hi, I've been asked to help out, and I've reproduced to problem to trigger within less than a half minute using this script:

    #!/bin/sh
    text="     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- -- 
    20: -- -- -- -- -- -- -- -- -- 29 2a 2b -- -- -- -- 
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    40: 40 -- -- -- 44 45 -- -- -- -- -- -- -- -- -- -- 
    50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    60: -- -- -- -- -- -- -- -- -- -- -- 6b -- -- -- -- 
    70: -- -- -- -- -- -- -- --                         ";
    
    COUNTER=1
    
    while true
    do
            var="$(i2cdetect -yr 0)" &&
            if [ "$var" != "$text" ]; then
                    break
            fi
    #        sleep 1
            let COUNTER=COUNTER+1
    done
    
    echo "$var"
    echo "$text"
    
    if [ "$var" = "$text" ]; then
        echo "Match!"
    else
        echo "### ERROR!!!!"
    fi
    
    echo "After $COUNTER iterations"

    Please adjust the expected output in the "text" variable as needed if running on an EVM.

    I've noted that the error occurs within 43 executions of i2cdetect on average, and the addresses detected are seemingly random.
    Trying to reproduce the error using a smaller address range of 1-3 addresses does not seem to trigger the issue, which may indicate that this is related to bus load.

  • Uncommenting the "sleep 1" allows me to capture the problem on an oscilloscope. I've done several captures, but I will present only one here.

    1. The false address in this capture is read of "0x05", or bus access "0B".

    The analog waveform looks good, no ack present.

    The decode feature confirms this

    The error occurs as the last of a burst of accesses, followed by bus idle of around 8 ms.

    There are also some very long I2C clock streching segments, but since these are present every time I will assume this comes from our peripherals, and is not a bug.

  • 1. Adding the sleep does not seem to strongly affect the number of iterations before an error occurs (1 to ~200 iterations)

    2. Killing the following process seems to have a strong effect on the occurrence of the problem (100 to 1000 iterations).

    PID PPID USER STAT VSZ %VSZ %CPU COMMAND
    645 1 root S 613m 28% 0% /usr/bin/DoIPSrvRunProcess

    3. Starting a background process with heavy CPU usage seems to also to reduce the occurrence of the problem.

    dd if=/dev/random of=/dev/null &

    This also has the effect of evenly spreading out the i2c bus accesses.

    Conclusion/speculation:

    All of these things change the timing and burst sizes over I2C, which makes sense since the MCU is doing other things too.
    But why this should affect the error occurrence is harder to say, perhaps there is a driver issue that only occurs in certain conditions.

    P.s. It seems the clock streching appears after a running the system for a long time. My suspicion is that the i2cdetect read command is incrementing a peripheral's auto-increment address counter to beyond some limit, causing some peripheral-internal timeout or delay its response.
    This should be no reason for concern at the moment.

  • Hi Anders,

    Thanks for the detailed analysis. Really appreciate the feedback.

    Chaitanya,

    Apologies i had misunderstanding on the analysis. I will go through steps to reproduce & try on EVM.

    Best Regards,

    Keerthy

  • I just found that if I run the script with highest real-time priority it goes crazy! I get an error rate of around 25%.

    chrt 99 ./testi2c.sh

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- 08 -- -- 0b -- 0d -- 0f 
    10: -- -- 12 -- 14 -- 16 -- 18 -- 1a -- 1c -- 1e -- 
    20: -- 21 -- 23 -- 25 -- 27 -- 29 2a 2b -- -- -- -- 
    30: 30 -- -- -- 34 -- -- -- 38 -- 3a -- -- 3d -- 3f 
    40: 40 -- 42 -- 44 45 -- -- 48 -- 4a -- 4c -- -- -- 
    50: -- 51 -- -- 54 -- -- 57 -- -- -- -- 5c -- -- 5f 
    60: -- -- 62 -- -- 65 -- -- -- 69 -- 6b -- -- -- 6f 
    70: -- -- 72 -- -- 75 -- --                         
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- -- 
    20: -- -- -- -- -- -- -- -- -- 29 2a 2b -- -- -- -- 
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    40: 40 -- -- -- 44 45 -- -- -- -- -- -- -- -- -- -- 
    50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    60: -- -- -- -- -- -- -- -- -- -- -- 6b -- -- -- -- 
    70: -- -- -- -- -- -- -- --                         
    ### ERROR!!!!
    After 1 iterations

    The same thing does not seem to happen when running chrt with i2cdetect directly. I do not yet know why, but I don't think the script is broken because the text is generated directly from the i2cdetect tool.

  • Hi Anders,

    i2cdetect -yr 0
    Warning: Can't use SMBus Quick Write command, will skip some addresses
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00:
    10:
    20:
    30: -- -- -- -- -- -- -- --
    40:
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60:
    70:

    Sometimes I am seeing missing slave IDs as well.

    i2cdetect -yr 0
    Warning: Can't use SMBus Quick Write command, will skip some addresses
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00:
    10:
    20:
    30: -- -- -- -- -- -- -- --
    40:
    50: 50 51 -- -- -- -- -- -- -- 59 -- -- -- -- -- --

    Also when I split the options:

    i2cdetect -r -y 0
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
    50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    It shows more slaves. 

    Thanks for the script. I will dig more into this & check with folks internally.

    Best Regards,
    Keerthy

  • Strange, the message
    "Warning: Can't use SMBus Quick Write command, will skip some addresses"
    tells me that the "-r" option is not working when written as "-yr". 

    This works for me though, perhaps there is a difference in software versions?
    Regardless, using "-y" "-r" separately should yield the intended results for you.

    Best,
    Anders

  • Hi Anders,

    https://linux.die.net/man/8/i2cdetect

    Can you try without the -r option i2cdetect -y 0 ?

    Regards,
    Keerthy

  • Yes, but it does not scan the whole bus.
    Correct results look like:

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                                                 
    10:                                                 
    20:                                                 
    30: -- -- -- -- -- -- -- --                         
    40:                                                 
    50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    60:                                                 
    70:                                     

    Running "chrt 99 ./testi2c.sh" (with a modified script that does not use "-r") produces the same type of error.

         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                                                 
    10:                                                 
    20:                                                 
    30: -- -- -- 33 -- -- 36 --                         
    40:                                                 
    50: -- 51 -- -- 54 -- 56 -- 58 -- -- -- -- 5d -- 5f 
    60:                                                 
    70:                                      

    /Anders

  • Note that the "chrt 99" part is not needed to reproduce the error, but greatly increases the error frequency.

  • Andres & Chaitanya,

    Thanks a lot for all the details. We have reproduced the issue & the internal software/hardware teams are looking into this.

    100KHz we observe the issue. Since 400KHz is looking fine I am closing this issue as we continue to debug the issue with 100KHz.

    Best Regards,
    Keerthy

  • For TI internal reference, the issue is being tracked by LCPD-29949