STM32H7 ADC3 over BDMA only writing to buffer once
I am working with a STM32H723 micro, capturing 2048 samples of data on ADC3. The ADC is triggered by the overflow of TIM1 and transfers samples successfully the first time HAL_ADC_Start_DMA(&hadc3, (uint32_t*)adc_buf, ADC_BUF_LEN); is called.
In the HAL_ADC_ConvCpltCallback function, the ADC is stopped and a flag is raised to indicate new data is ready for processing in the main loop.
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){
HAL_ADC_Stop_DMA(&hadc3);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
new_data = 1;
}
The data is processed in the main loop and at the end of the processing function, HAL_ADC_Start_DMA(&hadc3, (uint32_t*)adc_buf, ADC_BUF_LEN); is called again to restart the ADC.
The problem appears the next time the HAL_ADC_ConvCpltCallback fires. The data in the output buffer stays the same every loop after the first. The ADC is definitely running, as the callback fires regularly at the expected frequency, but the data is never updated.
The destination buffer is in the SRAM4 section as required for BDMA and the transfer does complete successfully, but only the once.
