[Uboot-stm32] [PATCH] board: stm32pm1: Fix board_check_usb_power()

Patrice CHOTARD patrice.chotard at foss.st.com
Thu Apr 30 08:58:50 CEST 2026



On 4/29/26 11:12, Raphaël Gallais-Pou wrote:
> 
> 
> On 4/14/26 11:06, Patrice Chotard 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>
>> ---
> 
> Hi Patrice,
> 
> Reviewed-by: Raphaël Gallais-Pou <rgallaispou at gmail.com>
> 
> Best regards,
> Raph
> 
Applied to u-boot-stm32/master

Thanks
Patrice


More information about the U-Boot mailing list