STM32H7 DMA2 wont trigger interrupt
Using STM32H743ZI
I am using SPI1 in 2 lines Rx only mode with DMA2 Stream 2 as in ST example
I use Rx DMA with a buffer located in D2 RAM. Using debugger I found that the first reception works well, data gets written into my buffer. But my DMA doesn't fire any interrupt, so the next transfers do not work.
Here is my init code :
hdma_spi1_rx.Instance = DMA2_Stream2;
hdma_spi1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
hdma_spi1_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
hdma_spi1_rx.Init.MemBurst = DMA_MBURST_INC4;
hdma_spi1_rx.Init.PeriphBurst = DMA_PBURST_INC4;
hdma_spi1_rx.Init.Request = DMA_REQUEST_SPI1_RX;
hdma_spi1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_spi1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_spi1_rx.Init.MemInc = DMA_MINC_ENABLE;
hdma_spi1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_spi1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_spi1_rx.Init.Mode = DMA_NORMAL;
hdma_spi1_rx.Init.Priority = DMA_PRIORITY_HIGH;
if (HAL_DMA_Init(&hdma_spi1_rx) != HAL_OK)
{
Error_Handler();
}
__HAL_LINKDMA(hspi,hdmarx,hdma_spi1_rx);
/* SPI1 interrupt Init */
__HAL_SPI_ENABLE_IT(hspi, SPI_IT_RXNE) ;
/* USER CODE BEGIN SPI1_MspInit 1 */
HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn);
HAL_NVIC_SetPriority(SPI1_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(SPI1_IRQn);Any idea why my DMA2 peripheral wont trigger interrupt ?