STMicroelectronics / stm32h7xx-hal-driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32H7 series.
BSD 3-Clause "New" or "Revised" License
98 stars 43 forks source link

HAL_DMA_Abort_IT leaves handle in aborted state #43

Closed drdott closed 10 months ago

drdott commented 10 months ago

There seems to be an inconsistency in the HAL_DMA_Abort_IT() function:

It almost looks like the tail end of the function has been included in the else block for the BDMA by mistake.

https://github.com/STMicroelectronics/stm32h7xx_hal_driver/blob/35582f63f1ab507e9d3e44e8e0db074fdb67752f/Src/stm32h7xx_hal_dma.c#L954C7-L954C7

drdott commented 10 months ago

I think this was a misunderstanding on my part and is not a bug after all.

I see now that disabling the DMA stream as part of the HAL_DMA_Abort_IT() call causes the Transfer Complete flag to be set in the Status Register. This then causes the DMA stream interrupt and the behaviour of HAL_DMA_IRQHandler() checks for the HAL_DMA_STATE_ABORT state in the handle and performs the appropriate cleanup (call abort callback, sets handle to HAL_DMA_STATE_READY, and unlocks the handle).

Sorry for wasting your time with this. Please feel free to close this issue.

TOUNSTM commented 10 months ago

Hello @drdott,

Thank you for your contribution. Regarding the point for which you opened the issue, as it is resolved, please allow me to close the issue.

With regards,