KSCAN sample undefined reference to `__device_dts_ord_N'

Hello,

I've been waiting for a response to this post for a month, but got no suggestions.

So I created this new case for it.

I am using nrf5340dk board to test KSCAN sample.

When I build KSCAN sample,it occurs error "undefined reference to `__device_dts_ord_N'" in this part:

//const struct device *const kscan_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_keyboard_scan));
const struct device *const kscan_dev = DEVICE_DT_GET(DT_NODELABEL(kscan0));

Here is my overlay file "nrf5340dk_nrf5340_cpuapp.overlay":

/ {
    chosen {
        kscan = &kscan0;
    };

    kscan0: kscan_0 {
        compatible = "kscan-gpio-matrix";
        label = "KSCAN";
        diode-direction = "col2row";
        col-gpios
            = <&gpio1 4 GPIO_ACTIVE_HIGH>
            , <&gpio1 5 GPIO_ACTIVE_HIGH>
            , <&gpio1 6 GPIO_ACTIVE_HIGH>
            ;

        row-gpios
            = <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
            , <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
            , <&gpio0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
            ;
    };
    aliases {
        kscan0 = &kscan0;
    };
};

I want to know how to modify the code to use kscan sample.

Related