STMicroelectronics / STM32CubeF4

STM32Cube MCU Full Package for the STM32F4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
827 stars 409 forks source link

STM32F4 SAI using DMA will not trigger an interrupt #124

Closed fyyxxm closed 1 year ago

fyyxxm commented 2 years ago

MCU:stm32f427 STM32CUBEMX : 6.5 HAL lib:1.27

Issue: Using the SAI project generated by stm32cubemx, DMA will not trigger interrupt clock dma config

In the initialization process, SAI is initialized first, and then DMA is initialized, which can trigger an interrupt. However, it will only be triggered once. If you want to continue the transmission, you must use it again: HAL_SAI_Transmit_DMA

Before change:

int main(void)
{
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  MX_GPIO_Init();

>   MX_DMA_Init();
>   MX_SAI1_Init();

  HAL_SAI_Transmit_DMA(&hsai_BlockA1, test_buff, 1024);

  while (1)
  {
    HAL_Delay(500);
  }
}

After change:

int main(void)
{
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  MX_GPIO_Init();

>   MX_SAI1_Init();
>   MX_DMA_Init();

  HAL_SAI_Transmit_DMA(&hsai_BlockA1, test_buff, 1024);

  while (1)
  {
    HAL_Delay(500);
  }
}

Since my DMA transfer mode is set to hdma_ sai1_ a.Init. Mode = DMA_ CIRCULAR; f4_dma

the interrupt should be triggered all the time, not only once, unless I turn off DMA transfer

Stm32h7 series will not have this problem。

ASELSTM commented 2 years ago

Hi @fyyxxm,

Would you please share the whole project you have used to reproduce the issue in order to allow a better analysis of the problem.

With regards,

ASELSTM commented 1 year ago

Hi @fyyxxm,

Please allow me to close this thread as no activity. You may reopen it at anytime if you have any details to share with us in order to help you to solve the issue. Thank you for your comprehension.

With regards,