[PATCH] board: stm32pm1: Fix board_check_usb_power()
Kory Maincent
kory.maincent at bootlin.com
Tue Apr 14 11:17:41 CEST 2026
On Tue, 14 Apr 2026 11:06:50 +0200
Patrice Chotard <patrice.chotard at foss.st.com> wrote:
> Depending of plugged power source (computer, wall charger, ...) it can
> happen that we got the following message:
>
> "****************************************************"
> "* USB TYPE-C charger not compliant with *"
> "* specification *"
> "****************************************************"
> " "
> "### ERROR ### Please RESET the board ### "
>
> This issue has been detected on STM32MP135f-DK board.
>
> It's due to max_uV and min_uV value are initialized at beginning of
> board_check_usb_power() and can then be used for the 2 iteration of
> adc_measurement().
> max_uV/min_uV values issued of the first adc_measurement() iteration
> are used as input of the second adc_measurement() iteration, which
> can lead to incoherent pair of min_uV/max_uV values.
>
> To ensure that adc_measurement() returns coherent value for max_uV and
> min_uV, initialize max_uV and min_uV at each loop start.
>
> Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
Reviewed-by: Kory Maincent <kory.maincent at bootlin.com>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
More information about the U-Boot
mailing list