Hi.
We have a custom carrier for our TX2 NX and we connected a HDC1080 sensor over i2c port, but we’re not able to find it’s address, which should be located at 0x40.
Looking at the devices in sys/bus/i2c/devices/, we don’t see anything obvious that resembles our sensor so we’re not sure if we should be able to read from it immediately or if we need to add any configuration to our device tree. If so, is there any documentation on exactly we should do that?
Yes, we double checked both the datasheet and our schematics, and it’s correct.
We are not sure about this one now.
I can’t seem to find any bus that corresponds to our sensor.
As I mentioned, when we look inside /sys/bus/i2d/devices/* and looking at the name of all devices (hopefully that helps, i’m nor sure):
Thank for the file attachment.
We think that it should be in I2C1, but we’re not able to detect it using i2cdetect -r -y 1. On other buses, we can find something already being used bu another driver in at the same address that the hdc1080 is expected (0x40). Those would be for ina3221 (which I’m assuming is from the tx2 module). Others are for the imx219.
The documentation mentioned to be aware of i2c peripherals with the same address, on the same bus. Is it possible for any of these to ‘override’ (not sure about the term) the address our sensor and we can’t see him?
Though we THINK they’re on different buses, at this point we’re not really sure.
Also, is there anything that could make our i2c sensor not show up in i2cdetect?
imx219 by default using 0x10,
it should be ina3221 since IMX219 is not available for TX2 series. however, it’s under i2c-0,
for example,
i2c@3160000 {
ina3221x_40: ina3221x@40 {
had you done device tree implementation?
please disassembler your dtb binary file into text file to examine the configurations has compile correctly.
for example, $ dtc -I dtb -O dts -o temp.dts tegra186.dtb
I have not made any device tree implementation in regards to this (i’m not sure what has to be done) Can you show me how I would do so?
Here is our current decompiled dtb.
From the document you provided, plus the TX2 NX datasheet, we are now sure it should be on the bus I2c0.
As i mention previously, i2cdetect -r -y 0 does not show any i2c peripheral.
Do I need to make any adjustments do the dts so I can interact with the sensor? We are not sure how to proceed from here.
Edit:
To make sure the hdc sensor is working, we’ve connected the sda, scl pins to an arduino, where we could successfully read data from it, so the sensor is working fine.
We’ve also now tried to add the following to the main dts, to see if it made any change to the previous i2cdetect command:
We still don’t see anyhting. We’ve also been trying to write to the configuration register but every write fails so, right now we’re thinking that we need to review this device tree implementation. Any help with this?
you should create the node under the address of i2c0,
for example,
i2c@3160000 {...
hdc1080@40 {...
if the node creation is correct, you should see below through sysfs.
for example, /proc/device-tree/i2c@3160000/hdc1080@40
that compatible string is used for looking its kernel driver, so, you must have driver implementation which has the same string, compatible= "ti,hdc1080";
Can you tell me a way where I can look for the driver, either in the source code or through sysfs ? Because I don’t really know where to look for, and so that I’m not just trying guessing the name of the driver,
please check Jetson Linux Archive | NVIDIA Developer, you may download the public release sources package, you should extract kernel_src.tbz2 to obtain kernel driver and device tree sources.
BTW, I don’t think the sources package include HDC1080 driver, you should have your own implementation to enable this sensor.
Hi @JerryChang , thank you so much for the answer.
My question is, where in the source should I look for the drivers (they’re a bit overwhelming to be honest)? I wouldn’t mind at all make my own driver implementation, I just need to know where in the sources I should look for the driver (if exists), and what is the process of implementing a new driver? As in, where do I add the implementation code, how to compile it etc… Is there any documentation I could read about that, that your aware? Probably would be easier if I could read somewhere.
Hi.
Looking through the available drivers, there is one that should work for hdc1080 sensor and is located at .../sources/kernel/kernel-4.9/drivers/iio/humidity/hdc100x.c.
Now, in the device tree what I did like you said, at the bus 0 I added my sensor:
please review the sensor schematic, you should assign correct regulator settings to your connected device.
you should also check you’ve correct pin connections, for example, you’ll need to provide VDD, 3.3 voltage, setup correct SCL/SDA for communication, and GND to common ground.
there’s regulator-name… vdd-3v3-cvb, or vdd-3v3-disp-cvb on TX2 NX, please see-also reference driver to have implementation.
for example,
there’s avdd_lcd-supply for a nvdisplay DT property, it points to a 3v3 regulator settings, &vdd_disp_3v3.
I’m very inexperienced so I’m not sure what to really add here to properly setup the sensor in the device tree.
I’ve also tried to implement the i2c device in user space by #echo hdc1080 0x40 > /sys/bus/i2c/devices/i2c-0/new_device but I still haven’t been able to detect the device in bus 0 at the 0x40 address with i2cdetect.
What would I need to add to this current implementation of the device tree to properly config the sensor?
Thank you for the patience, I am very inexperienced with this.
the question should be whether hdc100x.c can drive HDC1080?
as the source file indicate… hdc100x.c - Support for the TI HDC100x temperature + humidity sensors
I’ve also check this reference driver, hdc100x.c, it’s very old. it doesn’t have compatible string to recognize device tree sources.
however,
while am google it around and see this might helpful.
Cool.
Also, I’m not really a hardware guy (as you might’ve noticed) so I’m not really sure what should go into the device tree node to make sure our sensor is recognized .
This is my current node, mostly copied from another sensor and only adapted the name and the register addresses.
What I am sure is that it should be in i2cbus 0, and the default address it should be found is 0x40. Is there anything else here that I’m missing and or is wrong? Is there any documentation on what I should be looking for while building this dts node?
I understand these are very fundamental and basic questions, but I really need some help clarifying some of this stuff.
Thank you for your help so far.