Re: Problem running samples/sensor/sht3xd #driver #sensor

Bolivar, Marti

Hi again Ilkka,

"ilkka.virtanen via"
<> writes:

Thank you Marti for the reply.

The problem was indeed in the connection between the nRF52840DK and the external sensor. I watched your video, it was very good and informative.
I'm glad; thanks!

As I learned that the device will be initialized before execution is in application code, I realize we will have a problem with the driver in our own product. Our own board will have a sht31 sensor but it is behind a TCA9548A I2C switch, which means a device tree configuration like this:
&i2c0 {
tca9548a@71 ( TCA9548A@71 ) {
sht3xd@44 {

Can I stack the drivers like this?
Yes, you can, you just need to make sure the initialization priorities
are managed correctly so the init functions run in the following order:

i2c0 -> tca9548a -> sht3xd

You can control the initialization priorities with Kconfig options, but
the defaults should be OK for your use case.

respectively for i2c0 and sht3xd.

If yes, to be able to use the available device drivers for the sensors
that are behind the I2C switch, I will need to implement the tca9548a
functionality to a device driver to make this work. Do you know are
there any example to use as a starting point?
I recently reviewed a TCA9546A driver, which seems similar to your

If the differences are superficial you may be able to extend the driver
to support "TCA954xA", i.e. both devices.

You may wish to contact the driver author if you want to collaborate.

Thanks again,

Join to automatically receive all group messages.