If you want to configure multiple ADC channels with STM32CubeMX, and use them without interrupts/DMA, you will meet this bug.
By some reason you cannot configure HAL to read only one channel from multiple configured. You only can ADD or REMOVE channels from list.
In adc.c you will find working code snippet
- Create with CubeMX your configuration.
- Use snippet for reading that channel that you need when you need, not random channel from configured list.
- ...
- Profit!