STM32C031C6T6 Multi channel ADC not working
Hello All, I am working on a raw STM32C031C6T6 directly soldered on a breakout board and trying to make a multi channel interrupt based ADC working but the problem i am facing is all the adc's are giving me the same values even after setting the separate channel for individuals and when i decided to use dma it stuck when continue dma request is enable and when its not dma just reads a single cycle.
below i have provided you the screenshot of my configuration and clock settings i have used as well as i am attaching my code which i have made for this.
any kind of help will be really appreciable.



__IO uint16_t counter=0,secCounter=0;
uint32_t uADCVal[4];
__IO uint8_t ADCflag=0;
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim){
if (htim->Instance == TIM3) {
counter++;
if (counter >= 500) {
counter=0;
secCounter++;
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
}
}
}
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hadc);
/* NOTE : This function should not be modified. When the callback is needed,
function HAL_ADC_ConvCpltCallback must be implemented in the user file.
*/
ADCflag=1;
}
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Configure the peripherals common clocks */
PeriphCommonClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_TIM3_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim3);
HAL_ADC_Start_IT(&hadc1);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
if (ADCflag) {
for (int var = 0; var < 4; var++) {
uADCVal[var] = HAL_ADC_GetValue(&hadc1);
}
ADCflag=0;
//HAL_ADC_Start_IT(&hadc1);
}
}
/* USER CODE END 3 */
}
