This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Missing binding for out-of-tree driver

I have an out-of-tree driver. It has an I2C that is working but also GPIO that are only working with compatible = "gpio-leds" but not with the driver compatible = "st,vl53lx".

The project is on git. See NRFconnect_out-of-tree_example

The root error is:

../src/modules/vl53lx/vl53lx.c: In function 'vl53lx_standby':
zephyr/include/generated/devicetree_unfixed.h:3877:29: error: 'DT_N_S_tof_S_tof_xshut_P_gpios_IDX_0_VAL_pin' undeclared (first use in this function); did you mean 'DT_N_S_leds_S_led_3_P_gpios_IDX_0_VAL_pin'?
#define DT_N_ALIAS_xshut DT_N_S_tof_S_tof_xshut

This macro failes:

#define TOF_XSHUT_PIN DT_GPIO_PIN(TOF_XSHUT_NODE, gpios)

In the «board.dts» is a snipped like:

#include <nordic/nrf52832_qfaa.dtsi>
/dts-v1/;

{

model = "TEST_BT NRF52832";
compatible = "nordic";
leds {

compatible = "gpio-leds";
led0: led_0 {

gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
label = "Green LED 0";

};

tof {

compatible = "st,vl53lx";
//compatible = "gpio-leds"; // HACK it works with that because the binding is in Zephyr tree
tof2: tof_xshut {

gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; // BUG this definition does not exist
label = "Xshutdown active low";

};

};

}

In the "devicetree_unfixed.h" there is a difference between the tof GPIO and the LED ones:
The bindig is missing for the TOF

/*
* Devicetree node: /leds/led_0
*
* Node identifier: DT_N_S_leds_S_led_0
*
* Binding (compatible = gpio-leds):
* $ZEPHYR_BASE\dts\bindings\gpio\gpio-leds.yaml
*
* (Descriptions have moved to the Devicetree Bindings Index
* in the documentation.)
*/

/*
* Devicetree node: /tof
*
* Node identifier: DT_N_S_tof
*/

Parents
  • I build to test_bt_nrf52832. It is a copy of nrf52dk_nrf52832 with some modifications for the TOF sensor.

    The buildall.bat can be used for build with WEST but some paths have to be changed for your local installation.

  • AndreasM said:
    The buildall.bat can be used for build with WEST but some paths have to be changed for your local installation.

     Where can I find buildall.bat? What are you referring to specifically by "some paths"? Is there anything else I need to know before I try to build?

  • Sorry for the delay. Holidays are over now and I am at work again.

    Please see the content of the buildall.bat below. The path that have to be modified for your installations are in blue. 

    Thanks for help

    cls
    @echo off

    set GNUARMEMB_TOOLCHAIN_PATH=C:/Users/yourName/ncs/v1.5.1/toolchain/opt/bin
    set ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
    set ZEPHYR_BASE=C:\Users\yourName\ncs\v1.5.1\zephyr
    set JLINK_ROOT="C:\Program Files (x86)\SEGGER\JLink"

    set DEVICE=nrf52832
    set JLINK_SERIAL=960084090
    set GDB_PORT_NUMBER=2331
    set JLINKGDBSERVER=%JLINK_ROOT%/GDBServer

    set BOARD=tece_filo_bt_nrf52810
    set BUILDDIR=build-%BOARD%

    echo %GNUARMEMB_TOOLCHAIN_PATH%
    echo %ZEPHYR_BASE%

    west build -p -b test_bt_nrf52832 --build-dir build

  • The issue is still open and need an answer. So I made some additional tests.

    My custom boards is still out of tree in ./boards/arm/test_nrf52832

    I copied the gpio-leds.yaml and placed a valve.yaml in the same directory.

    /dts-v1/;
    #include <nordic/nrf52832_qfaa.dtsi>
    #include <dt-bindings/gpio/gpio.h>

    / {

    model = "Some readable text";
    compatible = "test,test_nrf52832,nordic";

    .... only part of the test_nrf52832.dts file

    led {
        compatible = "gpio-leds";
            port06: _P06 {
            label = "Signal LED";
            gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
        };
    };

    valve {
       //compatible = "gpio-leds"; // HACK that works
       compatible = "valve";

       port020: _P020 {
            label = "Valve auf";
            gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
       };
       port08: _P08 {
            label = "Valve zu";
            gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
       };

    aliases {
        auf = &port020;
        zu = &port08;
        signal-led = &port06;
    };


    };

    The error I get seems to be in divicetree_unfixed.h. I suspect the gpio0 that is defined in the nrf52832.dtsi is not linked.

    comparing the signal-led and the "Valve zu" the gpio0 part is not generated:

    /* Generic property macros: */
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_EXISTS 1
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_PH DT_N_S_soc_S_gpio_50000000
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_pin 6
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_pin_EXISTS 1
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_flags 1
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_flags_EXISTS 1
    #define DT_N_S_led_S__p06_P_gpios_LEN 1
    #define DT_N_S_led_S__p06_P_gpios_EXISTS 1
    #define DT_N_S_led_S__p06_P_label "Signal LED"
    #define DT_N_S_led_S__p06_P_label_EXISTS 1

    /* Generic property macros: */
    #define DT_N_S_valve_P_compatible {"valve"}
    #define DT_N_S_valve_P_compatible_IDX_0 "valve"
    #define DT_N_S_valve_P_compatible_IDX_0_EXISTS 1
    #define DT_N_S_valve_P_compatible_LEN 1
    #define DT_N_S_valve_P_compatible_EXISTS 1

    Any idea what is missing so that the valve binding is incomplete.

    Thanks for help.

Reply
  • The issue is still open and need an answer. So I made some additional tests.

    My custom boards is still out of tree in ./boards/arm/test_nrf52832

    I copied the gpio-leds.yaml and placed a valve.yaml in the same directory.

    /dts-v1/;
    #include <nordic/nrf52832_qfaa.dtsi>
    #include <dt-bindings/gpio/gpio.h>

    / {

    model = "Some readable text";
    compatible = "test,test_nrf52832,nordic";

    .... only part of the test_nrf52832.dts file

    led {
        compatible = "gpio-leds";
            port06: _P06 {
            label = "Signal LED";
            gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
        };
    };

    valve {
       //compatible = "gpio-leds"; // HACK that works
       compatible = "valve";

       port020: _P020 {
            label = "Valve auf";
            gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
       };
       port08: _P08 {
            label = "Valve zu";
            gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
       };

    aliases {
        auf = &port020;
        zu = &port08;
        signal-led = &port06;
    };


    };

    The error I get seems to be in divicetree_unfixed.h. I suspect the gpio0 that is defined in the nrf52832.dtsi is not linked.

    comparing the signal-led and the "Valve zu" the gpio0 part is not generated:

    /* Generic property macros: */
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_EXISTS 1
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_PH DT_N_S_soc_S_gpio_50000000
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_pin 6
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_pin_EXISTS 1
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_flags 1
    #define DT_N_S_led_S__p06_P_gpios_IDX_0_VAL_flags_EXISTS 1
    #define DT_N_S_led_S__p06_P_gpios_LEN 1
    #define DT_N_S_led_S__p06_P_gpios_EXISTS 1
    #define DT_N_S_led_S__p06_P_label "Signal LED"
    #define DT_N_S_led_S__p06_P_label_EXISTS 1

    /* Generic property macros: */
    #define DT_N_S_valve_P_compatible {"valve"}
    #define DT_N_S_valve_P_compatible_IDX_0 "valve"
    #define DT_N_S_valve_P_compatible_IDX_0_EXISTS 1
    #define DT_N_S_valve_P_compatible_LEN 1
    #define DT_N_S_valve_P_compatible_EXISTS 1

    Any idea what is missing so that the valve binding is incomplete.

    Thanks for help.

Children
Related