At a glance, you are perhaps a little confused about which interrupts to use for DMA.
First off, I would recommend to send stuff through spi using dma without any interrupts and go from there.
Something like this...although its for L051 so maybe some small differences.
static void dma_mem2spi(uint8_t *pBuf, uint32_t length) {
RCC->AHBENR |= RCC_AHBENR_DMA1EN; /* enable dma subsystem clock */
DMA1_Channel3->CCR &= ~DMA_CCR_EN;
DMA1_CSELR->CSELR &= ~DMA_CSELR_C3S;
DMA1_CSELR->CSELR |= 0b0001 << DMA_CSELR_C3S_Pos; /* select SPI1_TX for dma chan3 */
DMA1_Channel3->CPAR = (uint32_t)(&(SPI1->DR)); /* peripheral address */
DMA1_Channel3->CMAR = (uint32_t)pBuf; /* memory address */
DMA1_Channel3->CNDTR = length;
DMA1_Channel3->CCR = DMA_CCR_DIR /*DIR=1 mem2periph*/ ;
DMA1_Channel3->CCR |= DMA_CCR_MINC /*mem inc*/;
DMA1->IFCR = DMA_ISR_TCIF3;
DMA1_Channel3->CCR |= DMA_CCR_EN;
SPI1->CR2 |= SPI_CR2_TXDMAEN; /* start the transfer */
}
No interrupts needed for dma or the spi peripheral, spi setup could be as simple as:
SPI1->CR1 = /*SPI_CR1_LSBFIRST | */ SPI_CR1_MSTR /* | SPI_CR1_BR_1 */ | SPI_CR1_BR_0 | SPI_CR1_CPHA | SPI_CR1_CPOL;
SPI1->CR2 = SPI_CR2_SSOE;
SPI1->CR1 |= SPI_CR1_SPE;
IO_ALTFUNC(GPIOB, 3, 0); /* PB3 AF0 = SPI1 CLK */
IO_ALTFUNC(GPIOB, 4, 0); /* PB4 AF0 = SPI1 MISO */ <---all for L051 to be checked!
IO_ALTFUNC(GPIOB, 5, 0); /* PB5 AF0 = SPI1 MOSI */
In general I would say, use spi peripheral interrupts if not using dma. If using dma, don't use spi interrupts, optionally use dma interrupts. In simple cases at least.