cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157 ADC failing to probe during boot

LinuxAddict
Associate II

Greeting.

I'm trying to get our ADC subsystem up and running and getting weird errors in dmesg during boot. I'm assuming I've done something wrong with devicetree but I can't seem to figure out a working combination from the docs.

Full part number of our MPU is STM32MP157CAC3.

During boot we get error -61 during the probe of the two converters as shown below

Thanks,

-LinuxAddict

 

$ dmesg | grep -E "adc|iio"
[ 2.510869] iio iio:device0: No channels configured
[ 2.514812] stm32-adc: probe of 48003000.adc:adc@0 failed with error -61
[ 2.522467] iio iio:device0: No channels configured
[ 2.526055] stm32-adc: probe of 48003000.adc:adc@100 failed with error -61

Here's our devicetree portions:

&pinctrl {
    adc1_pins: adc1-single-ended {
        analog-inputs1 {
            pinmux = <STM32_PINMUX('C', 0, ANALOG)>,
                     <STM32_PINMUX('A', 5, ANALOG)>;
            bias-disable;
        } ;
    } ;
};

&adc {
    pinctrl-names = "default";
    pinctrl-0 = <&adc1_pins>;
    status = "okay";
    vdda-supply = <&vdd>;
    vref-supply = <&v3v3>;

    /* ANALOG_IN1 = ADC2_INP0 (pin ANA0) */
    /* ANALOG_IN2 = ADC2_INP1 (pin ANA1) */
    /* ANALOG_IN3 = ADC1_INP10 (pin PC0) */
    /* ANALOG_IN4 = ADC1_INP19 (pin PA5) */

    adc1: adc@0 {
        status = "okay";
        channel@0 {
            reg = <0>;
            st,min-sample-time-ns = <10000>;  /* 10µs sampling time */
            label = "ANALOG_IN_1";
        };
        channel@1 {
            reg = <1>;
            st,min-sample-time-ns = <10000>;  /* 10µs sampling time */
            label = "ANALOG_IN_2";
        };
    };

    adc2: adc@100 {
        status = "okay";
        channel@10 {
            reg = <10>;
            st,min-sample-time-ns = <10000>;  /* 10µs sampling time */
            label = "ANALOG_IN_3";
        };
        channel@19 {
            reg = <19>;
            st,min-sample-time-ns = <10000>;  /* 10µs sampling time */
            label = "ANALOG_IN_4";
        };
    };
};

 

1 ACCEPTED SOLUTION

Accepted Solutions
LinuxAddict
Associate II

In case anyone else runs into these issues, I didn't understand that functioning ADC/IIO driver is silent in the kernel logs. It was actually working the whole time.

View solution in original post

4 REPLIES 4
Gregory PLANCHON
ST Employee

Hi @LinuxAddict ,

 

Have you checked the various wiki pages to see if you've missed anything? 

 

https://wiki.st.com/stm32mpu/wiki/ADC_device_tree_configuration

https://wiki.st.com/stm32mpu/wiki/ADC_OpenSTLinux_drivers

 

Regards,

Grégory

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Gregory,

Yes, thank you for the response.

I've consulted both of the wiki pages paying especially careful attention to the ADC device tree page to no avail.

Thanks,

-Adrian

Hi @LinuxAddict ,

 

Could you check these different points, please:

  • Are you sure about the pinctrl you indicated?
  • Are you sure your power supply is correct and properly configured?
  • Are you sure you're on the right channels? 

 

Regards,

Grégory

 

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
LinuxAddict
Associate II

In case anyone else runs into these issues, I didn't understand that functioning ADC/IIO driver is silent in the kernel logs. It was actually working the whole time.