Skip to content

Commit d43dcec

Browse files
committed
fix(u0): VREFINT_CAL value is not programmed during production
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 2e82ca1 commit d43dcec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/Peripherals/ADC/Internal_channels/Internal_channels.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ void setup() {
5454

5555
static int32_t readVref()
5656
{
57+
#ifdef STM32U0xx
58+
/* On some devices Internal voltage reference calibration value not programmed
59+
during production and return 0xFFFF. See errata sheet. */
60+
if ((uint32_t)(*VREFINT_CAL_ADDR) == 0xFFFF) {
61+
return 3300U;
62+
}
63+
#endif
5764
#ifdef __LL_ADC_CALC_VREFANALOG_VOLTAGE
5865
#ifdef STM32U5xx
5966
return (__LL_ADC_CALC_VREFANALOG_VOLTAGE(ADC1, analogRead(AVREF), LL_ADC_RESOLUTION));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy