AnsweredAssumed Answered

Spi dma: can't change spi prescale

Question asked by Kauppi.Teijo on Jan 16, 2017
Latest reply on Jan 17, 2017 by Kauppi.Teijo

Hi,

 

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()
{
    SPI_Cmd(SPI1, DISABLE);
    while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_BSY) == SET); // STUCK HERE
    SPI_I2S_ReceiveData(SPI1);

Outcomes