cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743ZI adc + bdma no callbacks

ddelafuente
Associate

Hello every body,

 

It is my first post and I´m newvy with this tecnology. I'm trying to read from adc 1, 2 and 3 values from the DMA (in case of use adc 1 and 2) and the BDMA (case adc3). In the two first cases, the interrupts are generated correctly and I detect the fill of the half and full DMA using the callbacks HAL_ADC_ConvHalfCpltCallback and HAL_ADC_ConvCpltCallback.

 

The problem comes when I try to reproduce the same behaviour with the adc 3. I've configured the adc3 in the same way of the others one. Besides, I've initialized the bdma in the same way but the callbacks never are called.

 

I've created a new project only to test the adc3+bdma and the configuration of the adc is described in the following picture:

Captura.PNGCaptura1.PNGCaptura2.PNG

 

and the source code is the following (is very basic):

 

 

int main(void) {

 

HAL_Init();

SystemClock_Config();

MX_GPIO_Init();

MX_BDMA_Init();

MX_USB_OTG_FS_PCD_Init();

MX_ADC3_Init();

 

/* USER CODE BEGIN 2 */

HAL_ADC_MspInit(&hadc3);

HAL_ADC_Start_DMA(&hadc3, adc3_data, 10);

 

while (1)

{

}

}

 

void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef *hadc)

{

if (hadc == &hadc3)

{

// Operaciones adicionales después de que se complete la conversión de ADC3

}

}

 

void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)

{

if (hadc == &hadc3)

{

// Operaciones adicionales después de que se complete la conversión de ADC3

}

}

 

void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc)

{

if (hadc == &hadc3)

{

// Manejar el error de ADC3

}

}

 

 

Any ideas?? Some thing wrong?

Thank in advance

2 REPLIES 2
ddelafuente
Associate

In order to provide more information, I can read ADC3 values perfectly. The main problem is the connection with the BDMA. 

Sarra.S
ST Employee

Hello @ddelafuente

Please note that the BDMA controller is located in the D3 domain and can access only SRAM4 and backup SRAM in the D3 domain, so you need to declare the destination buffer in SRAM4 for the ADC DMA transfer  (Please check RM to know where SRAM4 is mapped) 

and then you can either use the linker script to declare the buffer in SRAM4 or you can insert the SRAM4 addresses manually in the stm32h743xx_flash.icf file generated by CubeMX. 

Also check this knowledge article : DMA is not working on STM32H7 devices

Hope that helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.