Skip to main content
Caraffa
Associate II
July 9, 2022
Solved

How can i use Half-Complete and Complete DMA Callbacks with timer in PWM mode?

  • July 9, 2022
  • 1 reply
  • 11977 views

Hi,

I've set up timer in PWM mode with circular DMA in CubeIDE.

I would like to change buffer with halfcplt and cplt callbacks but i have no idea how to do that. I can't find any example on internet neither in documentation.

Should i somehow register those callbacks or maybe there are some weak void functions that i can't find?

I would be very thankful for any code example.

Edit: I'm using stm32f407vg

This topic has been closed for replies.

1 reply

MM..1
Chief III
July 9, 2022

I mean exist , for example i use ADC DMA, but you need add to code manualy

// Called when first half of buffer is filled
void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc) {
 
// PWR_LED_GPIO_Port->BSRR = PWR_LED_Pin;
 
}
// Called when buffer is completely filled
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) {
 
// HAL_GPIO_WritePin(PWR_LED_GPIO_Port, PWR_LED_Pin, GPIO_PIN_RESET);
}

try search CpltCallback.

Caraffa
CaraffaAuthor
Associate II
July 9, 2022

I've seen callback for ADC and UART several times on google but i can't find such just for timer in pwm mode

MM..1
MM..1Best answer
Chief III
July 9, 2022