ADC Multichannel - DMA on STM32U545
Good afternoon,
I have some questions for reading multiple channels of the ADC in continuous mode and map the results in the DMA.
I have been able to monitor the voltage coming from a potentiometer and map it into the DMA and i can see the values in the "Live expression window". For doing so i have had to creater an ADCQueue and an ADCNode for the channel I am monitoring.
Now, the problem arises when i try to monitor multiple channels. Do i have to create as many Queues and Nodes as channels i have? Do i have to create as many buffers as channels i have and therefore all the links?
Find attached the part of the code where I declare the buffers:
/* USER CODE BEGIN 0 */
#define ADC_CONVERTED_DATA_BUFFER_SIZE ((uint32_t) 32)
uint32_t aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE];
uint32_t secondVariable[ADC_CONVERTED_DATA_BUFFER_SIZE];
/* USER CODE END 0 */
MX_ADCQueue_Config();
__HAL_LINKDMA(&hadc4, DMA_Handle, handle_GPDMA1_Channel10);
if (HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel10, &ADCQueue) != HAL_OK)
{
Error_Handler();
}
if (HAL_ADC_Start_DMA(&hadc4, (uint32_t *)aADCxConvertedData, (ADC_CONVERTED_DATA_BUFFER_SIZE) ) != HAL_OK)
{
Error_Handler();
}