2026-04-01 12:02 AM - last edited on 2026-04-01 4:33 AM by mƎALLEm
Hello,
I am working on STM32 NUCLEO-G431RB using STM32CubeIDE and FreeRTOS (CMSIS-RTOS v2).
I am trying to implement the following requirement:
Expected Behavior:
Example:
7 Channels:
Configuration:
Expected Behavior:
If I connect external voltage to PA1
Similarly, if I connect external voltage to any ADC pin, only that pin should show voltage and others should show 0.
I am using:
Board: STM32 NUCLEO-G431RB
IDE: STM32CubeIDE
RTOS: FreeRTOS (CMSIS-RTOS v2)
External Power Supply: 0-3.3V analog input
Any suggestions or recommended approach would be very helpful.
Thank you.
2026-04-01 12:22 AM
Yes, using ADC1 (interrupt) + ADC2 (DMA) simultaneously is valid on STM32G431RB, but ensure both ADCs are properly clocked and not sharing conflicting resources. With FreeRTOS, it’s recommended to rely more on DMA (even for single channel) and use callbacks + queues instead of mixing interrupt-heavy logic for better stability and timing consistency.
2026-04-01 12:34 AM
Yes, understood. Could you please guide me on the required configuration in STM32CubeMX for using ADC1 with Interrupt and ADC2 with DMA simultaneously on STM32G431RB?
Also, could you please share a reference example or sample code for both CubeMX configuration and IDE implementation (HAL code with callbacks/queues if using FreeRTOS)?
This will help me ensure that both ADCs are properly clocked and no resources are conflicting while implementing the solution.
2026-04-01 9:11 AM
Hello @AnnapoornaMV
Please refer to the examples below:
STM32CubeL4/Projects/NUCLEO-L452RE/Examples/ADC at master · STMicroelectronics/STM32CubeL4 · GitHub