Hi!
I'm trying to convert 4 ADC channels with interrupt and DMA on my STM32 dev board (nucleo F303RE) the goal is to start a conversion periodically and transfer the results through the DMA. But unfortunately, it doesn't work
Here is the configuration, I use STM32CubeIDE.
ADC Conf



TIM4 Conf

And here my code
/* USER CODE BEGIN PV */
uint16_t raw[4];
uint8_t ADDCPLT = 0;
/* USER CODE END PV */
/* USER CODE BEGIN 2 */
HAL_ADC_Start_DMA(&hadc1, (uint16_t)*raw, 4);
HAL_TIM_Base_Start_IT(&htim4);
/* USER CODE END 2 */
main loop
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
if(ADDCPLT)
{
HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
ADDCPLT = 0;
}
}
/* USER CODE END 3 */
/* USER CODE BEGIN 4 */
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
if(hadc->Instance == ADC1)
{
ADDCPLT = 255;
}
}
/* USER CODE END 4 */
When I start the program on the target, I see LD2 blinking at ~10Hz as expected, but I don't see anything in raw[4] variables. (checked with STM32CubeIDE integrated debugger) I think I forgot something somewhere... Do you have any ideas?
Thanks