Error 134 when using voltage divider in Device Tree

Hi,

I have the following Device Tree in my application:

&adc {
    status = "okay";
};

vbatt {
    status = "okay";
    compatible = "voltage-divider";
    io-channels = <&adc 0>;
    output-ohms = <2200>;
    full-ohms = <(8200 + 2200)>;
    power-gpios = <&gpio1 6 0>;
};

I get the error -134 during the application startup. Debugging the application shows that the error happens here

ret = adc_channel_setup_dt(&config->voltage.port);
if (ret != 0) {
	LOG_ERR("setup: %d", ret);
	return ret;
}

and channel_cfg_dt_node_exists is set to false.

Why do I get this error?

  • Hello,

    I don't knoww what your &config parameter is, so it is a bit difficult to say exactly what the issue is. 

    Perhaps you can look at one of the samples that are using this voltage divider. One of them is the one found in:

    NCS\zephyr\samples\boards\nrf\battery

    If you build it for the target thingy52_nrf52832, it should use the vbatt defined in the thingy52_nrf52832.dts

    Best regards,

    Edvin

Related