Skip to main content
Associate II
Jul 27, 2026 11:08 AM UTC
Question

STM32U545 ADC Non-linear Problem

Hi ST,

I found a problem of fixed-range local ADC non-linearity from 170mV to 480mV on STM32U545 after full hardware linear calibration.

1. Test Environment

HW: NUCLEO-U545RE-Q board (MB1841D), 

Firmware package: STM32CubeU5 FW V1.8.0.

Test instruments: Precision DC power supply, function signal generator, digital oscilloscope (used to verify the actual voltage at ADC input pins).

Working Mode: Button→ LPTimer→ ADC→ DMA→ UART

MX: See attachment

Main code: See attachment

2. Two types of input tests (static DC + dynamic triangle wave, identical distortion observed)

(1) Static DC step voltage test

We applied stepped DC voltage from 81mV to 850mV via precision power supply and resistor voltage divider. The real voltage on ADC1 input pins was measured and recorded with an oscilloscope for every step, ruling out inaccuracies from signal sources or resistor division. Test results: ADC1 conversion curve is perfectly linear below 170mV and above 480mV. A consistent concave distortion only exists within 170mV ~ 480mV. This error occurs on both ADC1 and ADC4 (maybe not same error range in ADC4), under single-ended and differential input modes.

(2) Dynamic triangle wave test

Slow triangle wave generated by function generator was fed into ADC for continuous sampling. In ADC1, The same concave distortion appears whenever the waveform sweeps across 170mV~480mV. The shape and position of non-linearity are exactly the same as DC measurement results. This confirms the error originates from the ADC internal core itself, not input signal dynamic characteristics. for ADC4, there is still a non-linear with different shape.

3. Interference factors all verified and excluded

  1. I used HAL_ADCEx_Calibration_Start(&hADC, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED); to calibrate, but with no effect.
  2. ADC sampling time was adjusted from 5 cycles up to 36 cycles; no change to the non-linear curve.
  3. We tested with only ADC1 enabled (ADC4 clock and peripherals fully disabled), so crosstalk between two ADC modules is not the root cause.
  4. Control test on STM32H750 with identical circuit and ADC configuration, delivers excellent linearity across the full 0~3.3V range without such local distortion.

17 replies

unsigned_char_array
Lead III
Jul 27, 2026 12:29 PM UTC

What is the output impedance of the voltage divider?
Using a buffer or at least a capacitor on the output helps lower the output impedance. 
This might solve some non-linearity.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
Associate II
Jul 28, 2026 1:20 AM UTC

The real voltage on ADC1 input pins was measured and recorded with an oscilloscope for every step

Though the input is divided by resistor, but the input I record is measured from ADC pin by oscilloscope, and the input is DC. Dose the output impedance still matter?

MasterT
Lead II
Jul 28, 2026 2:29 AM UTC

Impedance is very important, since SAR ADC is switching capacitor load. Doesn’t matter if DC or AC, internal sample and hold capacitor generates “spike”, and it’s easy to observe with properly adjusted o-scope. 

 Options: buffering voltage divider by fast OP-AMP, or simply put a capacitor 0.1uF in parallel to inputs - for low sampling rate.

Ozone
Principal
Jul 27, 2026 12:37 PM UTC

Have you tried another Nucleo board ?

Have you tried different sample times ?

Associate II
Jul 28, 2026 1:26 AM UTC

I don’t have another board or another chip. not sure if this is a single problem. Even it is, since it happens this time, will it be a risk?

I have tried different sample time from 5 cycles to 36 cycles, and I think the sample time is not very important in DC input condition. And I also tried different sample rate for triangle signal, I set 100kHz timer to sample 10k signal, 10kHz sample rate for 1k signal, the problem is the same.

AScha.3
Super User
Jul 28, 2026 7:27 AM UTC

So try measurement -as recommended- with an 100 nF cer.cap direct at the ADC input to GND.

And show result , triangle signal.

If you feel a post has answered your question, please click on " Best Answer ".
Associate II
Jul 29, 2026 5:57 AM UTC

 @MasterT ​@unsigned_char_array  ​@Ozone ​@AScha.3 

Hi guys, thank you for your replies. I @ you because I might make wrong conclusion before. I thought it was impedance problem, but it is not. I tried with DC power supply as input directly, no resistor divider this time. but the non-linear still exists.

I also tried to put the integrated OPA of U545 in serial between signal and ADC, it can’t solve the problem either.

For now, I think the impedance is not the key. Only the sampling time higher than 391.5cycles can solve the problem,  68cycles has its effect but not enough. there are no choices between 68 and 391, the sample rate is not enough under 391. this is not suitable for me.

I asked AI, not sure if it is right. it says:

“Low-density STM32U535/U545 integrate a 14-bit segmented SAR ADC with bridge-capacitor CDAC. The capacitor array is divided into separate MSB and LSB sections connected via one bridge capacitor to save silicon area and lower leakage. Layout mismatch of the bridge capacitor plus switch parasitics create local non-linearity, most obvious in the 170 mV ~ 480 mV input range, where both capacitor segments work jointly and charge coupling heavily relies on the bridge capacitor. Since this phenomenon arises inside the ADC, low-impedance drive or input capacitors on the PCB cannot resolve the distortion.

When sampling time is short, residual charge imbalance between internal capacitors cannot settle fully after the sampling switch closes, generating conversion error. If we extend sampling time long enough, complete charge redistribution across all internal nodes is achieved, and the non-linear distortion fades out.”

I cancelled the best answer to make this topic open. I will continue updating it here.

AScha.3
Super User
Jul 29, 2026 7:21 AM UTC

​@oldplaychild ,

so this nonlinearity is a defect of the 14-bit converter in U series; could you proof with a simple measurement , with low input impedance or cap o input, on ADC4 (12bit , different architecture) that there is no such problem ?

+

>Layout mismatch of the bridge capacitor plus switch parasitics create local non-linearity, most obvious in the 170 mV ~ 480 mV input range, where both capacitor segments work jointly and charge coupling heavily relies on the bridge capacitor.

<   

Seems the problem should be away or smaller , if ADC clk is slower; so try using a lower clock for the ADC , set prescaler →

and use medium sampling time, try 12 cycles. So effective sample rate is still fast enough.

The nonlinearity should disappear at lower internal ADC clock.

+

So using the differential input mode should improve this, could you try it on ADC1 ?

If you feel a post has answered your question, please click on " Best Answer ".
Associate II
Jul 30, 2026 1:31 AM UTC

On ADC4 there is also this problem with 50ohm signal generator, not sure if it still exists with power supply directly, I will try later.

About the clock, it is a good idea, we may be able to find a balance between clock and sampling time, to achieve best sample rate without nonlinear.

Associate II
Jul 30, 2026 1:58 AM UTC

I replaced the u545 with u585, there is no such problem. 

AI says u585/75 has better architecture than u545/35. Though they have same segmented SAR ADC with bridge-capacitor CDAC, 85/75 will have better performance.

I don’t have another u545 chip so it is not sure if this problem is a single one or it is a problem of u545 series.

Visitor II
Nov 4, 2026 6:11 AM UTC

​@oldplaychild 

I hit exactly the same thing on another board, and since I could sweep the sampling time inside one firmware I can add some numbers that may help ST pin it down.

 

**Hardware / software**

- NUCLEO-U545RE-Q (MB1841 rev D), STM32U545RET6Q, package marking below:

 

STM32U545

RET6QU

GQ 2D6 9R 16

CHN GQ 328

Z

 

, DBGMCU_IDCODE = 0x10016455 (DEV_ID 0x455, REV_ID 0x1001 = revision Z per RM0456 §75.12.4).

- STM32CubeMX 6.18.1, STM32Cube FW_U5 V1.9.0 (HAL 1.6.3). VDD = VDDA = VREF+ = 3.3 V, SMPS supply.

- ADC1 channel 1 (PC0), single-ended, 14-bit, fADC = 12 MHz (MSIK, async prescaler ÷1), TIM6 trigger at 10.02 kHz, GPDMA to RAM. Run mode during the conversions.

- Signal: 61 Hz sine, 0.005–3.28 V, from a generator through an AD8613 voltage follower and 470 Ω + 100 nF at the pin. A scope on PC0 (20 mV/div) shows a clean trough down to a few mV, so the pin voltage itself is fine.

 

**Symptom (Figure 1, red curve)**

- For pin voltages between 0.09 V and 0.46 V the reading sits at 0.40–0.44 V (code ≈ 2048 at 14 bits), max error +230 mV at 0.16 V input.

- Below 0.09 V and above 0.46 V the reading is exact (±2 mV from a sine fit).

- Identical on falling and rising slopes, i.e. static, no hysteresis. Same shape at other signal frequencies.

 

**No effect**: `ADC_CALIB_OFFSET_LINEARITY` instead of offset-only calibration, `HAL_PWREx_EnableVddA()` (PWR_SVMCR.ASV), low-frequency trigger mode (ADC_CFGR2.LFTRIG), bulb sampling mode (ADC_CFGR2.BULB), hardware oversampling on/off. Each was tested by cycling configurations per button press in the same firmware.

 

**Only the absolute sampling time matters (Figures 2 and 3)**

 

Sampling time @ 12 MHz Max error, 0.1–0.46 V inputs
5 cycles (0.42 µs) +231 mV
68 cycles (5.7 µs) +74 mV
391 cycles (32.6 µs) +6 mV
814 cycles (67.8 µs) +4mV

 

 

The error follows E0·exp(−tS/τ) with τ ≈ 4.6 µs. With CADC = 5 pF that is about 1 MΩ in series with the sampling capacitor, but only while the input is in the 0.1–0.46 V band. To me it looks like an input switch/multiplexer that is only partially on in that voltage range, so the sample capacitor cannot settle within the datasheet sampling times (Table 106 lists 142–170 ns for 14-bit).

 

**Workaround we adopted**: 391 cycles at 12 MHz (≥ 5 τ) with ×2 oversampling at 10 kHz. A full-scale 61 Hz sine then fits a sinusoid with 1.8 mV rms residual (signal source included) and +6 mV max deviation in the band. ADC supply current does not depend on the sampling time (261 µA at 5 or 814 cycles ×1, 269 µA at 391 cycles ×2, 10 ksps), so the workaround only costs conversion time. 814 cycles is not needed.

 

Raw data for all six runs (800 samples each, with the sine-fit reference) are attached as CSV.

 

**Questions for ST**

1. Is this a known limitation of the STM32U535/U545 ADC1? Our device is revision Z (REV_ID 0x1001). PCN14484 mentions a die change Z → Y that fixes limitations (ES0587): does revision Y still show this?

2. oldplaychild found that a U585 on the same board does not show it. Is the ADC1 input switch / multiplexer different between U545 and U575/U585?

3. Is there a documented minimum sampling time for inputs below ~0.5 V on this device, or any other register setting (booster, ANASWVDD, …) that removes it?

 

Happy to run further tests.

 

 

waclawek.jan
Super User
Nov 4, 2026 8:19 AM UTC

​@oldplaychild , ​@kokkokoooko ,

I don’t say this is the reason, but how is VREF+ connected/VREFBUF treated?

JW

Visitor II
Nov 4, 2026 11:15 AM UTC

​@waclawek.jan 

 here is how it is on our board:

  • The STM32U545RET6Q is the LQFP64 package, which has no separate VREF+ / VREF- pins: they are double-bonded to VDDA (pin 13) and VSSA (pin 12) inside the package. The datasheet says that in this case the internal VREFBUF is not available and must be kept disabled.
  • VREFBUF is untouched by the firmware, i.e. in its reset state (ENVR = 0, output high-impedance). No HAL_SYSCFG_VREFBUF_* calls.
  • VDDA comes straight from the Nucleo's 3.3 V LDO; measured 3.314 V at the CN6 3V3 pin. The ADC agrees: converting the internal VREFINT channel with the same settings and using VREFINT_CAL gives VDDA = 3.319 V (+0.15 %).
  • Reference noise does not look like the cause either: the VREFINT channel reads with 0.21 mV rms (2.07 LSB at 15 bits, 391-cycle sampling, x2 oversampling), which is what the datasheet ENOB implies. And the non-linearity is cured by sampling time alone with an exponential dependence (tau ~ 4.6 us); a reference problem would not behave like that.

So VREF+ = VDDA = 3.3 V, no buffer, and the effect is on the input side.

waclawek.jan
Super User
Nov 4, 2026 3:36 PM UTC

> a reference problem would not behave like that.

The reference source  sees a pulsed consumption in the rhythm of conversions, too, so if it is of inadequate impedance there are sometimes similar sampling-frequency-dependent effects; their exact nature depends on the details of implementation which we of course don’t know. We’ve seen such here in the past.

But I agree it’s not the case here.

JW