Skip to main content
Visitor II
May 26, 2023
Question

VREFBUF is not working. It does not start the kernelmodule and the ADC values are the MAX_Values.

  • May 26, 2023
  • 3 replies
  • 1594 views

Hi I have problems with our custom board bringing up the VREFBUF. I eddited the devicetree as follows (also in U-Boot).

&vrefbuf{
	status = "okay";
	compatible = "st,stm32-vrefbuf";
	reg = <0x50025000 0x8>;
	regulator-min-microvolt = <2500000>;
	regulator-max-microvolt = <2500000>;
	clocks = <&rcc VREF>;
	vdda-supply = <&vdd>;
};

I also tried vdda-supply vdda. Did not change anything.

When i check through the kernel messages there is no sign that the VREFBUF module is started or any error concerning VREFBUF.

Also the VREFBUF is not working what is verified by the ADC Values.

We use the ADC only on the M4 Core.

The VREFBUFF can be activated from the M4 and the ADC is working fine.

What am I doing wrong?

I would be very grateful for some advice!.

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    May 26, 2023

    Hi @JSala.3​ ,

    is the

    vref-supply = <&vrefbuf>;

    present in the &m4_adc node ?

    See https://github.com/STMicroelectronics/linux/blob/v5.15-stm32mp/arch/arm/boot/dts/stm32mp157c-dk2-m4-examples.dts#L34

    Regards,

    JSala.3Author
    Visitor II
    May 26, 2023

    Hi :)

    yes it is.

    The adc node looks like this.

    &adc {
    	vdd-supply = <&vdd>;
    	vdda-supply = <&vdda>;
    	vref-supply = <&vrefbuf>;
    	status = "okay";
    	adc1: adc@0 {
    		st,min-sample-time-nsecs = <5000>;
    		st,adc-channels = <0 1>;
    		status = "okay";
    	};
     
    	adc2: adc@100 {
    		status = "okay";
    	};
     
    	adc_temp: temp {
    		status = "okay";
    	};
    };

    JSala.3Author
    Visitor II
    May 26, 2023

    Hi :)

    yes it is.

    The adc node looks like this.

    &adc {
    	vdd-supply = <&vdd>;
    	vdda-supply = <&vdda>;
    	vref-supply = <&vrefbuf>;
    	status = "okay";
    	adc1: adc@0 {
    		st,min-sample-time-nsecs = <5000>;
    		st,adc-channels = <0 1>;
    		status = "okay";
    	};
     
    	adc2: adc@100 {
    		status = "okay";
    	};
     
    	adc_temp: temp {
    		status = "okay";
    	};
    };

    Technical Moderator
    May 26, 2023

    Hi @JSala.3​ ,

    You mention that you use ADC only for M4 core, what look like you &m4_adc node ?

    Seems you are trying to enable same ADC on both Linux and M4, which is not allowed.

    Please have a look to https://wiki.st.com/stm32mpu/wiki/How_to_assign_an_internal_peripheral_to_a_runtime_context

    Regards.