-1

[15995.562117] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121

What could cause this?

  • bbb img is : bone-debian-9.4-lxqt-armhf-2018-06-17-4gb.img
  • slave address is : 0x48 in i2c-1

__

debian@beaglebone:/sys/bus/i2c/devices$ ls -l
total 0
lrwxrwxrwx 1 root root 0 Aug  2 05:51 0-0024 -> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024
lrwxrwxrwx 1 root root 0 Aug  2 05:51 0-0050 -> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0050
lrwxrwxrwx 1 root root 0 Aug  2 05:51 1-0048 -> ../../../devices/platform/ocp/4802a000.i2c/i2c-1/1-0048
lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0054 -> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0054
lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0055 -> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0055
lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0056 -> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0056
lrwxrwxrwx 1 root root 0 Aug  2 05:51 2-0057 -> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0057
lrwxrwxrwx 1 root root 0 Aug  2 05:51 i2c-0 -> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0
lrwxrwxrwx 1 root root 0 Aug  2 05:51 i2c-1 -> ../../../devices/platform/ocp/4802a000.i2c/i2c-1
lrwxrwxrwx 1 root root 0 Aug  2 05:51 i2c-2 -> ../../../devices/platform/ocp/4819c000.i2c/i2c-2

debian@beaglebone:~$ uname -r
4.14.49-ti-r54

debian@beaglebone:~$ sudo insmod tsc2013.ko
[15995.562117] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
[15995.586612] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
[15995.604143] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
[15995.617237] tsc2013 1-0048: tsc2013_i2c_write_byte : I2C write error, i2c_master_send returned -121


debian@beaglebone:~$ dmesg
[ 5071.263231] -->tsc2013_init
[ 5071.263247] tsc2013_init-->i2c_add_driver
[ 5071.263525] -->tsc2013_probe
[ 5071.263559] tsc2013_probe-->tsc2013_hw_init
[ 5071.263565] -->tsc2013_hw_init
[ 5071.263583] after gpio_request
[ 5071.263589] after gpio_direction_input
[ 5071.263687] after gpio_to_irq
[ 5071.263786] tsc2013_probe-->tsc2013_sw_init
[ 5071.263791] -->tsc2013_reset
[ 5071.287503] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
[ 5071.300364] tsc2013_i2c_write_register : CFG[62] = 0xa38c
[ 5071.300577] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
[ 5071.314459] tsc2013_i2c_write_register : CFG[6a] = 0x0
[ 5071.314701] tsc2013 1-0048: tsc2013_i2c_write_register : I2C write error, i2c_master_send returned -121
[ 5071.328085] tsc2013_i2c_write_register : CFG[72] = 0x381c
[ 5071.328311] tsc2013 1-0048: tsc2013_i2c_write_byte : I2C write error, i2c_master_send returned -121
[ 5071.347228] input: tsc2013 as /devices/virtual/input/input3

debian@beaglebone:~$ ls /dev/input/
by-path  event0  event1  event2  event3

debian@beaglebone:~$ ls /dev/input/by-path/ -l
total 0
lrwxrwxrwx 1 root root 9 Aug  1 09:10 platform-44e0b000.i2c-platform-tps65217-pwrbutton-event -> ../event1
lrwxrwxrwx 1 root root 9 Aug  1 09:10 platform-gpio_keys-event -> ../event2
lrwxrwxrwx 1 root root 9 Aug  1 09:10 platform-TI-am335x-tsc-event -> ../event0

debian@beaglebone:~$ i2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

i2c@4802a000 {
            compatible = "ti,omap4-i2c";
            #address-cells = <0x1>;
            #size-cells = <0x0>;
            ti,hwmods = "i2c2";
            reg = <0x4802a000 0x1000>;
            interrupts = <0x47>;
            //status = "disabled";
            status = "okay";
            phandle = <0xa9>;


            tsc2013@48 {
                compatible = "tsc2013";
                reg = <0x48>;
                //#address-cells = <0x1>;
                //#size-cells = <0x1>;
                //phandle = <0xab>;
            };
        };

debian@beaglebone:/sys/bus/i2c/drivers/tsc2013$ ls -l
total 0
lrwxrwxrwx 1 root root    0 Aug  2 05:22 1-0048 -> ../../../../devices/platform/ocp/4802a000.i2c/i2c-1/1-0048
--w------- 1 root root 4096 Aug  2 05:22 bind
lrwxrwxrwx 1 root root    0 Aug  2 05:22 module -> ../../../../module/tsc2013
--w------- 1 root root 4096 Aug  2 02:51 uevent
--w------- 1 root root 4096 Aug  2 05:22 unbind


debian@beaglebone:/sys/bus/i2c/devices/1-0048$ ls -l
total 0
lrwxrwxrwx 1 root root    0 Aug  2 05:23 driver -> ../../../../../../bus/i2c/drivers/tsc2013
-r--r--r-- 1 root root 4096 Aug  2 05:23 modalias
-r--r--r-- 1 root root 4096 Aug  2 05:23 name
lrwxrwxrwx 1 root root    0 Aug  2 05:23 of_node -> ../../../../../../firmware/devicetree/base/ocp/i2c@4802a000/tsc2013@48
drwxr-xr-x 2 root root    0 Aug  2 05:23 power
lrwxrwxrwx 1 root root    0 Jan  1  2000 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Jan  1  2000 uevent
Philipp Maurer
  • 2,428
  • 6
  • 16
  • 25
包伟岸
  • 1
  • 1

1 Answers1

0

UU is not the address of the slave. UU means that space in memory is reserved and you can't access it. In this example of I2C detect, the i2c device's address is 1d

enter image description here

To make a device detectable, SDA and SCL have to be wired correctly and the i2c port has to be enabled. Use sudo i2cdetect -l to see which i2c ports are active. You should also use sudo before the i2cdetect command

Please format all your code/terminal output to look like this in the future

Hope it helps

gabson
  • 66
  • 7