AnsweredAssumed Answered

SPI FLASH read/write problem

Question asked by karpavicius.linas on Jul 21, 2013
Latest reply on Jun 29, 2015 by pathan.imran
Hello, i am making adsp-21488 spi flash programmer, and i run into some trublmes.

I use STM32F415 and using SPI1 (PA5/6/7) nad PB0 for communication with SPI.
I can read Flash ID with no problem, and it's same as declared in pdf, so my spi is ok.
but i can't do any read or write (maybe just write, since i read void data)

I use different SPI flash as in example, but all commands, and timings are the same
SST25VF016B in board, but example is for M25P64

Any idea why it's not write data correctly ? (It fails write, but pass in erase test) (if i run spi exaplme code, i get only first letter, all others are FF )
SPI init looks like this:
SPI_InitTypeDef  SPI_InitStructure;
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(sFLASH_SPI, &SPI_InitStructure);


I don't know whats wrong, i spend all day trying to make it work, but in the end, it does not. I attached EWBARM project for some one to take a look

Any help would be greait