How do I add a ti-ads1015 driver to the Jetson Nano [developer kit version] device tree?

Hi,
The following error occurred recently when adding the ti-ads1015 driver to the device tree using Jetson Nano [developer kit version]:
[ 3.999057] tegra-i2c 7000c500.i2c: no acknowledge from address 0x48
[ 4.005531] ads1015: probe of 2-0048 failed with error -121
My device tree configuration is as follows:
i2c@7000c500 { /* i2c2 ?? */
status = “okay”;
ads1015@48 {
compatible = “ti,ads1015”;
reg = <0x48>;
#address-cells = <1>;
#size-cells = <0>;
status = “okay”;
};
};

Refer to ads1015 instructions:

  1. The /ads1015 node

Required properties:

  • compatible : must be “ti,ads1015”
  • reg : I2C bus address of the device
  • #address-cells : must be <1>
  • #size-cells : must be <0>

The node contains child nodes for each channel that the platform uses.

Example ADS1015 node:

ads1015@49 {
    compatible = "ti,ads1015";
    reg = <0x49>;
    #address-cells = <1>;
    #size-cells = <0>;

    [ child node definitions... ]
}
  1. channel nodes

Required properties:

  • reg : the channel number

Optional properties:

  • ti,gain : the programmable gain amplifier setting
  • ti,datarate : the converter data rate

Example ADS1015 channel node:

channel@4 {
    reg = <4>;
    ti,gain = <3>;
    ti,datarate = <5>;
};

modified:
i2c@7000c500 { /* i2c2 ?? */
status = “okay”;
ads1015@49 {
compatible = “ti,ads1015”;
reg = <0x49>;
#address-cells = <1>;
#size-cells = <0>;
status = “okay”;
};
};

[ 4.076347] tegra-i2c 7000c500.i2c: no acknowledge from address 0x49
[ 4.082934] ads1015: probe of 2-0049 failed with error -121

Welcome to the NVIDIA developer forums @arlen.x.

For better visibility I have moved your post to the correct sub-category with the Jetson experts.

Thanks!

Hi study_x,

Are you using Jetson Nano with eMMC or SD module?
What’s your Jetpack version in use?

Which I2C bus do you want to use?
(i.e. how do you connect your ADS1015 I2C device on the Jetson Nano devkit?)

Please share your full device tree and dmesg for further check.

I use eMMC module,BSP version:R32.7.4,use i2c2, ads1015 is mounted on I2C_2_SDA(I2C Bus 1) I2C_2_SCL(I2C Bus 1) GPIO216 as shown below,

use tegra210-p3448-0002-p3449-0000-b00.dts:
include “tegra210-porg-p3448-common.dtsi”
include “porg-platforms/tegra210-porg-camera-rbpcv3-dual-imx477.dtsi”
include “porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi”
include “porg-platforms/tegra210-porg-pinmux-p3448-0002-b00.dtsi”
include “porg-platforms/tegra210-porg-gpio-p3448-0002-b00.dtsi”
include “porg-platforms/tegra210-porg-p3448-emc-a00.dtsi”

/ {
model = “NVIDIA Jetson Nano Developer Kit”;
compatible =“nvidia,p3449-0000-b00+p3448-0002-b00”, “nvidia,jetson-nano”, “nvidia,tegra210”;
nvidia,dtsfilename = FILE;

sdhci@700b0600 { /* SDMMC4 for EMMC */
	status = "okay";
};

sdhci@700b0000 { /* SDMMC1 for SD card */
	status = "disabled";
};

spi@70410000 { /* QSPI */
	status = "disabled";
};

gpio@6000d000 {
		/* gpio-name for 40-pin header, gpio-name given as COL(10) x ROW(20) */
		gpio-line-names = "",   "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "SPI1_MOSI",    "SPI1_MISO",    "SPI1_SCK",     "SPI1_CS0",     "SPI0_MOSI",    "SPI0_MISO",    "SPI0_SCK",     "SPI0_CS0",
		"SPI0_CS1",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "GPIO13",      "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"UART1_RTS",    "UART1_CTS",    "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "I2S0_FS",    "I2S0_DIN",    "I2S0_DOUT",   "I2S0_SCLK",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "GPIO01",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "GPIO07",   "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "GPIO12",       "",     "",     "",     "",     "",
		"GPIO11",      "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "GPIO09",     "",     "",     "",
		"",     "",     "",     "",     "",     "",     "",     "",     "",     "",
		"",     "",     "SPI1_CS1",     "",     "",     "",     "",     "",     "",     "";
};

// uartWK {
// compatible = “wkmic,wk2114_uart”;
// pinctrl-names = “default”;
// reg =<0>;
// spi-max-frequency =<10000000>;
// reset-gpio=<&gpio TEGRA_GPIO(G, 2) GPIO_ACTIVE_HIGH>;//add xu
// irq-gpio=<&gpio TEGRA_GPIO(J, 7) IRQ_TYPE_LEVEL_LOW>;//add xu
// status = “okay”;
// };

//i2c@7000c500 { /* i2c2 ?? */
//&i2c2{
//i2c@7000c400 {
i2c2{
	status = "okay";
	ads1015@48 {
		compatible = "ti,ads1015";
	    reg = <0x48>;
	    reset-gpio = <&gpio TEGRA_GPIO(BB, 0) GPIO_ACTIVE_LOW>;
		reset-active-low;
		reset-delays-us = <0 50000 50000>;
	    #address-cells = <1>;                                                                                                  
	    #size-cells = <0>;
	    status = "okay";
	};
};

};

Please refer to the following figure from carrier board specification

It seems you are using I2C1_SDA(PIN3)/I2C1_SCL(PIN5) as following.

You can refer to Jetson/L4T/peripheral/ - eLinux.org for the I2C mapping on Jetson Nano.
It should be 7000c400 so that please put device tree configuration for your ADS1015 under i2c@7000c400 node.

Thank you for your answer. After modifying some hardware problems recently, it is normal.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.