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.

how to use the TI driver in Linux

Other Parts Discussed in Thread: TLV320ADC3140

I compiled the TI driver (tlv320adcx140.c and tlv320adcx140.h) with corresponding linux kernel of Pi. I installed it with insmod. There is no error. When I lsmod, I can see some related tlv320adcx140 modules inserted. But when I used Arecord -l or Aplay -l, I can’t see the Ti deivces. But through i2c-detect, I can see probably the TI device with 4C address. Do you know why? Thanks

 

 

$ lsmod

Module                  Size  Used by

tlv320adcx140          57344  0

regmap_i2c             16384  1 tlv320adcx140

 

 

$ aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]

  Subdevices: 8/8

  Subdevice #0: subdevice #0

  Subdevice #1: subdevice #1

  Subdevice #2: subdevice #2

  Subdevice #3: subdevice #3

  Subdevice #4: subdevice #4

  Subdevice #5: subdevice #5

  Subdevice #6: subdevice #6

  Subdevice #7: subdevice #7

card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

 

 

$ arecord -l

**** List of CAPTURE Hardware Devices ****

 

 

$ sudo i2cdetect -y 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:                         -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: 40 -- -- -- -- -- -- -- -- -- -- -- 4c -- -- --

50: -- -- -- -- 54 -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- 65 -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

 

 

For your information, we can record sound from the on board mic through Windows voice recorder after setup by PurePath. Now we are trying to record sound from Linux.

  • Would you be so kind and share the dts file to config sound card?

  • Hi 

    I don't know how to attach the dts file here. I can share with you by pasting it below.  I didn't create sound card for tlv320adc3140 device because I think this would be provided as an overlay dts file by TI. In my current dts file, you can see there is only one related snd device which is from the Pi CPU(snd_bcm2835).   

    I paste you the main dts file bcm2711-rpi-400.dts as below

    // SPDX-License-Identifier: GPL-2.0
    /dts-v1/;
    #define BCM2711
    #define i2c0 i2c0if
    #include "bcm2711.dtsi"
    #include "bcm283x-rpi-wifi-bt.dtsi"
    #undef i2c0
    #include "bcm270x.dtsi"
    #define i2c0 i2c0mux
    #include "bcm2711-rpi.dtsi"
    #undef i2c0
    //#include "bcm283x-rpi-usb-peripheral.dtsi"

    / {
    compatible = "raspberrypi,400", "brcm,bcm2711";
    model = "Raspberry Pi 400";

    chosen {
    /* 8250 auxiliary UART instead of pl011 */
    stdout-path = "serial1:115200n8";
    };

    leds {
    led-act {
    gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
    };

    led-pwr {
    label = "PWR";
    gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
    default-state = "keep";
    linux,default-trigger = "default-on";
    };
    };

    sd_io_1v8_reg: sd_io_1v8_reg {
    compatible = "regulator-gpio";
    regulator-name = "vdd-sd-io";
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <3300000>;
    regulator-boot-on;
    regulator-always-on;
    regulator-settling-time-us = <5000>;
    gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
    states = <1800000 0x1>,
    <3300000 0x0>;
    status = "okay";
    };

    sd_vcc_reg: sd_vcc_reg {
    compatible = "regulator-fixed";
    regulator-name = "vcc-sd";
    regulator-min-microvolt = <3300000>;
    regulator-max-microvolt = <3300000>;
    regulator-boot-on;
    enable-active-high;
    gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>;
    };
    };

    &bt {
    shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
    };

    &ddc0 {
    status = "okay";
    };

    &ddc1 {
    status = "okay";
    };

    &expgpio {
    gpio-line-names = "BT_ON",
    "WL_ON",
    "PWR_LED_OFF",
    "GLOBAL_RESET",
    "VDD_SD_IO_SEL",
    "GLOBAL_SHUTDOWN",
    "SD_PWR_ON",
    "SHUTDOWN_REQUEST";
    };

    &gpio {
    /*
    * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and
    * the official GPU firmware DT blob.
    *
    * Legend:
    * "FOO" = GPIO line named "FOO" on the schematic
    * "FOO_N" = GPIO line named "FOO" on schematic, active low
    */
    gpio-line-names = "ID_SDA",
    "ID_SCL",
    "SDA1",
    "SCL1",
    "GPIO_GCLK",
    "GPIO5",
    "GPIO6",
    "SPI_CE1_N",
    "SPI_CE0_N",
    "SPI_MISO",
    "SPI_MOSI",
    "SPI_SCLK",
    "GPIO12",
    "GPIO13",
    /* Serial port */
    "TXD1",
    "RXD1",
    "GPIO16",
    "GPIO17",
    "GPIO18",
    "GPIO19",
    "GPIO20",
    "GPIO21",
    "GPIO22",
    "GPIO23",
    "GPIO24",
    "GPIO25",
    "GPIO26",
    "GPIO27",
    "RGMII_MDIO",
    "RGMIO_MDC",
    /* Used by BT module */
    "CTS0",
    "RTS0",
    "TXD0",
    "RXD0",
    /* Used by Wifi */
    "SD1_CLK",
    "SD1_CMD",
    "SD1_DATA0",
    "SD1_DATA1",
    "SD1_DATA2",
    "SD1_DATA3",
    /* Shared with SPI flash */
    "PWM0_MISO",
    "PWM1_MOSI",
    "STATUS_LED_G_CLK",
    "SPIFLASH_CE_N",
    "SDA0",
    "SCL0",
    "RGMII_RXCLK",
    "RGMII_RXCTL",
    "RGMII_RXD0",
    "RGMII_RXD1",
    "RGMII_RXD2",
    "RGMII_RXD3",
    "RGMII_TXCLK",
    "RGMII_TXCTL",
    "RGMII_TXD0",
    "RGMII_TXD1",
    "RGMII_TXD2",
    "RGMII_TXD3";
    };

    &hdmi0 {
    status = "okay";
    };

    &hdmi1 {
    status = "okay";
    };

    &pixelvalve0 {
    status = "okay";
    };

    &pixelvalve1 {
    status = "okay";
    };

    &pixelvalve2 {
    status = "okay";
    };

    &pixelvalve4 {
    status = "okay";
    };

    &pwm1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>;
    status = "okay";
    };

    /* EMMC2 is used to drive the SD card */
    &emmc2 {
    vqmmc-supply = <&sd_io_1v8_reg>;
    vmmc-supply = <&sd_vcc_reg>;
    broken-cd;
    status = "okay";
    };

    &genet {
    phy-handle = <&phy1>;
    phy-mode = "rgmii-rxid";
    status = "okay";
    };

    &genet_mdio {
    phy1: ethernet-phy@1 {
    /* No PHY interrupt */
    reg = <0x1>;
    };
    };

    &pcie0 {
    pci@0,0 {
    device_type = "pci";
    #address-cells = <3>;
    #size-cells = <2>;
    ranges;

    reg = <0 0 0 0 0>;

    usb@0,0 {
    reg = <0 0 0 0 0>;
    resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
    };
    };
    };

    /* uart0 communicates with the BT module */
    &uart0 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>;
    uart-has-rtscts;
    };

    /* uart1 is mapped to the pin header */
    &uart1 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart1_gpio14>;
    status = "okay";
    };

    &vc4 {
    status = "okay";
    };

    &vec {
    status = "disabled";
    };

    &wifi_pwrseq {
    reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
    };

    // =============================================
    // Downstream rpi- changes

    #include "bcm271x-rpi-bt.dtsi"

    / {
    soc {
    /delete-node/ pixelvalve@7e807000;
    /delete-node/ hdmi@7e902000;
    };
    };

    #include "bcm2711-rpi-ds.dtsi"
    #include "bcm283x-rpi-csi1-2lane.dtsi"
    #include "bcm283x-rpi-i2c0mux_0_44.dtsi"

    / {
    chosen {
    bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0";
    };

    /delete-node/ wifi-pwrseq;
    };

    &mmcnr {
    pinctrl-names = "default";
    pinctrl-0 = <&sdio_pins>;
    bus-width = <4>;
    status = "okay";
    };

    &uart0 {
    pinctrl-0 = <&uart0_pins &bt_pins>;
    status = "okay";
    };

    &uart1 {
    pinctrl-0 = <&uart1_pins>;
    };

    &spi0 {
    pinctrl-names = "default";
    pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
    cs-gpios = <&gpio 8 1>, <&gpio 7 1>;

    spidev0: spidev@0{
    compatible = "spidev";
    reg = <0>; /* CE0 */
    #address-cells = <1>;
    #size-cells = <0>;
    spi-max-frequency = <125000000>;
    };

    spidev1: spidev@1{
    compatible = "spidev";
    reg = <1>; /* CE1 */
    #address-cells = <1>;
    #size-cells = <0>;
    spi-max-frequency = <125000000>;
    };
    };

    &gpio {
    bt_pins: bt_pins {
    brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0
    // to fool pinctrl
    brcm,function = <0>;
    brcm,pull = <2>;
    };

    uart0_pins: uart0_pins {
    brcm,pins = <32 33>;
    brcm,function = <BCM2835_FSEL_ALT3>;
    brcm,pull = <0 2>;
    };

    uart1_pins: uart1_pins {
    brcm,pins;
    brcm,function;
    brcm,pull;
    };

    uart1_bt_pins: uart1_bt_pins {
    brcm,pins = <32 33 30 31>;
    brcm,function = <BCM2835_FSEL_ALT5>; /* alt5=UART1 */
    brcm,pull = <0 2 2 0>;
    };
    };

    &i2c0if {
    clock-frequency = <100000>;
    };

    &i2c1 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c1_pins>;
    clock-frequency = <100000>;
    };

    &i2s {
    pinctrl-names = "default";
    pinctrl-0 = <&i2s_pins>;
    };

    // =============================================
    // Board specific stuff here

    / {
    power_ctrl: power_ctrl {
    compatible = "gpio-poweroff";
    gpios = <&expgpio 5 0>;
    force;
    };
    };

    &sdhost {
    status = "disabled";
    };

    &phy1 {
    led-modes = <0x00 0x08>; /* link/activity link */
    };

    &gpio {
    audio_pins: audio_pins {
    brcm,pins = <>;
    brcm,function = <>;
    };
    };

    &leds {
    // Declare the LED but leave it disabled, in case a user wants to map it
    // to a GPIO on the header
    act_led: led-act {
    default-state = "off";
    linux,default-trigger = "mmc0";
    gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
    status = "disabled";
    };

    pwr_led: led-pwr {
    default-state = "off";
    linux,default-trigger = "default-on";
    gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
    };
    };

    &pwm1 {
    status = "disabled";
    };

    &vchiq {
    pinctrl-names = "default";
    pinctrl-0 = <&audio_pins>;
    };

    cam0_reg: &cam_dummy_reg {
    };

    &genet_mdio {
    clock-frequency = <1950000>;
    };

    / {
    __overrides__ {
    audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_hdmi=0'}";

    act_led_gpio = <&act_led>,"gpios:4",
    <&act_led>,"status=okay";
    act_led_activelow = <&act_led>,"gpios:8";
    act_led_trigger = <&act_led>,"linux,default-trigger";

    pwr_led_gpio = <&pwr_led>,"gpios:4";
    pwr_led_activelow = <&pwr_led>,"gpios:8";
    pwr_led_trigger = <&pwr_led>,"linux,default-trigger";

    eth_led0 = <&phy1>,"led-modes:0";
    eth_led1 = <&phy1>,"led-modes:4";
    };
    };

  • Hi,

    Here is the guideline on how to config soundcard on BBB. Hope this can help you.

    audio device driver Guidelines.pdf (ti.com)

  • Hi, 

    I don't have the makefile/KCONFIG files, bin and jason files. I only have tlv320adcx140.c and tlv320adcx140.h. Could you share with me those files? espeically the Kconfig file.

  • The document only offers the example on how to register sound card, what you need to do is focus on the slides on dts setting. For your project, do not care the KCONFIG and Makefile in the guideline.

    If you are interested in the code mentioned in the guideline. you can access this link (lpaa-android-drivers/pcmdevice-linux-driver - Unnamed repository; edit this file 'description' to name the repository.)

  • Beside, we are using bcm2711. I don't see it has something like mcasp tdm to connect codec and cpu. We will use i2s to do the connection in hardware point of view. Do you have any example to connect tlv320adc3140 by i2s with other mcu? Thank you!

  • Why MCU, your system is Linux, right?

  • Yes, Linux. MCU is lightweight CPU. It also runs OS

  • Have you successfully register the sound card?

  • How to tell? 

    I followed the pdf you sent me. Enable CONFIG_SND_SOC in kernel config. Add below dts nodes. But I still got no device in "arecord -l".

    sound {
    compatible = "simple-audio-card";
    simple-audio-card,name = "PI4";
    #sound-dai-cells = <0>;
    simple-audio-card,dai-link@0 {
    format = "i2s";
    bitclock-master = <&sound0_master>;
    frame-master = <&sound0_master>;
    sound0_master: cpu {
    sound-dai = <&i2s>;
    //clocks = <&clk_mcasp0>;
    //dai-tdm-slot-num = <4>;
    //dai-tdm-slot-width = <32>;
    //dai-tdm-slot-tx-mask = <1 1 1 1>;
    //dai-tdm-slot-rx-mask = <1 1 1 1>;

    };

    codec {
    sound-dai = <&tlv320adc3140>;

    };

    };

    &i2c0 {
    tlv320adc3140: tlv320adc3140@4c {
    compatible = "ti,tlv320adc3140";
    #sound-dai-cells = <0>;
    reg = <0x4c>;
    /* Digital Mics */

    ti,mic-bias-source = <6>;
    ti,pdm-edge-select = <0 0 0 0>;
    ti,gpio-config = <0 0>;
    ti,gpi-config = <4 5 6 7>;
    ti,gpo-config-1 = <4 1>;
    ti,gpo-config-2 = <4 1>;
    ti,gpo-config-3 = <4 1>;
    ti,gpo-config-4 = <4 1>;
    ti,slot-mapping = <0 1 2 3>;
    ti,asi-tx-driver = <0>;
    //reset-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;

    };
    };

  • Do you have any example based on i2s so we can follow?

  • Let's setup a conf-call? my mail is shenghao-ding@ti.com.

  • how to call you? by TEAM?

  • Team is OK for me. you can share the link with me via mail.

  • Tell me your time zone, and you may as well share the link via may mail (shenghao-ding@ti.com), already offered in previous post.

  • I am in Montreal time zone. I have sent you the link. If you are in China, I am ok to call you in your lunch time today. Let me know. Thank you!

  • Hi 

    As discussed over Team, kindly reference arch/arm/boot/dts/am335x-cm-t335.dts to set adc3140 as the master.

    Consult platform vendor how to set cpu part and set i2s-clk from platform side including bck and ws clk as input or slave mode.

    sound {
    compatible = "simple-audio-card";
    simple-audio-card,name = "cm-t335";

    simple-audio-card,widgets =
    "Microphone", "Mic Jack",
    "Line", "Line In",
    "Headphone", "Headphone Jack";

    simple-audio-card,routing =
    "Headphone Jack", "LHPOUT",
    "Headphone Jack", "RHPOUT",
    "LLINEIN", "Line In",
    "RLINEIN", "Line In",
    "MICIN", "Mic Jack";

    simple-audio-card,format = "i2s";
    simple-audio-card,bitclock-master = <&sound_master>;
    simple-audio-card,frame-master = <&sound_master>;

    simple-audio-card,cpu {
    sound-dai = <&mcasp1>; /*Kindly consult platform vendor how to set cpu part.*/
    };

    sound_master: simple-audio-card,codec {
    sound-dai = <&tlv320aic23>;
    system-clock-frequency = <12000000>;
    };
    };

  • Hi Mr Ding,

    Now I didn't even see the driver ko was loaded. 

  • Ko should be loaded by yourself.

  • No, even I build it into the kernel. I don't see the prints we added.

  • I am trying to buy a BBB board which works with your pdf guideline. Do you know the board revision or name? Which board you were using to write your guideline as I saw several options selling in Amazon.

  • The BBB we have used is a bit older one. it is rev C. AM335X, Cortex A8. 

  • Could you help to check why the adcx140_i2c_probe isn't been called while I insmod manually. No error reported during the insertion.  

  • It can be loaded on BBB. Would you compile the driver into kernel instead of ko? Then check whether it has been loaded. Are your sure the setting you added in the right dts file?

  • Hi Ding,

    Yes, it is the correct dts. I tried to compile it into kernel or loaded it as ko. Neither way I can see the adcx140_codec_probe get called. 

  • things related to snd in dmesg:

    adsdev@RogueOne:~ $ dmesg | grep sound
    [ 1.675553] No soundcards found.
    [ 17.631501] platform sound: deferred probe pending

  • The calling sequence is:

    1) i2c_probe

    2) codec probe

    The first step is to confirm whether i2c_probe was called? And can you confirm whether there're other chips on the i2c bus where adc3140 connected and whether they have been loaded successfully?

  • Hi, we bought the BBB board from this link

    https://www.amazon.ca/WaveShare-BB-BeagleBone-Cortex-A8-Development/dp/B00KM6YTN6/ref=sr_1_1?keywords=beaglebone+black&qid=1691419815&sprefix=beagle%2Caps%2C120&sr=8-1

    Do you have a guideline how to setup this board so we can have the sound card working? 

    The pdf you sent me before is BBB+pcmdevice which we don't know what it is. 

  • I think there is only one i2c device except the PI in this bus because I detect non after I remove the connection from PI to tlv.

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

  • The first step is to confirm whether i2c_probe was called? -- I replied several times. I don't see it got called.

  • Kindly consult platform vendor why the i2c dts setting can't cause i2c_probe be called.

  • You can integrate pcmdevice code to BBB directly. The guideline is which I shared with you before. 

    code is here:

    lpaa-android-drivers/pcmdevice-linux-driver - Unnamed repository; edit this file 'description' to name the repository.

  • Will it be possible that it can't find the driver? I already built it into the kernel. Does the driver have to be ko to let the dts device binding work?

    compatible = "ti,tlv320adcx140"

  • Has 2 questions about your guideline:

    1, where can I get the linux kernel code? which config shoud I use to build the kernel and how to run it on BBB board?

    2, the pcmdevice in my opinion is different with what we have on hand tlv320adcx140.c. Do you have a example to show us how to run tlv320adcx140.c driver on BBB board?

  • In my understanding, I thought that the BBB already includes a tlv320adcx140 adc on board. what I needed to do is just make a config in the kernel and then it will work with aplay and arecord. Is that right?

  • In the driver, there's no "ti,tlv320adcx140" in the tlv320adcx140_of_match. Pls use "ti,tlv320adc3140".
    And make sure following module in the code has been compiled into the driver.

    #ifdef CONFIG_OF

    static const struct of_device_id tlv320adcx140_of_match[] = {
    { .compatible = "ti,tlv320adc3140" },
    { .compatible = "ti,tlv320adc5140" },
    { .compatible = "ti,tlv320adc6140" },
    {},
    };
    MODULE_DEVICE_TABLE(of, tlv320adcx140_of_match);
    #endif
  • Sure, both of them are available on BBB. 

  • linux kernel for BBB can be downloaded: https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM335X/08_02_00_24/exports/docs/devices/AM335X/linux/Release_Specific_Release_Notes.html

    For question 2, I have had shared the guideline with you before. Use arecord command.

  • Thank for your this information. It finally got called. But the adcx140_codec_probe isn't called. The return of the i2c_probe is 0.

  • Hi Ding,

    Any idea why adcx140_codec_probe isn't get called? is it still the naming issue?

  • For sound card register, have you got support from platform vendor on how to set cpu in dts file?

    One more thing, kindly post the i2c dts setting for adc3140.

    simple-audio-card,cpu {
    sound-dai = <??????>; /*Kindly consult platform vendor how to set cpu part.*/
    };

  • Hi Ding,

    we search online in Pi Forum, they set it as &i2s.

  • Hi Ding,

    In codec_probe, there is an error while trying to write register with regmap_write. The error is -5. I checked it. It is saying the the register is not writable.

  • Kindly check whether i2c read and write works well in the platform.

    Execute following command
    i2cdump -y -f 0 4c 0 is i2c bus no 4c is 7-bit i2c device address
  • adsdev@RogueOne:~ $ sudo i2cdump -y -f 0x1 0x4c
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 00 00 00 05 00 30 00 00 00 00 01 02 03 04 .....?.0....????
    10: 05 06 07 02 48 ff 10 10 04 20 02 08 00 00 02 40 ????H.??? ??..?@
    20: 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ."..............
    30: 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 c9 80 ..............??
    40: 00 00 00 c9 80 00 00 00 c9 80 00 00 00 c9 80 00 ...??...??...??.
    50: 00 00 c9 80 00 00 00 c9 80 00 00 00 c9 80 00 00 ..??...??...??..
    60: 00 c9 80 00 00 00 00 00 00 00 00 01 40 7b 00 00 .??........?@{..
    70: e7 00 00 f0 00 00 00 80 00 00 ff 00 ff 8c 00 00 ?..?...?.....?..
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................


    adsdev@RogueOne:~ $ sudo i2cdump -y -f 0x1 0x40
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    20: 00 00 01 04 00 01 01 00 03 0c ff ff 00 00 00 04 ..??.??.??.....?
    30: 02 1a 22 22 c2 02 02 00 80 80 00 00 00 00 XX XX ??""???.??....XX
    40: c0 ff 02 XX XX XX d7 d7 00 00 XX XX XX XX XX XX ?.?XXX??..XXXXXX
    50: XX XX XX XX XX XX XX XX XX XX 00 00 00 00 00 00 XXXXXXXXXX......
    60: 44 10 00 00 00 00 00 00 00 00 00 00 00 00 0f 40 D?............?@
    70: 00 00 00 00 00 00 00 00 3d 00 00 00 00 00 02 XX ........=.....?X
    80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    a0: 00 00 01 04 00 01 01 00 03 0c ff ff 00 00 00 04 ..??.??.??.....?
    b0: 02 1a 22 22 c2 02 02 00 00 80 00 00 00 00 XX XX ??""???..?....XX
    c0: c0 ff 02 XX XX XX d7 d7 00 00 XX XX XX XX XX XX ?.?XXX??..XXXXXX
    d0: XX XX XX XX XX XX XX XX XX XX 00 00 00 00 00 00 XXXXXXXXXX......
    e0: 44 10 00 00 00 00 00 00 00 00 00 00 00 00 0f 40 D?............?@
    f0: 00 00 00 00 00 00 00 00 3d 00 00 00 00 00 00 XX ........=......X

  • I don't think i2c communication works well on chip 0x40.

    Kindly ask the hardware guy for support.

    adsdev@RogueOne:~ $ sudo i2cdump -y -f 0x1 0x40
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    20: 00 00 01 04 00 01 01 00 03 0c ff ff 00 00 00 04 ..??.??.??.....?
    30: 02 1a 22 22 c2 02 02 00 80 80 00 00 00 00 XX XX ??""???.??....XX
    40: c0 ff 02 XX XX XX d7 d7 00 00 XX XX XX XX XX XX ?.?XXX??..XXXXXX
    50: XX XX XX XX XX XX XX XX XX XX 00 00 00 00 00 00 XXXXXXXXXX......
    60: 44 10 00 00 00 00 00 00 00 00 00 00 00 00 0f 40 D?............?@
    70: 00 00 00 00 00 00 00 00 3d 00 00 00 00 00 02 XX ........=.....?X
    80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
    a0: 00 00 01 04 00 01 01 00 03 0c ff ff 00 00 00 04 ..??.??.??.....?
    b0: 02 1a 22 22 c2 02 02 00 00 80 00 00 00 00 XX XX ??""???..?....XX
    c0: c0 ff 02 XX XX XX d7 d7 00 00 XX XX XX XX XX XX ?.?XXX??..XXXXXX
    d0: XX XX XX XX XX XX XX XX XX XX 00 00 00 00 00 00 XXXXXXXXXX......
    e0: 44 10 00 00 00 00 00 00 00 00 00 00 00 00 0f 40 D?............?@
    f0: 00 00 00 00 00 00 00 00 3d 00 00 00 00 00 00 XX ........=......X

  • Isn't it 0x4c? I don't know why the 0x4c becomes UU now? Before it was 0x4c in the UU place.

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

  • I google it. UU means there is a driver using this address. That makes sense. So the device should be 0x4c. 

    What does we have to with 0x40? 0x40 is for what? Thanks.

  • is the communication in 0x4c part good?

    adsdev@RogueOne:~ $ sudo i2cdump -y -f 0x1 0x4c
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 00 00 00 05 00 30 00 00 00 00 01 02 03 04 .....?.0....????
    10: 05 06 07 02 48 ff 10 10 04 20 02 08 00 00 02 40 ????H.??? ??..?@
    20: 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ."..............
    30: 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 c9 80 ..............??
    40: 00 00 00 c9 80 00 00 00 c9 80 00 00 00 c9 80 00 ...??...??...??.
    50: 00 00 c9 80 00 00 00 c9 80 00 00 00 c9 80 00 00 ..??...??...??..
    60: 00 c9 80 00 00 00 00 00 00 00 00 01 40 7b 00 00 .??........?@{..
    70: e7 00 00 f0 00 00 00 80 00 00 ff 00 ff 8c 00 00 ?..?...?.....?..
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................