Question
DMA interrupts don't work
Microcontroller STM32F401. The DMA controller transfers data from memory to the DR register of the SPI interface. With the HTIE and TCIE bits set, DMA is not included in the interrupt handler. At the end of the data array transfer, the program freezes, there is no interruption in half of the packet, and DMA is not included in the void DMA2_Stream5_IRQHandler(void) function.
Initializing DMA:
void DMA2_Init(void) {
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2EN;
DMA2_Stream5->M0AR |= (uint32_t)(&data);
DMA2_Stream5->PAR |= (uint32_t)(&SPI1->DR);
DMA2_Stream5->NDTR = 57600;
DMA2_Stream5->CR |= DMA_SxCR_MSIZE_0;
DMA2_Stream5->CR |= DMA_SxCR_PSIZE_0;
DMA2_Stream5->CR |= DMA_SxCR_CHSEL_1 |
DMA_SxCR_CHSEL_0;
DMA2_Stream5->CR |= DMA_SxCR_DIR_0;
DMA2_Stream5->CR |= DMA_SxCR_TCIE;
DMA2_Stream5->CR |= DMA_SxCR_HTIE;
NVIC_EnableIRQ(DMA2_Stream5_IRQn);
DMA2_Stream5->CR |= DMA_SxCR_EN;
}Interrupt Handler:
void DMA2_Stream5_IRQHandler(void) {
...
}