AnsweredAssumed Answered

STM32CubeMX - SAI Code generation problem.

Question asked by paul-h on Dec 4, 2014
Latest reply on Jan 8, 2015 by STM32Cube-T

I am developing an application using the Serial Audio Interface of the STM32F429ZITx.

There appears to be a problem in the code generated by STM32CubeMX.
The DMA handle hdma_sai1_a is declared as a global variable in main.c.
The same variable name is declared as static within the scope of the function HAL_SAI_MspInit() in stm32f4xx_hal_msp.c.

The consequence of this is that the DMA2_Stream1_IRQHandler() function uses the incorrect un-initialised DMA handle and no transfer complete callbacks are invoked.

Workaround:
Remove definition of hdma_sai1_a from HAL_SAI_MspInit().
Add "extern DMA_HandleTypeDef hdma_sai1_a;" to  stm32f4xx_hal_msp.c.


Configuration:
MCU : STM32F429ZITx
STM32CubeMX : v4.5.0
STM32Cube FW : v1.3.0
Atollic TrueSTUDIO : v5.2.0

Outcomes