stmhal: ADC class only uses ADC1 hardware
This issue appears not to be very minor for the pyboard or any board using 64- or 100-pin versions of the STM32F405, so it could be low-priority or 'won't fix'. However, I encountered this running MicroPython on an Olimex STM32-E407 dev board, which uses a 144-pin STM32F407. On this board, much of the GPIO from ports A, B, and C are connected to / utilized by on-board peripherals (like an Ethernet PHY). Most of the ADC input pins that are broken out to headers are on Port F, but those ADC pins are only connected internally to ADC3, so not accessible via the current ADC class:
>>> pf6 = pyb.ADC('PF6')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: pin F6 does not have ADC capabilities
>>>
Since I am already customizing the firmware a bit to get it running on the Olimex board, I think that I can solve my immediate problem by hacking a few lines in adc.c to use ADC3 instead of ADC1. I don't have a more generic solution yet, so I just wanted to raise the issue before I forgot about it.
The biggest potential benefit that I could see in enabling the ADC2 and ADC3 hardware for lower pin-count chips would be to enable high-speed interleaved ADC reads on those pins connected to all three instances, but it would take some serious recoding to allow this, for an application that may see relatively little use.
[STM32F7] ADC-DMA Sampling + Triple Interleaved Sampling
For my high performance data acquisition project I have successfully implemented ADC sampling with the DMA in both single and triple-interleaved modes (with STMCube HAL drivers), with ADC1 as master for STM32F7 MCUs. The code is integrated into adc.c and so it uses the same config routines as read_timed with some tweaks for the DMA and has been tested on the Pyboard D.
There are still a few issues to iron out such as exiting the DMA callbacks, and the code is not well integrated into Micropython yet, however if there is interest/demand for these sampling modes I would be more than happy to help to adapt this for implementation after my project is over.