cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 SPI Flash Problems

hughes
Associate
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.
3 REPLIES 3
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
Up vote any posts that you find helpful, it shows what's working..
hughes
Associate
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
Senior
Posted on November 12, 2014 at 09:07

WP and HOLD is connected to logic high ?