STM32 gotchas
153. Internal temperature sensor, VREFINT and VBAT can't be part of a fast ADC sequence - in families, where ADC has a common sampling-length register

ADC is a module which varies between STM32 families quite a lot. It means, that nontrivial operations which may be relatively easy to accomplish on one STM32 family may be hard or impossible on other.

All ADCs have a couple of internal channels - internal temperature sensor, voltage reference VREFINT; and where available, measurement of voltage on the VBAT pin and/or some of the VLCD pins. These sources are of relatively high impedance and for proper operation they require a relatively long sampling time.

External ADC signal sources are usually of relatively low impedance and users often require high sampling rates, implying short sampling times.

The STM32 ADC enables to perform a sequence of conversions on various channels automatically. In most STM32 families, each channel in sequence can have assigned a sampling time individually. However, this is not the case of of the 'F0 and 'L0 family, where there is only a single register for the sampling time, and all channels in a sequence use the same sampling time. This prevents converting "slow" channels such as the internal signal sources, and "fast" external signal sources, in a single sequence.

The 'G0 and 'C0 families solve this particular issue in yet another fashion: there are two registers for sampling times available, and a single bit for each channel, selecting one of the two sampling times. Thus, mixing "slow" and "fast" channels in a sequence is possible in these families, to a certain degree.