cancel
Showing results for 
Search instead for 
Did you mean: 

XferCpltCallback member in DMA_HandleTypeDef

HermannKleier
Associate II
Posted on September 02, 2016 at 14:03

The documentation (DOCID027704 Rev 5) states

At the end of data transfer HAL_DMA_IRQHandler() function is executed and user can add his own function by customization of function pointer XferCpltCallback and XferErrorCallback (i.e. a member of DMA handle structure).

 

I have used this feature for the STM32L0xx but it does not work for STM32L4xx any longer. This is because

HAL_DMA_init()

zeroes the pointers. I am aware that I can still override the

weak

callback handlers. Are the callback pointers zeroed on purpose and is the documentation outdated? Is the use of 

DMA_HandleTypeDef

for setting callback pointers deprecated?

#hal-dma_handletypedef-callback
2 REPLIES 2
Walid FTITI_O
Senior II
Posted on September 09, 2016 at 13:49

Hi kleier.hermann,

Maybe you have not correctly configured that. As a response for you questions, I recommend that you check the DMA example inside the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubel0.html

''DMA_FlashToRAM'' where the complete and error callbacks are configured and used. The example is at this path: STM32Cube_FW_L0_V1.7.0\Projects\STM32L073Z_EVAL\Examples\DMA\DMA_FLASHToRAM

-Hannibal-

HermannKleier
Associate II
Posted on September 11, 2016 at 22:54

Exactly. The example (and five other similar examples) in the

STM32Cube_FW_L0_V1.7.0 package show how

DmaHandle.XferCpltCallback

can be used to redirect the callback to a local function. The examples have been there in V 1.6.0 too. And this is what I meant when I wrote “I have used this feature for the STM32L0xx�.

Alas, there are no such examples in the STM32Cube_FW_L4_V1.5.0

tree. And though it is still documented there, it does not work for

the STM32L4 package. Is this a bug? Has it been deprecated?

Hermann Kleier