2024-02-23 12:01 PM
We are using STM32MP157F in our board, running OSD32MP1 Debian SDK v3.0 (Linux Kernel v5.10-stm32mp).
In our board VDDA pin is connected to LDO5 at 3.3V
VREF+ and VREF- pins are connected to VSSA.
We cannot supply external VREF for ADC due to hardware limitation, we are trying to use internal VREFBUF.
We've made following updates in kernel device tree to enable VREFBUF in internal voltage reference mode.
&adc {
vdd-supply = <&vdd>;
vdda-supply = <&v3v3_eth>;
vref-supply = <&vrefbuf>;
status = "okay";
adc1: adc@0 {
st,min-sample-time-nsecs = <5000>;
st,adc-channels = <0 1>;
status = "okay";
};
};
&vrefbuf {
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
status = "okay";
};
Its not working and adc probe function is failing with timeout while waiting for the VRR bit in the VREFBUF CSR register (stm32_vrefbuf_enable)
We get following debug messages
# dmesg | grep -i adc
[ 14.637788] stm32-adc-core 48003000.adc: vref enable failed (-110)
[ 14.711898] stm32-adc-core: probe of 48003000.adc failed with error -110
# dmesg | grep -i vrefbuf
[ 14.633600] regulator regulator.5: stm32 vrefbuf timed out!
Any help or suggestion to enable VREFBUF is much appreciated.
Thanks.
/Farid
2024-02-26 12:19 AM
Hi @farid
unfortunately, connecting VREF+ to VSS is a big mistake, avoiding to use neither VREFBUF (which output on VREF+ pin) or an external VREF+ reference. This make ADC not usable on your board.
Error message is likely because as VREFBUF output is short-circuit to VSS, it will never give a 'ready' information to the SW.
VREF+ always need external decoupling, whatever provided externally (e.g. = VDDA) or internally from VREFBUF.
Please have a look to examples in AN5031, STM32MP157F-EV1 board (external VREF+ example) or STM32MP157F-DK2 board (VREFBUF example).
No workaround possible unless you are able to change VREF+ connection on your board.
Regards.