Skip to main content
michaldemin2
Associate
January 17, 2010
Question

spi2 and dma

  • January 17, 2010
  • 3 replies
  • 1201 views
Posted on January 17, 2010 at 12:32

spi2 and dma

    This topic has been closed for replies.

    3 replies

    16-32micros
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:38

    Hi,

    The mistake is here :

    Quote:

    // SPI module enable

    if (SPI == SPI1) {

    RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);

    } else {

    RCC_APB2PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);

    SPI2 is connected to APB1 not APB2 , so you should modify the second line to

    RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);

    hope this helps you :)

    STOne-32.

    michaldemin2
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:38

    Hello

    I have created set of functions to initialize and use SPI1 channel with DMA.

    I have tried to expand it to be able to use SPI2 also. But I'm not getting any DMA interrupts for SPI2 channel.

    Does SPI2 differ from SPI1? Did I miss something in the Datasheet ?

    I'm attaching the code as spi.txt

    michaldemin2
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:38

    Thanks a lot. I have fixed it few hours earlier ;)