2025-09-02 4:59 PM
I'm looking for an example to use as the starting point for a sensor data collector. In particular, an STM32F401 ADC_MultichannelSingleConversion with DMA and software start. I found an example for the F11 that is based on the LL SDK. I then created an F401 project using ADC with DMA and set the code generator to utilize the LL SDK for those components. I then compared the 'stm32f4xx_it' source and header files and found them substantially different. So much so, in fact, that I'm unsure how to proceed. The F11 example does not have an IOC file, so I cannot view its configuration settings. The code generated from my IOC file features very nice blocks that delineate where user code should be placed, and I want to utilize this feature to avoid conflicts with the code generator as I add other system components.
The same applies to the 'main' source and header files. If there's a better example to use as a starting point, or some guidance for merging the example code into a STM32Cube project, it would be really appreciated.
Solved! Go to Solution.
2025-09-03 5:14 PM
Thanks for the suggestion. I opened the ADC_MultiChannelSingleConversion example for the STM32C031C6Tx MCU it looks significantly different from the F401 I'm using. The ADC register maps are not at all aligned.
Not being very familiar with ST MCUs, I didn't understand how the peripherals are aligned in within the different families. I found there is an example for the F411, whose ADC register map looks the same as the F401. That example, also called ADC_MultiChannelSingleConversion, is for the NUCLEO-F411RE board and uses DMA with a conversion cycle triggered by a push button. I think I can adapt that easily enough to my current project.
2025-09-02 6:18 PM
Not sure if you're looking for LL or HAL examples?
If you're looking for HAL examples, look at some ADC_MultiChannelSingleConversion examples for maybe a STM32C0xx. The configuration should be pretty close with maybe more or less settings to configure.
2025-09-03 5:14 PM
Thanks for the suggestion. I opened the ADC_MultiChannelSingleConversion example for the STM32C031C6Tx MCU it looks significantly different from the F401 I'm using. The ADC register maps are not at all aligned.
Not being very familiar with ST MCUs, I didn't understand how the peripherals are aligned in within the different families. I found there is an example for the F411, whose ADC register map looks the same as the F401. That example, also called ADC_MultiChannelSingleConversion, is for the NUCLEO-F411RE board and uses DMA with a conversion cycle triggered by a push button. I think I can adapt that easily enough to my current project.
2025-09-03 9:23 PM
You don't have to worry about the register maps. Using ST's ADC init data structure will set the registers correctly.
Majority of the ADC is the same between the two shown in the red box.
The C031 has some extra stuff in the blue box, which half are disabled. Just matching what's in the red box should get your going. You just have to choose the sampling time which are in the Ranks for the F401.