Skip to main content
egywell
Associate II
June 15, 2018
Question

SPI_DMA Slave Receive only after reset

  • June 15, 2018
  • 2 replies
  • 802 views
Posted on June 15, 2018 at 07:53

Hi st

I try to recieve spi dma slave by stm32f746 as slave 

i send two bytes for test from master raspberry 

when reset mcu it receive ok  when i repeat request it receive nothing and rx buffer not changed

i tried checking over run and interrupts and error found nothing 

it seem to be time sync problem with master but how it work after reset then stop working without any error

    This topic has been closed for replies.

    2 replies

    T J
    Senior III
    June 15, 2018
    Posted on June 15, 2018 at 11:54

    there is no time sync, the input clock bits are counted to 8 then the data is latched.

    I guess you are clearing the Rx buffer

    // initialise by clearing residual bytes in DR

        while ((hspi1.Instance->SR  & SPI_FLAG_RXNE))

            RxSPI = hspi1.Instance->DR;

    // wait for next Rx

    while ((hspi1.Instance->SR  & SPI_FLAG_RXNE)) ;

    RxSPI = hspi1.Instance->DR;  // have new byte  //should save to buffer

    otherwise you may have a poor ground between your SPI device and the F746.

    can you check the clock line is going to ground on a scope connected to the F746 ground.?

    egywell
    egywellAuthor
    Associate II
    June 15, 2018
    Posted on June 15, 2018 at 13:49

    Thanks for replyI tried clean buffer same problemNo problem with groundWhen I use spi polling no DMA it is OK which mean there something with timing I do not know

    Sent from Yahoo Mail on Android

    On Fri, Jun 15, 2018 at 11:55 AM, T J<st-microelectronics@jiveon.com> wrote:

    #yiv5753348846 * #yiv5753348846 a #yiv5753348846 body {font-family:Helvetica, Arial, sans-serif;}#yiv5753348846 #yiv5753348846 h1, #yiv5753348846 h2, #yiv5753348846 h3, #yiv5753348846 h4, #yiv5753348846 h5, #yiv5753348846 h6, #yiv5753348846 p, #yiv5753348846 hr {}#yiv5753348846 .yiv5753348846button td {}

    |

    STMicroelectronics Community

    |

    Re: SPI_DMA Slave Receive only after reset

    reply from T J in STM32 MCUs Forum - View the full discussion

    there is no time sync, the input clock bits are counted to 8 then the data is latched.

    I guess you are clearing the Rx buffer

    // initialise by clearing residual bytes in DR

    while ((hspi1.Instance->SR & SPI_FLAG_RXNE))

    RxSPI = hspi1.Instance->DR;

    // wait for next Rx

    while ((hspi1.Instance->SR & SPI_FLAG_RXNE)) ;

    RxSPI = hspi1.Instance->DR; // have new byte //should save to buffer

    otherwise you may have a poor ground between your SPI device and the F7

    can you check the clock line is going to ground on a scope connected to the F746 ground.?

    Reply to this message by replying to this email, or go to the message on STMicroelectronics Community

    Start a new discussion in STM32 MCUs Forum by email or at STMicroelectronics Community

    Following Re: SPI_DMA Slave Receive only after reset in these streams: Inbox

    This email was sent by STMicroelectronics Community because you are a registered user.

    You may unsubscribe instantly from STMicroelectronics Community, or adjust email frequency in your email preferences

    ________________

    Attachments :

    Untitled.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxUj&d=%2Fa%2F0X0000000ayo%2FHGfZ39noQtg1IrebSpb5L0WsE1iS8K6CaLkz3ndLH44&asPdf=false