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


Bolivar, Marti
 

Hi,

This email list is for upstream zephyr, not NCS, but since the sample is
available in upstream zephyr I will respond here.

"ilkka.virtanen via lists.zephyrproject.org"
<ilkka.virtanen=sensoan.com@...> writes:

Hi,

I've tried to run the sht3xd sample using nRF52840DK, which is one of the boards with sample configuration overlay file, but all I get out in the logs is this:
*** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
Could not get SHT3XD device

What I get from this log is that for some reason the system fails to
load the device driver for the sensor.
Be careful here. There is a difference between a device and a device
driver.

The device driver can be compiled into your binary correctly, but the
individual devices can fail to initialize, which is almost definitely
what is happening here.

In general, device_get_binding() returns NULL if the device
initialization function fails, or if there is no such device.


I'm relatively new to Zephyr
and I have trouble understanding how to debug the problem. Can anyone
give me pointers where to look?
Other than the driver model documentation and the driver source code,
I've been plugging my recent device model talk a lot lately:

https://www.youtube.com/watch?v=sWaxQyIgEBY

It may be useful. YMMV :)


I've built the sample using NordicConnectSDK 1.6.1 which uses Zephyr 2.6.0-rc1-ncs1
...NordicConnectSDK/1.6.1/zephyr/samples/sensor/sht3xd$ west build -b
nrf52840dk_nrf52840
Since, as you say, there is a devicetree overlay for the board you are
using here:

https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/sht3xd/boards/nrf52840dk_nrf52840.overlay

The device structure should be allocated. So I am assuming it just
failed to initialize correctly in your environment. Did you connect the
pins as described in the comments in the overlay file?

Try stepping through sht3xd_init() in your debugger to see where it
fails, or enable more verbose logs in the sensor driver using Kconfig to
see what went wrong.

Hope this helps,
Marti




Thanks.


Join users@lists.zephyrproject.org to automatically receive all group messages.