Zephyr Example Application cannot be built


Jonathan Hahn
 

Hey,

I did not try to build myself, but after quickly looking into your code, I have
a few ideas, you could give a try:

  • The dts/bindings filenames are missing your `x`.
  • You could use 
    const struct device *dev = DEVICE_DT_GET(LSM6DSOX_LABEL);
    instead of device_get_binding
    If sensor driver was not compiled, it should fail at compile time.
  • Your root/Kconfig and app/Kconfig seem to duplicate stuff.
  • drivers/sensor/CMakeLists.txt does not use add_subdirectory_ifdef, not sure whether the if clause does what it is intended to do.

Not very convinced that looking in any of those solves your issue. Hope it helps though.

Best regards

Jonathan

Am 10.03.22 um 11:26 schrieb lau kc:

Hi,
  I would like to develop an out-of-tree driver and there is an example provided in zephyrproject-rtos github(https://github.com/zephyrproject-rtos/example-application).

  I have followed the example and built a project with a sensor driver. The driver is a copy of lsm6dso and renamed to lsm6dsox for testing. There is no error message when building the project but I noticed that the drivers have not been imported. 

  If I move the out-of-tree driver to the root zephyr driver directory(driver and dts).
Everything is working fine and the driver can be correctly imported. But that is not the goal of an out-of-tree driver.

  Could anyone give me advice?

-yes.png is the sample project containing the .c file is built.
-no.png is the out-of-tree project that does not contain the .c file.
-copy_to_driver.png is the out-of-tree project that contains the .c file by copying the out-of-tree driver to the zephyr driver directory.
-.zip if the out-of-tree project for testing.


lau kc <kclauah@...>
 

Hi,
  I would like to develop an out-of-tree driver and there is an example provided in zephyrproject-rtos github(https://github.com/zephyrproject-rtos/example-application).

  I have followed the example and built a project with a sensor driver. The driver is a copy of lsm6dso and renamed to lsm6dsox for testing. There is no error message when building the project but I noticed that the drivers have not been imported. 

  If I move the out-of-tree driver to the root zephyr driver directory(driver and dts).
Everything is working fine and the driver can be correctly imported. But that is not the goal of an out-of-tree driver.

  Could anyone give me advice?

-yes.png is the sample project containing the .c file is built.
-no.png is the out-of-tree project that does not contain the .c file.
-copy_to_driver.png is the out-of-tree project that contains the .c file by copying the out-of-tree driver to the zephyr driver directory.
-.zip if the out-of-tree project for testing.