STM32 gotchas
311. ADC in "fully programmable sequencer mode" can't use all ADC channels (in 'G0/'C0/'U0/'U5)

ADCs in individual STM32 families vary a lot. However, all of them have a means to start a sequence of conversion, where the ADC will automatically go through a preselected set of input channels, and convert them all, consecutively. But the method, how these channels are selected, again, differs between the families.

In some families ('G0/'C0/'U0/'U5), the ADC has one 32-bit register for this purpose, ADC_CHSEL. This can be used in two ways, depending on ADC_CFGR1.CHSELRMOD setting. In the default setting, each bit in ADC_CHSEL is assigned to one channel, and if set, that given channel will be converted as part of the sequence. In this mode, there's no way to determine the order in which the channels are converted, and they are converted in their "natural" order.

In the other mode, which is called "fully configurable" or "fully programmable", ADC_CHSEL represents eight 4-bit bitfields. Values written to these bitfields correspond to numbers of channels which are going to be converted. This means, that the sequence consists of arbitrarily selected channels (even repeating), up to eight conversions per sequence.

As the bitfields are only 4-bits long, and the value of 0b1111 is reserved to be the "endmark" (thus determining the number of channels converted within one sequence), only channels ADCx_CH0..ADCx_CH14 can be converted in this "fully programmable" mode.