Skip to main content
hughes
Associate
November 11, 2014
Question

STM32 SPI Flash Problems

  • November 11, 2014
  • 3 replies
  • 979 views
Posted on November 11, 2014 at 15:51

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    November 11, 2014
    Posted on November 11, 2014 at 17:04

    I'd be using SPI_Send_Receive() for everything. Back waiting on TX as you do in the opcode send is broken, you want to wait on RXNE AND read the SPI data register to clear RXNE

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    hughes
    hughesAuthor
    Associate
    November 12, 2014
    Posted on November 12, 2014 at 07:59

    Thanks for the advice.

    Another source of the problem though was that the clock speed was too slow on the SPI pins compared to the NCS pin. After changing my prescale value to

    SPI_InitStructure.SPI_BaudRatePrescaler
    =
    SPI_BaudRatePrescaler_8
    ;

    everything started working correctly.

    There were also a few issues in the code as clive.002 pointed out.
    megahercas6
    Associate III
    November 12, 2014
    Posted on November 12, 2014 at 09:07

    WP and HOLD is connected to logic high ?