I'm trying to get spi driver working for ad-converter. Adc spi is supporting ~20mhz spi clock. Now my project APB2(Using spi1) clock is 84 Mhz and spi prescale is now 2( Spi clock is 42Mhz) and code is running fine, but some samples is corrupted, so i assumed that the problem is that spi clock is too high(). Problem is when i change prescale to 4 it's get stuck to loop which check if spi running. This code is required call every time dma is complete.
static void stopReceiving()
while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_BSY) == SET); // STUCK HERE